63 return *GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>(
"fpedit" );
70 m_unitProvider( aUnitsProvider ),
100 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
102 auto disableCell = [&](
int row,
int col )
105 m_graphicsGrid->SetCellBackgroundColour( row, col, disabledColour );
132 auto attr =
new wxGridCellAttr;
133 attr->SetRenderer(
new wxGridCellBoolRenderer() );
135 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
170 bool retVal = wxPanel::Show( aShow );
198 bool badParam =
false;
202 if( lineWidth < minWidth || lineWidth > maxWidth )
204 if( !errorsMsg.IsEmpty() )
205 errorsMsg += wxT(
"\n\n" );
207 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
208 "It must be between %s and %s" ),
226 if( textWidth <
minSize || textHeight < minSize || textWidth > maxSize || textHeight > maxSize )
228 if( !errorsMsg.IsEmpty() )
229 errorsMsg += wxT(
"\n\n" );
231 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
232 "Size must be between %s and %s" ),
240 int textMinDim = std::min( textWidth, textHeight );
241 int textMaxThickness = std::min( maxWidth, textMinDim / 4 );
243 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
245 if( !errorsMsg.IsEmpty() )
246 errorsMsg += wxT(
"\n\n" );
248 if( textThickness > textMaxThickness )
250 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
251 "It will be truncated to %s" ),
255 else if( textThickness < minWidth )
257 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
258 "It will be truncated to %s" ),
263 textThickness = std::min( textThickness, textMaxThickness );
264 textThickness = std::max( textThickness, minWidth );
275 cfg.
m_TextItalic[i] = wxGridCellBoolEditor::IsTrueValue( msg );
280 if( errorsMsg.IsEmpty() )
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
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)
Calculate 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 EUNITS_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()
constexpr int mmToIU(double mm) const
VECTOR2< int32_t > VECTOR2I