101 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
103 auto disableCell = [&](
int row,
int col )
106 m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
133 auto attr =
new wxGridCellAttr;
134 attr->SetRenderer(
new wxGridCellBoolRenderer() );
136 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
173 bool retVal = wxPanel::Show( aShow );
201 bool badParam =
false;
205 if( lineWidth < minWidth || lineWidth > maxWidth )
207 if( !errorsMsg.IsEmpty() )
208 errorsMsg += wxT(
"\n\n" );
210 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
211 "It must be between %s and %s" ),
229 if( textWidth <
minSize || textHeight < minSize || textWidth > maxSize
230 || textHeight > maxSize )
232 if( !errorsMsg.IsEmpty() )
233 errorsMsg += wxT(
"\n\n" );
235 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
236 "Size must be between %s and %s" ),
244 int textMinDim = std::min( textWidth, textHeight );
245 int textMaxThickness = std::min( maxWidth, textMinDim / 4 );
247 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
249 if( !errorsMsg.IsEmpty() )
250 errorsMsg += wxT(
"\n\n" );
252 if( textThickness > textMaxThickness )
253 errorsMsg += wxString::Format(
254 _(
"%s: Text thickness is too large.\n"
255 "It will be truncated to %s" ),
259 else if( textThickness < minWidth )
260 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
261 "It will be truncated to %s" ),
265 textThickness = std::min( textThickness, textMaxThickness );
266 textThickness = std::max( textThickness, minWidth );
277 cfg.
m_TextItalic[i] = wxGridCellBoolEditor::IsTrueValue( msg );
282 if( errorsMsg.IsEmpty() )
286 _(
"Parameter error" ) );
constexpr EDA_IU_SCALE pcbIUScale
#define MINIMUM_LINE_WIDTH_MM
#define MAXIMUM_LINE_WIDTH_MM
Container for design settings for a BOARD object.
int m_TextThickness[LAYER_CLASS_COUNT]
int m_LineThickness[LAYER_CLASS_COUNT]
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
bool m_TextItalic[LAYER_CLASS_COUNT]
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
virtual void Load()
Updates the parameters of this object based on the current JSON document contents.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Class PANEL_FP_EDITOR_GRAPHICS_DEFAULTS_BASE.
~PANEL_FP_EDITOR_GRAPHICS_DEFAULTS() override
bool TransferDataFromWindow() override
bool Show(bool aShow) override
std::unique_ptr< PANEL_SETUP_DIMENSIONS > m_dimensionsPanel
void loadFPSettings(const FOOTPRINT_EDITOR_SETTINGS *aCfg)
PANEL_FP_EDITOR_GRAPHICS_DEFAULTS(wxWindow *aParent, UNITS_PROVIDER *aUnitsProvider)
void ResetPanel() override
Reset the contents of this panel.
BOARD_DESIGN_SETTINGS & m_designSettings
UNITS_PROVIDER * m_unitProvider
bool TransferDataToWindow() override
virtual SETTINGS_MANAGER & GetSettingsManager() const
T * GetAppSettings(const wxString &aFilename)
Returns a handle to the a given settings by type If the settings have already been loaded,...
wxString StringFromValue(double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
Converts aValue in internal units into a united string.
int GetVisibleWidth(int aCol, bool aHeader=true, bool aContents=true, bool aKeep=false)
Calculates the specified column based on the actual size of the text on screen.
void SetUnitValue(int aRow, int aCol, int aValue)
Set a unitized cell's value.
int GetUnitValue(int aRow, int aCol)
Apply standard KiCad unit and eval services to a numeric cell.
void SetAutoEvalCols(const std::vector< int > &aCols)
void SetUnitsProvider(UNITS_PROVIDER *aProvider, int aCol=0)
Set a UNITS_PROVIDER to enable use of unit- and eval-based Getters.
bool CommitPendingChanges(bool aQuietMode=false)
Close any open cell edit controls.
This file is part of the common library.
const int minSize
Push and Shove router track width and via size dialog.
#define TEXT_MIN_SIZE_MM
Minimum text size (1 micron).
#define TEXT_MAX_SIZE_MM
Maximum text size in mm (~10 inches)
This file is part of the common library.
static FOOTPRINT_EDITOR_SETTINGS & GetPgmSettings()
static FOOTPRINT_EDITOR_SETTINGS & GetPgmSettings()
PGM_BASE & Pgm()
The global Program "get" accessor.
constexpr int mmToIU(double mm) const
VECTOR2< int32_t > VECTOR2I