129 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
131#define SET_MILS_CELL( row, col, val ) \
132 m_grid->SetCellValue( row, col, m_Frame->StringFromValue( val, true ) )
134#define DISABLE_CELL( row, col ) \
135 m_grid->SetReadOnly( row, col ); m_grid->SetCellBackgroundColour( row, col, disabledColour );
159 auto attr =
new wxGridCellAttr;
160 attr->SetRenderer(
new wxGridCellBoolRenderer() );
162 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
165 attr =
new wxGridCellAttr;
166 attr->SetRenderer(
new wxGridCellBoolRenderer() );
168 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
174 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
175 m_grid->SetColMinimalWidth( col,
m_grid->GetVisibleWidth( col ) );
177 m_grid->SetRowLabelSize(
m_grid->GetVisibleWidth( -1,
true,
true,
true ) );
185 if( !
m_grid->CommitPendingChanges() )
198 bool badParam =
false;
202 if( lineWidth < minWidth || lineWidth > maxWidth )
204 if( !errorsMsg.IsEmpty() )
205 errorsMsg += wxT(
"\n\n" );
207 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
208 "It must be between %s and %s" ),
209 m_grid->GetRowLabelValue( i ),
226 if( textWidth <
minSize || textHeight < minSize || textWidth > maxSize || textHeight > maxSize )
228 if( !errorsMsg.IsEmpty() )
229 errorsMsg += wxT(
"\n\n" );
231 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
232 "Size must be between %s and %s" ),
233 m_grid->GetRowLabelValue( i ),
240 int textMaxThickness = std::min( maxWidth, std::min( textWidth, textHeight ) /4);
242 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
244 if( !errorsMsg.IsEmpty() )
245 errorsMsg += wxT(
"\n\n" );
247 if( textThickness > textMaxThickness )
249 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
250 "It will be truncated to %s" ),
251 m_grid->GetRowLabelValue( i ),
254 else if( textThickness < minWidth )
256 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
257 "It will be truncated to %s" ),
258 m_grid->GetRowLabelValue( i ),
262 textThickness = std::min( textThickness, textMaxThickness );
263 textThickness = std::max( textThickness, minWidth );
279 if( errorsMsg.IsEmpty() )
PANEL_SETUP_TEXT_AND_GRAPHICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
bool TransferDataToWindow() override
bool TransferDataFromWindow() override
BOARD_DESIGN_SETTINGS * m_BrdSettings
~PANEL_SETUP_TEXT_AND_GRAPHICS() override
void onUnitsChanged(wxCommandEvent &aEvent)
PANEL_SETUP_TEXT_AND_GRAPHICS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame, BOARD_DESIGN_SETTINGS *aBrdSettings)
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
#define SET_MILS_CELL(row, col, val)
#define DISABLE_CELL(row, col)