63 m_BrdSettings( &m_Frame->
GetBoard()->GetDesignSettings() ),
72 m_grid->SetDefaultRowSize(
m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
73 m_grid->SetUseNativeColLabels();
83 int min_best_width =
m_grid->GetTextExtent( wxT(
"555,555555 mils" ) ).x;
85 for(
int i = 0; i <
m_grid->GetNumberCols(); ++i )
91 m_grid->SetColMinimalWidth( i, min_width );
94 m_grid->SetColSize( i, std::max( min_width, min_best_width ) );
111 m_grid->PopEventHandler(
true );
135 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
137#define SET_MILS_CELL( row, col, val ) \
138 m_grid->SetCellValue( row, col, m_Frame->StringFromValue( val, true ) )
140#define DISABLE_CELL( row, col ) \
141 m_grid->SetReadOnly( row, col ); m_grid->SetCellBackgroundColour( row, col, disabledColour );
165 auto attr =
new wxGridCellAttr;
166 attr->SetRenderer(
new wxGridCellBoolRenderer() );
168 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
171 attr =
new wxGridCellAttr;
172 attr->SetRenderer(
new wxGridCellBoolRenderer() );
174 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
180 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
208 bool badParam =
false;
212 if( lineWidth < minWidth || lineWidth > maxWidth )
214 if( !errorsMsg.IsEmpty() )
215 errorsMsg += wxT(
"\n\n" );
217 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
218 "It must be between %s and %s" ),
219 m_grid->GetRowLabelValue( i ),
237 || textWidth > maxSize || textHeight > maxSize )
239 if( !errorsMsg.IsEmpty() )
240 errorsMsg += wxT(
"\n\n" );
242 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
243 "Size must be between %s and %s" ),
244 m_grid->GetRowLabelValue( i ),
251 int textMaxThickness = std::min( maxWidth, std::min( textWidth, textHeight ) /4);
253 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
255 if( !errorsMsg.IsEmpty() )
256 errorsMsg += wxT(
"\n\n" );
259 if( textThickness > textMaxThickness )
260 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
261 "It will be truncated to %s" ),
262 m_grid->GetRowLabelValue( i ),
265 else if( textThickness < minWidth )
266 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
267 "It will be truncated to %s" ),
268 m_grid->GetRowLabelValue( i ),
271 textThickness = std::min( textThickness, textMaxThickness );
272 textThickness = std::max( textThickness, minWidth );
290 if( errorsMsg.IsEmpty() )
294 _(
"Parameter error" ) );
constexpr EDA_IU_SCALE pcbIUScale
#define MINIMUM_LINE_WIDTH_MM
#define MAXIMUM_LINE_WIDTH_MM
Container for design settings for a BOARD object.
bool m_TextUpright[LAYER_CLASS_COUNT]
int m_TextThickness[LAYER_CLASS_COUNT]
int m_LineThickness[LAYER_CLASS_COUNT]
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
bool m_TextItalic[LAYER_CLASS_COUNT]
Information pertinent to a Pcbnew printed circuit board.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Class PANEL_SETUP_TEXT_AND_GRAPHICS_BASE.
bool TransferDataToWindow() override
std::unique_ptr< PANEL_SETUP_DIMENSIONS > m_dimensionsPanel
bool TransferDataFromWindow() override
PANEL_SETUP_TEXT_AND_GRAPHICS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame)
BOARD_DESIGN_SETTINGS * m_BrdSettings
~PANEL_SETUP_TEXT_AND_GRAPHICS() override
void ImportSettingsFrom(BOARD *aBoard)
void onUnitsChanged(wxCommandEvent &aEvent)
The main frame for Pcbnew.
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculate the specified column based on the actual size of the text on screen.
int GetUnitValue(int aRow, int aCol)
Apply standard KiCad unit and eval services to a numeric cell.
void SetAutoEvalCols(const std::vector< int > &aCols)
void SetUnitsProvider(UNITS_PROVIDER *aProvider, int aCol=0)
Set a EUNITS_PROVIDER to enable use of unit- and eval-based Getters.
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
const int minSize
Push and Shove router track width and via size dialog.
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
This file is part of the common library.
#define SET_MILS_CELL(row, col, val)
#define DISABLE_CELL(row, col)
constexpr int mmToIU(double mm) const
VECTOR2< int32_t > VECTOR2I