25#include <wx/textdlg.h>
44 m_unitsProvider( aUnitsProvider ),
46 m_frameType( aFrameType ),
47 m_eventSource( aEventSource )
113 wxString savedGrid1 =
m_grid1Ctrl->GetStringSelection();
114 wxString savedGrid2 =
m_grid2Ctrl->GetStringSelection();
134 if( !
name.IsEmpty() )
137 msg.Printf(
_(
"%s%s (%s)" ),
name,
grid.MessageText(
scale, primaryUnit,
true ),
138 grid.MessageText(
scale, secondaryUnit,
true ) );
157 if( !
m_grid1Ctrl->SetStringSelection( savedGrid1 ) )
160 if( !
m_grid2Ctrl->SetStringSelection( savedGrid2 ) )
203 return RESETTABLE_PANEL::TransferDataFromWindow();
212 auto safeGrid = [
this](
int idx ) ->
int
214 if( idx < 0 || idx >= (
int)
m_grids.size() )
242 return RESETTABLE_PANEL::TransferDataToWindow();
248 GRID newGrid =
GRID{ wxEmptyString,
"",
"" };
261 wxWindow* topLevelParent = wxGetTopLevelParent(
this );
264 wxString::Format(
_(
"Grid size '%s' already exists." ),
305 wxWindow* topLevelParent = wxGetTopLevelParent(
this );
308 wxString::Format(
_(
"Grid size '%s' already exists." ),
340 if(
m_grids.size() <= 1 || row == 0 )
376 int numRows = (int)
m_grids.size();
379 event.Enable( ( numRows > 1 ) && ( curRow > 0 ) );
386 int numRows = (int)
m_grids.size();
389 event.Enable( ( numRows > 1 ) && ( curRow < ( numRows - 1 ) ) );
396 event.Enable(
m_grids.size() > 1 );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
static TOOL_ACTION gridFast1
static TOOL_ACTION gridFast2
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
const std::vector< GRID > DefaultGridSizeList() const
Class PANEL_GRID_SETTINGS_BASE.
STD_BITMAP_BUTTON * m_removeGridButton
STD_BITMAP_BUTTON * m_editGridButton
wxStaticLine * m_staticline3
wxCheckBox * m_checkGridOverrideConnected
wxCheckBox * m_checkGridOverrideText
wxChoice * m_gridOverrideConnectedChoice
wxCheckBox * m_checkGridOverrideGraphics
wxChoice * m_gridOverrideWiresChoice
STD_BITMAP_BUTTON * m_moveDownButton
wxStaticText * m_overridesLabel
wxChoice * m_gridOverrideTextChoice
wxCheckBox * m_checkGridOverrideVias
wxStaticText * m_grid2HotKey
wxStaticText * m_grid1HotKey
wxListBox * m_currentGridCtrl
wxChoice * m_gridOverrideGraphicsChoice
wxChoice * m_gridOverrideViasChoice
wxCheckBox * m_checkGridOverrideWires
STD_BITMAP_BUTTON * m_addGridButton
STD_BITMAP_BUTTON * m_moveUpButton
void ResetPanel() override
Reset the contents of this panel.
bool TransferDataToWindow() override
void OnEditGrid(wxCommandEvent &event) override
void OnRemoveGrid(wxCommandEvent &event) override
void OnMoveGridDown(wxCommandEvent &event) override
void OnUpdateEditGrid(wxUpdateUIEvent &event) override
bool TransferDataFromWindow() override
APP_SETTINGS_BASE * m_cfg
void OnUpdateMoveDown(wxUpdateUIEvent &event) override
void OnUpdateMoveUp(wxUpdateUIEvent &event) override
void OnMoveGridUp(wxCommandEvent &event) override
std::vector< GRID > m_grids
PANEL_GRID_SETTINGS(wxWindow *aParent, UNITS_PROVIDER *aUnitsProvider, wxWindow *aEventSource, APP_SETTINGS_BASE *aCfg, FRAME_T aFrameType)
This has no dependencies on calling wxFrame derivative, such as PCB_BASE_FRAME.
UNITS_PROVIDER * m_unitsProvider
void OnUpdateRemove(wxUpdateUIEvent &event) override
void OnAddGrid(wxCommandEvent &event) override
const EDA_IU_SCALE & GetIuScale() const
virtual void GetUnitPair(EDA_UNITS &aPrimaryUnit, EDA_UNITS &aSecondaryUnits)
void DisplayError(wxWindow *aParent, const wxString &aText, int aDisplayTime)
Display an error or warning message box with aMessage.
This file is part of the common library.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
@ FRAME_SCH_SYMBOL_EDITOR
wxString KeyNameFromKeyCode(int aKeycode, bool *aIsFound)
Return the key name from the key code.
int override_connected_idx
std::vector< GRID > grids
int override_graphics_idx
Common grid settings, available to every frame.