97 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
99 auto disableCell = [&](
int row,
int col )
102 m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
129 auto attr =
new wxGridCellAttr;
130 attr->SetRenderer(
new wxGridCellBoolRenderer() );
132 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
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" ),
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" ),
237 int textMinDim = std::min( textWidth, textHeight );
238 int textMaxThickness = std::min( maxWidth, textMinDim / 4 );
240 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
242 if( !errorsMsg.IsEmpty() )
243 errorsMsg += wxT(
"\n\n" );
245 if( textThickness > textMaxThickness )
247 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
248 "It will be truncated to %s" ),
252 else if( textThickness < minWidth )
254 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
255 "It will be truncated to %s" ),
260 textThickness = std::min( textThickness, textMaxThickness );
261 textThickness = std::max( textThickness, minWidth );
272 cfg.
m_TextItalic[i] = wxGridCellBoolEditor::IsTrueValue( msg );
277 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)