126 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
128#define SET_MILS_CELL( row, col, val ) \
129 m_grid->SetCellValue( row, col, m_Frame->StringFromValue( val, true ) )
131#define DISABLE_CELL( row, col ) \
132 m_grid->SetReadOnly( row, col ); m_grid->SetCellBackgroundColour( row, col, disabledColour );
156 auto attr =
new wxGridCellAttr;
157 attr->SetRenderer(
new wxGridCellBoolRenderer() );
159 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
162 attr =
new wxGridCellAttr;
163 attr->SetRenderer(
new wxGridCellBoolRenderer() );
165 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
171 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
172 m_grid->SetColMinimalWidth( col,
m_grid->GetVisibleWidth( col ) );
174 m_grid->SetRowLabelSize(
m_grid->GetVisibleWidth( -1,
true,
true,
true ) );
182 if( !
m_grid->CommitPendingChanges() )
195 bool badParam =
false;
199 if( lineWidth < minWidth || lineWidth > maxWidth )
201 if( !errorsMsg.IsEmpty() )
202 errorsMsg += wxT(
"\n\n" );
204 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
205 "It must be between %s and %s" ),
206 m_grid->GetRowLabelValue( i ),
223 if( textWidth <
minSize || textHeight < minSize || textWidth > maxSize || textHeight > maxSize )
225 if( !errorsMsg.IsEmpty() )
226 errorsMsg += wxT(
"\n\n" );
228 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
229 "Size must be between %s and %s" ),
230 m_grid->GetRowLabelValue( i ),
237 int textMaxThickness = std::min( maxWidth, std::min( textWidth, textHeight ) /4);
239 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
241 if( !errorsMsg.IsEmpty() )
242 errorsMsg += wxT(
"\n\n" );
244 if( textThickness > textMaxThickness )
246 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
247 "It will be truncated to %s" ),
248 m_grid->GetRowLabelValue( i ),
251 else if( textThickness < minWidth )
253 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
254 "It will be truncated to %s" ),
255 m_grid->GetRowLabelValue( i ),
259 textThickness = std::min( textThickness, textMaxThickness );
260 textThickness = std::max( textThickness, minWidth );
276 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)