71 m_grid->SetUseNativeColLabels();
81 int min_best_width =
m_grid->GetTextExtent( wxT(
"555,555555 mils" ) ).x;
83 for(
int i = 0; i <
m_grid->GetNumberCols(); ++i )
87 int min_width =
m_grid->GetVisibleWidth( i );
89 m_grid->SetColMinimalWidth( i, min_width );
92 m_grid->SetColSize( i, std::max( min_width, min_best_width ) );
109 m_grid->PopEventHandler(
true );
133 wxColour disabledColour = wxSystemSettings::GetColour( wxSYS_COLOUR_FRAMEBK );
135#define SET_MILS_CELL( row, col, val ) \
136 m_grid->SetCellValue( row, col, m_Frame->StringFromValue( val, true ) )
138#define DISABLE_CELL( row, col ) \
139 m_grid->SetReadOnly( row, col ); m_grid->SetCellBackgroundColour( row, col, disabledColour );
163 auto attr =
new wxGridCellAttr;
164 attr->SetRenderer(
new wxGridCellBoolRenderer() );
166 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
169 attr =
new wxGridCellAttr;
170 attr->SetRenderer(
new wxGridCellBoolRenderer() );
172 attr->SetAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
178 for(
int col = 0; col <
m_grid->GetNumberCols(); col++ )
179 m_grid->SetColMinimalWidth( col,
m_grid->GetVisibleWidth( col ) );
181 m_grid->SetRowLabelSize(
m_grid->GetVisibleWidth( -1,
true,
true,
true ) );
193 if( !
m_grid->CommitPendingChanges() )
206 bool badParam =
false;
210 if( lineWidth < minWidth || lineWidth > maxWidth )
212 if( !errorsMsg.IsEmpty() )
213 errorsMsg += wxT(
"\n\n" );
215 errorsMsg += wxString::Format(
_(
"%s: Incorrect line width.\n"
216 "It must be between %s and %s" ),
217 m_grid->GetRowLabelValue( i ),
234 if( textWidth <
minSize || textHeight < minSize || textWidth > maxSize || textHeight > maxSize )
236 if( !errorsMsg.IsEmpty() )
237 errorsMsg += wxT(
"\n\n" );
239 errorsMsg += wxString::Format(
_(
"%s: Text size is incorrect.\n"
240 "Size must be between %s and %s" ),
241 m_grid->GetRowLabelValue( i ),
248 int textMaxThickness = std::min( maxWidth, std::min( textWidth, textHeight ) /4);
250 if( !badParam && ( textThickness < minWidth || textThickness > textMaxThickness ) )
252 if( !errorsMsg.IsEmpty() )
253 errorsMsg += wxT(
"\n\n" );
255 if( textThickness > textMaxThickness )
257 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too large.\n"
258 "It will be truncated to %s" ),
259 m_grid->GetRowLabelValue( i ),
262 else if( textThickness < minWidth )
264 errorsMsg += wxString::Format(
_(
"%s: Text thickness is too small.\n"
265 "It will be truncated to %s" ),
266 m_grid->GetRowLabelValue( i ),
270 textThickness = std::min( textThickness, textMaxThickness );
271 textThickness = std::max( textThickness, minWidth );
289 if( errorsMsg.IsEmpty() )
301 if( !
m_grid->CommitPendingChanges() )
constexpr EDA_IU_SCALE pcbIUScale
#define MINIMUM_LINE_WIDTH_MM
#define MAXIMUM_LINE_WIDTH_MM
Container for design settings for a BOARD object.
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.
PANEL_SETUP_TEXT_AND_GRAPHICS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
bool TransferDataToWindow() override
std::unique_ptr< PANEL_SETUP_DIMENSIONS > m_dimensionsPanel
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)
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.
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)
#define SET_MILS_CELL(row, col, val)
#define DISABLE_CELL(row, col)
VECTOR2< int32_t > VECTOR2I