96 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
98 auto disableCell = [&](
int row,
int col )
101 m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
128 auto attr =
new wxGridCellAttr;
129 attr->SetRenderer(
new wxGridCellBoolRenderer() );
131 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
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" ),
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" ),
236 int textMinDim = std::min( textWidth, textHeight );
237 int textMaxThickness = std::min( maxWidth, textMinDim / 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" ),
251 else if( textThickness < minWidth )
253 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
254 "It will be truncated to %s" ),
259 textThickness = std::min( textThickness, textMaxThickness );
260 textThickness = std::max( textThickness, minWidth );
271 cfg.
m_TextItalic[i] = wxGridCellBoolEditor::IsTrueValue( msg );
276 if( errorsMsg.IsEmpty() )
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)