125 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
127#define SET_MILS_CELL( row, col, val ) \
128 m_grid->SetCellValue( row, col, m_Frame->StringFromValue( val, true ) )
130#define DISABLE_CELL( row, col ) \
131 m_grid->SetReadOnly( row, col ); m_grid->SetCellBackgroundColour( row, col, disabledColour );
155 auto attr =
new wxGridCellAttr;
156 attr->SetRenderer(
new wxGridCellBoolRenderer() );
158 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
161 attr =
new wxGridCellAttr;
162 attr->SetRenderer(
new wxGridCellBoolRenderer() );
164 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
170 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
171 m_grid->SetColMinimalWidth( col,
m_grid->GetVisibleWidth( col ) );
173 m_grid->SetRowLabelSize(
m_grid->GetVisibleWidth( -1,
true,
true,
true ) );
181 if( !
m_grid->CommitPendingChanges() )
194 bool badParam =
false;
198 if( lineWidth < minWidth || lineWidth > maxWidth )
200 if( !errorsMsg.IsEmpty() )
201 errorsMsg += wxT(
"\n\n" );
203 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
204 "It must be between %s and %s" ),
205 m_grid->GetRowLabelValue( i ),
222 if( textWidth <
minSize || textHeight < minSize || textWidth > maxSize || textHeight > maxSize )
224 if( !errorsMsg.IsEmpty() )
225 errorsMsg += wxT(
"\n\n" );
227 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
228 "Size must be between %s and %s" ),
229 m_grid->GetRowLabelValue( i ),
236 int textMaxThickness = std::min( maxWidth, std::min( textWidth, textHeight ) /4);
238 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
240 if( !errorsMsg.IsEmpty() )
241 errorsMsg += wxT(
"\n\n" );
243 if( textThickness > textMaxThickness )
245 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
246 "It will be truncated to %s" ),
247 m_grid->GetRowLabelValue( i ),
250 else if( textThickness < minWidth )
252 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
253 "It will be truncated to %s" ),
254 m_grid->GetRowLabelValue( i ),
258 textThickness = std::min( textThickness, textMaxThickness );
259 textThickness = std::max( textThickness, minWidth );
275 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)