31#include <wx/treebook.h>
62 m_arrowLength( aFrame, m_lblArrowLength, m_dimensionArrowLength, m_arrowLengthUnits ),
63 m_extensionOffset( aFrame, m_lblExtensionOffset, m_dimensionExtensionOffset,
64 m_dimensionExtensionOffsetUnits )
74 m_grid->SetDefaultRowSize(
m_grid->GetDefaultRowSize() + FromDIP( 4 ) );
75 m_grid->SetUseNativeColLabels();
85 int min_best_width =
m_grid->GetTextExtent( wxT(
"555,555555 mils" ) ).x;
87 for(
int i = 0; i <
m_grid->GetNumberCols(); ++i )
93 m_grid->SetColMinimalWidth( i, min_width );
96 m_grid->SetColSize( i, std::max( min_width, min_best_width ) );
108 m_grid->PopEventHandler(
true );
132 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
134#define SET_MILS_CELL( row, col, val ) \
135 m_grid->SetCellValue( row, col, m_Frame->StringFromValue( val, true ) )
137#define DISABLE_CELL( row, col ) \
138 m_grid->SetReadOnly( row, col ); m_grid->SetCellBackgroundColour( row, col, disabledColour );
162 auto attr =
new wxGridCellAttr;
163 attr->SetRenderer(
new wxGridCellBoolRenderer() );
165 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
168 attr =
new wxGridCellAttr;
169 attr->SetRenderer(
new wxGridCellBoolRenderer() );
171 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
177 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
215 bool badParam =
false;
219 if( lineWidth < minWidth || lineWidth > maxWidth )
221 if( !errorsMsg.IsEmpty() )
222 errorsMsg += wxT(
"\n\n" );
224 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
225 "It must be between %s and %s" ),
226 m_grid->GetRowLabelValue( i ),
244 || textWidth > maxSize || textHeight > maxSize )
246 if( !errorsMsg.IsEmpty() )
247 errorsMsg += wxT(
"\n\n" );
249 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
250 "Size must be between %s and %s" ),
251 m_grid->GetRowLabelValue( i ),
258 int textMaxThickness = std::min( maxWidth, std::min( textWidth, textHeight ) /4);
260 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
262 if( !errorsMsg.IsEmpty() )
263 errorsMsg += wxT(
"\n\n" );
266 if( textThickness > textMaxThickness )
267 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
268 "It will be truncated to %s" ),
269 m_grid->GetRowLabelValue( i ),
272 else if( textThickness < minWidth )
273 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
274 "It will be truncated to %s" ),
275 m_grid->GetRowLabelValue( i ),
278 textThickness = std::min( textThickness, textMaxThickness );
279 textThickness = std::max( textThickness, minWidth );
311 if( errorsMsg.IsEmpty() )
315 _(
"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.
DIM_PRECISION m_DimensionPrecision
Number of digits after the decimal.
DIM_UNITS_FORMAT m_DimensionUnitsFormat
bool m_TextUpright[LAYER_CLASS_COUNT]
bool m_DimensionSuppressZeroes
int m_TextThickness[LAYER_CLASS_COUNT]
int m_LineThickness[LAYER_CLASS_COUNT]
bool m_DimensionKeepTextAligned
VECTOR2I m_TextSize[LAYER_CLASS_COUNT]
bool m_TextItalic[LAYER_CLASS_COUNT]
DIM_TEXT_POSITION m_DimensionTextPosition
DIM_UNITS_MODE m_DimensionUnitsMode
int m_DimensionExtensionOffset
int m_DimensionArrowLength
Information pertinent to a Pcbnew printed circuit board.
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Add mouse and command handling (such as cut, copy, and paste) to a WX_GRID instance.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
Class PANEL_SETUP_TEXT_AND_GRAPHICS_BASE.
wxChoice * m_dimensionUnitsFormat
wxChoice * m_dimensionUnits
wxCheckBox * m_dimensionSuppressZeroes
wxCheckBox * m_dimensionTextKeepAligned
wxChoice * m_dimensionTextPositionMode
wxChoice * m_dimensionPrecision
bool TransferDataToWindow() override
UNIT_BINDER m_extensionOffset
bool TransferDataFromWindow() override
PANEL_SETUP_TEXT_AND_GRAPHICS(wxWindow *aParentWindow, PCB_EDIT_FRAME *aFrame)
BOARD_DESIGN_SETTINGS * m_BrdSettings
~PANEL_SETUP_TEXT_AND_GRAPHICS() override
void ImportSettingsFrom(BOARD *aBoard)
UNIT_BINDER m_arrowLength
void onUnitsChanged(wxCommandEvent &aEvent)
The main frame for Pcbnew.
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.
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
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.
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_MILS
Minimum text size in mils.
#define TEXT_MAX_SIZE_MILS
Maximum text size in mils (10 inches)
#define SET_MILS_CELL(row, col, val)
#define DISABLE_CELL(row, col)
DIM_TEXT_POSITION
Where to place the text on a dimension.
DIM_UNITS_FORMAT
How to display the units in a dimension's text.
DIM_UNITS_MODE
Used for storing the units selection in the file because EDA_UNITS alone doesn't cut it.
constexpr int MilsToIU(int mils) const
constexpr int mmToIU(double mm) const