KiCad PCB EDA Suite
|
#include <wx_grid.h>
Public Member Functions | |
WX_GRID (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxWANTS_CHARS, const wxString &name=wxGridNameStr) | |
~WX_GRID () override | |
void | SetColLabelSize (int aHeight) |
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the system GUI font. | |
void | SetLabelFont (const wxFont &aFont) |
Hide wxGrid's SetLabelFont() because for some reason on MSW it's a one-shot and subsequent calls to it have no effect. | |
void | EnableAlternateRowColors (bool aEnable=true) |
Enable alternate row highlighting, where every odd row has a different background color than the even rows. | |
wxString | GetShownColumnsAsString () |
Get a tokenized string containing the shown column indexes. | |
std::bitset< 64 > | GetShownColumns () |
void | ShowHideColumns (const wxString &shownColumns) |
Show/hide the grid columns based on a tokenized string of shown column indexes. | |
void | ShowHideColumns (const std::bitset< 64 > &aShownColumns) |
A more performant version of ShowHideColumns (primarily for OnUpdateUI handlers). | |
void | SetTable (wxGridTableBase *table, bool aTakeOwnership=false) |
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting the table. | |
void | DestroyTable (wxGridTableBase *aTable) |
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was not closed. | |
bool | CommitPendingChanges (bool aQuietMode=false) |
Close any open cell edit controls. | |
bool | CancelPendingChanges () |
void | SetUnitsProvider (UNITS_PROVIDER *aProvider, int aCol=0) |
Set a EUNITS_PROVIDER to enable use of unit- and eval-based Getters. | |
void | SetAutoEvalCols (const std::vector< int > &aCols) |
void | SetAutoEvalColUnits (int col, EDA_UNITS aUnit, EDA_DATA_TYPE aUnitType) |
Set the unit and unit data type to use for a given column. | |
void | SetAutoEvalColUnits (int col, EDA_UNITS aUnit) |
Set the unit to use for a given column. | |
int | GetUnitValue (int aRow, int aCol) |
Apply standard KiCad unit and eval services to a numeric cell. | |
std::optional< int > | GetOptionalUnitValue (int aRow, int aCol) |
Apply standard KiCad unit and eval services to a numeric cell. | |
void | SetUnitValue (int aRow, int aCol, int aValue) |
Set a unitized cell's value. | |
void | SetOptionalUnitValue (int aRow, int aCol, std::optional< int > aValue) |
Set a unitized cell's optional value. | |
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 | EnsureColLabelsVisible () |
Ensure the height of the row displaying the column labels is enough, even if labels are multiline texts. | |
void | ShowEditorOnMouseUp () |
WxWidgets has a bunch of bugs in its handling of wxGrid mouse events which close cell editors right after opening them. | |
void | CancelShowEditorOnMouseUp () |
void | ClearRows () |
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number of rows (even if the delete count is 0). | |
void | OverrideMinSize (double aXPct, double aYPct) |
Grids that have column sizes automatically set to fill the available width don't want to shrink afterwards (because wxGrid reports the aggregate column size as the bestSize. | |
wxSize | DoGetBestSize () const override |
Static Public Member Functions | |
static void | CellEditorSetMargins (wxTextEntryBase *aEntry) |
A helper function to set OS-specific margins for text-based cell editors. | |
static void | CellEditorTransformSizeRect (wxRect &aRect) |
A helper function to tweak sizes of text-based cell editors depending on OS. | |
Protected Member Functions | |
void | DrawColLabel (wxDC &dc, int col) override |
A re-implementation of wxGrid::DrawColLabel which left-aligns the first column and draws flat borders. | |
void | DrawRowLabel (wxDC &dc, int row) override |
A re-implementation of wxGrid::DrawRowLabel which draws flat borders. | |
void | DrawCornerLabel (wxDC &dc) override |
A re-implementation of wxGrid::DrawCornerLabel which draws flat borders. | |
void | onGridColMove (wxGridEvent &aEvent) |
void | onGridCellSelect (wxGridEvent &aEvent) |
void | onCellEditorShown (wxGridEvent &aEvent) |
void | onCellEditorHidden (wxGridEvent &aEvent) |
void | onDPIChanged (wxDPIChangedEvent &event) |
UNITS_PROVIDER * | getUnitsProvider (int aCol) const |
std::pair< EDA_UNITS, EDA_DATA_TYPE > | getColumnUnits (int aCol) const |
Returns the units and data type associated with a given column. | |
Protected Attributes | |
bool | m_weOwnTable |
std::map< int, UNITS_PROVIDER * > | m_unitsProviders |
std::unique_ptr< NUMERIC_EVALUATOR > | m_eval |
std::vector< int > | m_autoEvalCols |
std::unordered_map< int, std::pair< EDA_UNITS, EDA_DATA_TYPE > > | m_autoEvalColsUnits |
std::map< std::pair< int, int >, std::pair< wxString, wxString > > | m_evalBeforeAfter |
std::optional< wxSize > | m_minSizeOverride |
WX_GRID::WX_GRID | ( | wxWindow * | parent, |
wxWindowID | id, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxWANTS_CHARS , |
||
const wxString & | name = wxGridNameStr |
||
) |
Definition at line 205 of file wx_grid.cpp.
References KIUI::GetControlFont(), onCellEditorHidden(), onCellEditorShown(), onDPIChanged(), and SetLabelFont().
|
override |
Definition at line 226 of file wx_grid.cpp.
References DestroyTable(), m_weOwnTable, onCellEditorHidden(), onCellEditorShown(), and onDPIChanged().
bool WX_GRID::CancelPendingChanges | ( | ) |
Definition at line 612 of file wx_grid.cpp.
References editor.
Referenced by JOBS_GRID_TRICKS::handleDoubleClick(), and GRID_TRICKS::onCharHook().
|
inline |
Definition at line 196 of file wx_grid.h.
Referenced by JOBS_GRID_TRICKS::handleDoubleClick().
|
static |
A helper function to set OS-specific margins for text-based cell editors.
Definition at line 77 of file wx_grid.cpp.
Referenced by GRID_CELL_SYMBOL_ID_EDITOR::Create(), GRID_CELL_FPID_EDITOR::Create(), GRID_CELL_URL_EDITOR::Create(), and GRID_CELL_PATH_EDITOR::Create().
|
static |
A helper function to tweak sizes of text-based cell editors depending on OS.
Definition at line 85 of file wx_grid.cpp.
Referenced by GRID_CELL_TEXT_BUTTON::SetSize(), GRID_CELL_TEXT_EDITOR::SetSize(), and GRID_CELL_STC_EDITOR::SetSize().
|
inline |
wxWidgets recently added an ASSERT which fires if the position is greater than or equal to the number of rows (even if the delete count is 0).
Needless to say, this makes using DeleteRows for clearing a lot more cumbersome so we add a helper here.
Definition at line 203 of file wx_grid.h.
Referenced by PANEL_BOM_PRESETS::BuildGrid(), PANEL_TEXT_VARIABLES::checkReload(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_SIM_MODEL< T >::DIALOG_SIM_MODEL(), PANEL_SETUP_BUSES::doReloadMembersGrid(), DIALOG_BOARD_STATISTICS::getDataFromPCB(), PANEL_TEXT_VARIABLES::ImportSettingsFrom(), DIALOG_EDIT_SYMBOLS_LIBID::initDlg(), PANEL_SETUP_BUSES::loadAliases(), PANEL_SETUP_NETCLASSES::loadNetclasses(), PANEL_SETUP_BUSES::OnDeleteAlias(), PANEL_SETUP_NETCLASSES::OnNetclassAssignmentSort(), SIMULATOR_FRAME_UI::onPlotChanging(), PANEL_TEXT_VARIABLES::PANEL_TEXT_VARIABLES(), PANEL_DESIGN_BLOCK_LIB_TABLE::populateEnvironReadOnlyTable(), PANEL_SYM_LIB_TABLE::populateEnvironReadOnlyTable(), DIALOG_EXECUTECOMMAND_JOB_SETTINGS::populateEnvironReadOnlyTable(), PANEL_FP_LIB_TABLE::populateEnvironReadOnlyTable(), SIMULATOR_FRAME_UI::rebuildMeasurementsGrid(), SIMULATOR_FRAME_UI::rebuildSignalsGrid(), FOOTPRINT_WIZARD_FRAME::ReCreateParameterList(), PANEL_FP_PROPERTIES_3D_MODEL::ReloadModelsFromFootprint(), DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataToGrid(), PANEL_TEMPLATE_FIELDNAMES::TransferDataToGrid(), DIALOG_FOOTPRINT_ASSOCIATIONS::TransferDataToWindow(), PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::TransferDataToWindow(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataToWindow(), and SIMULATOR_FRAME_UI::updatePlotCursors().
bool WX_GRID::CommitPendingChanges | ( | bool | aQuietMode = false | ) |
Close any open cell edit controls.
aQuietMode | if true don't send events (ie: for row/col delete operations). |
Definition at line 640 of file wx_grid.cpp.
References editor.
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::appendRowHandler(), PANEL_SYM_LIB_TABLE::appendRowHandler(), PANEL_FP_LIB_TABLE::appendRowHandler(), PANEL_DESIGN_BLOCK_LIB_TABLE::browseLibrariesHandler(), PANEL_FP_LIB_TABLE::browseLibrariesHandler(), PANEL_DESIGN_BLOCK_LIB_TABLE::deleteRowHandler(), PANEL_SYM_LIB_TABLE::deleteRowHandler(), PANEL_FP_LIB_TABLE::deleteRowHandler(), DestroyTable(), GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), PANEL_SETUP_TEXT_AND_GRAPHICS::ImportSettingsFrom(), PANEL_SETUP_TRACKS_AND_VIAS::ImportSettingsFrom(), PANEL_DESIGN_BLOCK_LIB_TABLE::moveDownHandler(), PANEL_SYM_LIB_TABLE::moveDownHandler(), PANEL_FP_LIB_TABLE::moveDownHandler(), PANEL_DESIGN_BLOCK_LIB_TABLE::moveUpHandler(), PANEL_SYM_LIB_TABLE::moveUpHandler(), PANEL_FP_LIB_TABLE::moveUpHandler(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel(), PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DRow(), PANEL_SETUP_BUSES::OnAddAlias(), DIALOG_PIN_PROPERTIES::OnAddAlternate(), PANEL_SETUP_NETCLASSES::OnAddAssignmentClick(), PANEL_TEMPLATE_FIELDNAMES::OnAddButtonClick(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::OnAddDelayProfileClick(), PANEL_SETUP_TRACKS_AND_VIAS::OnAddDiffPairsClick(), DIALOG_CONFIGURE_PATHS::OnAddEnvVar(), DIALOG_FOOTPRINT_PROPERTIES::OnAddField(), DIALOG_DESIGN_BLOCK_PROPERTIES::OnAddField(), DIALOG_LABEL_PROPERTIES::OnAddField(), DIALOG_LIB_SYMBOL_PROPERTIES::OnAddField(), DIALOG_SHEET_PROPERTIES::OnAddField(), DIALOG_SYMBOL_PROPERTIES::OnAddField(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddField(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::onAddGroup(), PANEL_JOBSET::OnAddJobClick(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnAddLayer(), PANEL_DISPLAY_OPTIONS::OnAddLayerItem(), PANEL_SETUP_BUSES::OnAddMember(), PANEL_SETUP_NETCLASSES::OnAddNetclassClick(), DIALOG_LIB_EDIT_PIN_TABLE::OnAddRow(), DIALOG_USER_DEFINED_SIGNALS::onAddSignal(), PANEL_FP_EDITOR_FIELD_DEFAULTS::OnAddTextItem(), PANEL_TEXT_VARIABLES::OnAddTextVar(), PANEL_SETUP_TRACKS_AND_VIAS::OnAddTrackWidthsClick(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::OnAddViaOverrideClick(), PANEL_SETUP_TRACKS_AND_VIAS::OnAddViaSizesClick(), DIALOG_PLUGIN_OPTIONS::onAppendOption(), DIALOG_PLUGIN_OPTIONS::onAppendRow(), TEXT_BUTTON_FILE_BROWSER::OnButtonClick(), GRID_TRICKS::onCharHook(), DIALOG_SYMBOL_FIELDS_TABLE::OnClose(), DIALOG_LIB_EDIT_PIN_TABLE::OnClose(), PANEL_SYM_LIB_TABLE::onConvertLegacyLibraries(), PANEL_SETUP_BUSES::OnDeleteAlias(), DIALOG_PIN_PROPERTIES::OnDeleteAlternate(), PANEL_TEMPLATE_FIELDNAMES::OnDeleteButtonClick(), DIALOG_FOOTPRINT_PROPERTIES::OnDeleteField(), DIALOG_DESIGN_BLOCK_PROPERTIES::OnDeleteField(), DIALOG_LABEL_PROPERTIES::OnDeleteField(), DIALOG_LIB_SYMBOL_PROPERTIES::OnDeleteField(), DIALOG_SHEET_PROPERTIES::OnDeleteField(), DIALOG_SYMBOL_PROPERTIES::OnDeleteField(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnDeleteField(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnDeleteLayer(), PANEL_DISPLAY_OPTIONS::OnDeleteLayerItem(), DIALOG_PLUGIN_OPTIONS::onDeleteRow(), DIALOG_LIB_EDIT_PIN_TABLE::OnDeleteRow(), DIALOG_USER_DEFINED_SIGNALS::onDeleteSignal(), PANEL_FP_EDITOR_FIELD_DEFAULTS::OnDeleteTextItem(), DIALOG_LIB_SYMBOL_PROPERTIES::OnEditSpiceModel(), DIALOG_SYMBOL_PROPERTIES::OnEditSpiceModel(), PANEL_JOBSET::OnGenerateAllDestinationsClick(), onGridColMove(), GRID_TRICKS::onGridLabelLeftClick(), PANEL_JOBSET::OnJobButtonDelete(), PANEL_JOBSET::OnJobButtonDown(), PANEL_JOBSET::OnJobButtonUp(), PANEL_DESIGN_BLOCK_LIB_TABLE::onMigrateLibraries(), PANEL_FP_LIB_TABLE::onMigrateLibraries(), DIALOG_LABEL_PROPERTIES::OnMoveDown(), DIALOG_LIB_SYMBOL_PROPERTIES::OnMoveDown(), DIALOG_SHEET_PROPERTIES::OnMoveDown(), DIALOG_SYMBOL_PROPERTIES::OnMoveDown(), PANEL_TEMPLATE_FIELDNAMES::OnMoveDown(), DIALOG_DESIGN_BLOCK_PROPERTIES::OnMoveFieldDown(), DIALOG_DESIGN_BLOCK_PROPERTIES::OnMoveFieldUp(), PANEL_SETUP_NETCLASSES::OnMoveNetclassDownClick(), PANEL_SETUP_NETCLASSES::OnMoveNetclassUpClick(), DIALOG_LABEL_PROPERTIES::OnMoveUp(), DIALOG_LIB_SYMBOL_PROPERTIES::OnMoveUp(), DIALOG_SHEET_PROPERTIES::OnMoveUp(), DIALOG_SYMBOL_PROPERTIES::OnMoveUp(), PANEL_TEMPLATE_FIELDNAMES::OnMoveUp(), PANEL_SETUP_NETCLASSES::OnNetclassAssignmentSort(), DIALOG_LIB_SYMBOL_PROPERTIES::OnPageChanging(), DIALOG_SYMBOL_PROPERTIES::OnPageChanging(), DIALOG_FOOTPRINT_PROPERTIES::OnPageChanging(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::OnPageChanging(), DIALOG_LIB_EDIT_PIN_TABLE::OnRebuildRows(), PANEL_FP_PROPERTIES_3D_MODEL::OnRemove3DModel(), PANEL_SETUP_NETCLASSES::OnRemoveAssignmentClick(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::OnRemoveDelayProfileClick(), PANEL_SETUP_TRACKS_AND_VIAS::OnRemoveDiffPairsClick(), DIALOG_CONFIGURE_PATHS::OnRemoveEnvVar(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::onRemoveGroup(), PANEL_SETUP_BUSES::OnRemoveMember(), PANEL_SETUP_NETCLASSES::OnRemoveNetclassClick(), PANEL_TEXT_VARIABLES::OnRemoveTextVar(), PANEL_SETUP_TRACKS_AND_VIAS::OnRemoveTrackWidthsClick(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::OnRemoveViaOverrideClick(), PANEL_SETUP_TRACKS_AND_VIAS::OnRemoveViaSizesClick(), PANEL_SYM_LIB_TABLE::onReset(), PANEL_FP_LIB_TABLE::onReset(), PANEL_JOBSET::OnSaveButtonClick(), PANEL_SETUP_NETCLASSES::rebuildNetclassDropdowns(), DIALOG_DESIGN_BLOCK_PROPERTIES::TransferDataFromGrid(), PANEL_TEMPLATE_FIELDNAMES::TransferDataFromGrid(), PANEL_DESIGN_BLOCK_LIB_TABLE::TransferDataFromWindow(), DIALOG_LABEL_PROPERTIES::TransferDataFromWindow(), DIALOG_LIB_EDIT_PIN_TABLE::TransferDataFromWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_PIN_PROPERTIES::TransferDataFromWindow(), DIALOG_SYMBOL_FIELDS_TABLE::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_TABLE_PROPERTIES::TransferDataFromWindow(), DIALOG_USER_DEFINED_SIGNALS::TransferDataFromWindow(), PANEL_SETUP_BUSES::TransferDataFromWindow(), PANEL_SYM_LIB_TABLE::TransferDataFromWindow(), DIALOG_CONFIGURE_PATHS::TransferDataFromWindow(), DIALOG_PLUGIN_OPTIONS::TransferDataFromWindow(), PANEL_TEXT_VARIABLES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow(), DIALOG_SWAP_LAYERS::TransferDataFromWindow(), PANEL_DISPLAY_OPTIONS::TransferDataFromWindow(), PANEL_FP_EDITOR_FIELD_DEFAULTS::TransferDataFromWindow(), PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::TransferDataFromWindow(), PANEL_FP_LIB_TABLE::TransferDataFromWindow(), PANEL_FP_PROPERTIES_3D_MODEL::TransferDataFromWindow(), PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), DIALOG_LIB_SYMBOL_PROPERTIES::Validate(), DIALOG_SHEET_PROPERTIES::Validate(), DIALOG_SYMBOL_PROPERTIES::Validate(), PANEL_SETUP_NETCLASSES::Validate(), DIALOG_FOOTPRINT_PROPERTIES::Validate(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Validate(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::Validate(), PANEL_SETUP_TRACKS_AND_VIAS::Validate(), and DIALOG_EDIT_SYMBOLS_LIBID::validateLibIds().
void WX_GRID::DestroyTable | ( | wxGridTableBase * | aTable | ) |
Work-around for a bug in wxGrid which crashes when deleting the table if the cell edit control was not closed.
Definition at line 446 of file wx_grid.cpp.
References CommitPendingChanges(), onGridCellSelect(), and onGridColMove().
Referenced by PANEL_SYM_LIB_TABLE::onReset(), PANEL_FP_LIB_TABLE::onReset(), DIALOG_FOOTPRINT_PROPERTIES::~DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::~DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_LABEL_PROPERTIES::~DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_EDIT_PIN_TABLE::~DIALOG_LIB_EDIT_PIN_TABLE(), DIALOG_LIB_SYMBOL_PROPERTIES::~DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_PIN_PROPERTIES::~DIALOG_PIN_PROPERTIES(), DIALOG_SHEET_PROPERTIES::~DIALOG_SHEET_PROPERTIES(), DIALOG_SWAP_LAYERS::~DIALOG_SWAP_LAYERS(), DIALOG_SYMBOL_PROPERTIES::~DIALOG_SYMBOL_PROPERTIES(), and ~WX_GRID().
|
inlineoverride |
Definition at line 231 of file wx_grid.h.
References m_minSizeOverride.
Referenced by OverrideMinSize().
|
overrideprotected |
A re-implementation of wxGrid::DrawColLabel which left-aligns the first column and draws flat borders.
Definition at line 541 of file wx_grid.cpp.
References WX_GRID_COLUMN_HEADER_RENDERER::DrawBorder(), and MIN_GRIDCELL_MARGIN.
|
overrideprotected |
A re-implementation of wxGrid::DrawCornerLabel which draws flat borders.
Definition at line 520 of file wx_grid.cpp.
References WX_GRID_CORNER_HEADER_RENDERER::DrawBorder().
|
overrideprotected |
A re-implementation of wxGrid::DrawRowLabel which draws flat borders.
Definition at line 580 of file wx_grid.cpp.
References WX_GRID_ROW_HEADER_RENDERER::DrawBorder(), and MIN_GRIDCELL_MARGIN.
void WX_GRID::EnableAlternateRowColors | ( | bool | aEnable = true | ) |
Enable alternate row highlighting, where every odd row has a different background color than the even rows.
aEnable | flag to specify to enable alternate row striping in the grid. |
Definition at line 308 of file wx_grid.cpp.
Referenced by PANEL_EMBEDDED_FILES::PANEL_EMBEDDED_FILES(), and SetTable().
void WX_GRID::EnsureColLabelsVisible | ( | ) |
Ensure the height of the row displaying the column labels is enough, even if labels are multiline texts.
Definition at line 816 of file wx_grid.cpp.
References SetColLabelSize().
Referenced by DIALOG_BOARD_STATISTICS::adjustDrillGridColumns(), GetVisibleWidth(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(), and PANEL_SETUP_TIME_DOMAIN_PARAMETERS::updateProfileGridColumns().
|
protected |
Returns the units and data type associated with a given column.
Definition at line 844 of file wx_grid.cpp.
References getUnitsProvider(), UNITS_PROVIDER::GetUserUnits(), and m_autoEvalColsUnits.
Referenced by GetOptionalUnitValue(), GetUnitValue(), and onCellEditorHidden().
std::optional< int > WX_GRID::GetOptionalUnitValue | ( | int | aRow, |
int | aCol | ||
) |
Apply standard KiCad unit and eval services to a numeric cell.
aRow | the cell row index to fetch. |
aCol | the cell column index to fetch. |
Definition at line 732 of file wx_grid.cpp.
References alg::contains(), getColumnUnits(), getUnitsProvider(), m_autoEvalCols, m_eval, UNITS_PROVIDER::NullUiString, and UNITS_PROVIDER::OptionalValueFromString().
Referenced by PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), and PANEL_SETUP_NETCLASSES::validateNetclassClearance().
std::bitset< 64 > WX_GRID::GetShownColumns | ( | ) |
Definition at line 479 of file wx_grid.cpp.
Referenced by DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), DIALOG_LABEL_PROPERTIES::OnUpdateUI(), DIALOG_LIB_EDIT_PIN_TABLE::OnUpdateUI(), DIALOG_LIB_SYMBOL_PROPERTIES::OnUpdateUI(), DIALOG_SHEET_PROPERTIES::OnUpdateUI(), DIALOG_SYMBOL_PROPERTIES::OnUpdateUI(), PANEL_SETUP_NETCLASSES::OnUpdateUI(), and PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES().
wxString WX_GRID::GetShownColumnsAsString | ( | ) |
Get a tokenized string containing the shown column indexes.
Tokens are separated by spaces.
Definition at line 460 of file wx_grid.cpp.
Referenced by DIALOG_FOOTPRINT_PROPERTIES::~DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::~DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_LABEL_PROPERTIES::~DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_EDIT_PIN_TABLE::~DIALOG_LIB_EDIT_PIN_TABLE(), DIALOG_LIB_SYMBOL_PROPERTIES::~DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_SHEET_PROPERTIES::~DIALOG_SHEET_PROPERTIES(), DIALOG_SYMBOL_PROPERTIES::~DIALOG_SYMBOL_PROPERTIES(), and PANEL_SETUP_NETCLASSES::~PANEL_SETUP_NETCLASSES().
|
inlineprotected |
Definition at line 263 of file wx_grid.h.
References m_unitsProviders.
Referenced by getColumnUnits(), GetOptionalUnitValue(), GetUnitValue(), onCellEditorHidden(), SetOptionalUnitValue(), and SetUnitValue().
int WX_GRID::GetUnitValue | ( | int | aRow, |
int | aCol | ||
) |
Apply standard KiCad unit and eval services to a numeric cell.
aRow | the cell row index to fetch. |
aCol | the cell column index to fetch. |
aIsOptional | if true, indicates to the unit provider the value is optional. |
Definition at line 714 of file wx_grid.cpp.
References alg::contains(), getColumnUnits(), getUnitsProvider(), m_autoEvalCols, m_eval, and UNITS_PROVIDER::ValueFromString().
Referenced by PANEL_SETUP_TIME_DOMAIN_PARAMETERS::getProfileRow(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::getViaRow(), PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::TransferDataFromWindow(), PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow(), and PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow().
int WX_GRID::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.
aCol | is the index of the column to resize. Specify -1 for the row labels. |
aHeader | is the header in the width calculation. |
aContents | is the full contents of the column. |
aKeep | is the current size as a minimum value. |
Definition at line 776 of file wx_grid.cpp.
References EnsureColLabelsVisible().
Referenced by DIALOG_FOOTPRINT_PROPERTIES::adjustGridColumns(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::adjustGridColumns(), PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::loadFPSettings(), PANEL_PACKAGES_VIEW::PANEL_PACKAGES_VIEW(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS(), PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS(), PANEL_FP_PROPERTIES_3D_MODEL::ReloadModelsFromFootprint(), DIALOG_MANAGE_REPOSITORIES::setColumnWidths(), DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow(), PANEL_PCBNEW_ACTION_PLUGINS::TransferDataToWindow(), PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataToWindow(), and DIALOG_PCM::updatePendingActionsTab().
|
protected |
Definition at line 369 of file wx_grid.cpp.
References alg::contains(), getColumnUnits(), getUnitsProvider(), m_autoEvalCols, m_eval, m_evalBeforeAfter, UNITS_PROVIDER::NullUiString, UNITS_PROVIDER::OptionalValueFromString(), UNITS_PROVIDER::StringFromOptionalValue(), UNITS_PROVIDER::StringFromValue(), and UNITS_PROVIDER::ValueFromString().
Referenced by WX_GRID(), and ~WX_GRID().
|
protected |
Definition at line 354 of file wx_grid.cpp.
References alg::contains(), m_autoEvalCols, and m_evalBeforeAfter.
Referenced by WX_GRID(), and ~WX_GRID().
|
protected |
This terrible hack is a way to avoid the incredibly disruptive resizing of grids that happens on Macs when moving a window between monitors of different DPIs.
Definition at line 237 of file wx_grid.cpp.
Referenced by WX_GRID(), and ~WX_GRID().
|
protected |
Definition at line 327 of file wx_grid.cpp.
Referenced by DestroyTable(), and SetTable().
|
protected |
Definition at line 769 of file wx_grid.cpp.
References CommitPendingChanges().
Referenced by DestroyTable(), and SetTable().
|
inline |
Grids that have column sizes automatically set to fill the available width don't want to shrink afterwards (because wxGrid reports the aggregate column size as the bestSize.
aSize |
Definition at line 225 of file wx_grid.h.
References DoGetBestSize(), KiROUND(), and m_minSizeOverride.
Referenced by PANEL_JOBSET::PANEL_JOBSET(), and PANEL_SETUP_BUSES::PANEL_SETUP_BUSES().
|
inline |
Definition at line 128 of file wx_grid.h.
References m_autoEvalCols.
Referenced by PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::PANEL_FP_EDITOR_GRAPHICS_DEFAULTS(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(), PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS(), and PANEL_SETUP_TIME_DOMAIN_PARAMETERS::updateProfileGridColumns().
void WX_GRID::SetAutoEvalColUnits | ( | int | col, |
EDA_UNITS | aUnit | ||
) |
Set the unit to use for a given column.
The unit data type is inferred from the unit type
Definition at line 707 of file wx_grid.cpp.
References UNITS_PROVIDER::GetTypeFromUnits(), and SetAutoEvalColUnits().
void WX_GRID::SetAutoEvalColUnits | ( | int | col, |
EDA_UNITS | aUnit, | ||
EDA_DATA_TYPE | aUnitType | ||
) |
Set the unit and unit data type to use for a given column.
Definition at line 701 of file wx_grid.cpp.
References m_autoEvalColsUnits.
Referenced by PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(), SetAutoEvalColUnits(), and PANEL_SETUP_TIME_DOMAIN_PARAMETERS::updateProfileGridColumns().
void WX_GRID::SetColLabelSize | ( | int | aHeight | ) |
Hide wxGrid's SetColLabelSize() method with one which makes sure the size is tall enough for the system GUI font.
height |
Definition at line 252 of file wx_grid.cpp.
References MIN_GRIDCELL_MARGIN.
Referenced by APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), APPEARANCE_CONTROLS_BASE::APPEARANCE_CONTROLS_BASE(), DIALOG_BOARD_STATISTICS_BASE::DIALOG_BOARD_STATISTICS_BASE(), DIALOG_CONFIG_EQUFILES_BASE::DIALOG_CONFIG_EQUFILES_BASE(), DIALOG_CONFIGURE_PATHS_BASE::DIALOG_CONFIGURE_PATHS_BASE(), DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE::DIALOG_COPPER_LAYER_PAIR_SELECTION_BASE(), DIALOG_DESIGN_BLOCK_PROPERTIES_BASE::DIALOG_DESIGN_BLOCK_PROPERTIES_BASE(), DIALOG_EDIT_SYMBOLS_LIBID_BASE::DIALOG_EDIT_SYMBOLS_LIBID_BASE(), DIALOG_EXECUTECOMMAND_JOB_SETTINGS_BASE::DIALOG_EXECUTECOMMAND_JOB_SETTINGS_BASE(), DIALOG_FOOTPRINT_ASSOCIATIONS_BASE::DIALOG_FOOTPRINT_ASSOCIATIONS_BASE(), DIALOG_FOOTPRINT_PROPERTIES_BASE::DIALOG_FOOTPRINT_PROPERTIES_BASE(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_BASE(), DIALOG_LABEL_PROPERTIES_BASE::DIALOG_LABEL_PROPERTIES_BASE(), DIALOG_LIB_EDIT_PIN_TABLE_BASE::DIALOG_LIB_EDIT_PIN_TABLE_BASE(), DIALOG_LIB_SYMBOL_PROPERTIES_BASE::DIALOG_LIB_SYMBOL_PROPERTIES_BASE(), DIALOG_MANAGE_REPOSITORIES_BASE::DIALOG_MANAGE_REPOSITORIES_BASE(), DIALOG_PCM_BASE::DIALOG_PCM_BASE(), DIALOG_PIN_PROPERTIES_BASE::DIALOG_PIN_PROPERTIES_BASE(), DIALOG_PLUGIN_OPTIONS_BASE::DIALOG_PLUGIN_OPTIONS_BASE(), DIALOG_SHEET_PROPERTIES_BASE::DIALOG_SHEET_PROPERTIES_BASE(), DIALOG_SIM_MODEL_BASE::DIALOG_SIM_MODEL_BASE(), DIALOG_SWAP_LAYERS_BASE::DIALOG_SWAP_LAYERS_BASE(), DIALOG_SYMBOL_FIELDS_TABLE_BASE::DIALOG_SYMBOL_FIELDS_TABLE_BASE(), DIALOG_SYMBOL_PROPERTIES_BASE::DIALOG_SYMBOL_PROPERTIES_BASE(), DIALOG_TABLE_PROPERTIES::DIALOG_TABLE_PROPERTIES(), DIALOG_USER_DEFINED_SIGNALS_BASE::DIALOG_USER_DEFINED_SIGNALS_BASE(), EnsureColLabelsVisible(), FOOTPRINT_WIZARD_FRAME::initParameterGrid(), PANEL_BOM_PRESETS_BASE::PANEL_BOM_PRESETS_BASE(), PANEL_DESIGN_BLOCK_LIB_TABLE_BASE::PANEL_DESIGN_BLOCK_LIB_TABLE_BASE(), PANEL_DISPLAY_OPTIONS_BASE::PANEL_DISPLAY_OPTIONS_BASE(), PANEL_EMBEDDED_FILES_BASE::PANEL_EMBEDDED_FILES_BASE(), PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE::PANEL_FP_EDITOR_FIELD_DEFAULTS_BASE(), PANEL_FP_EDITOR_GRAPHICS_DEFAULTS_BASE::PANEL_FP_EDITOR_GRAPHICS_DEFAULTS_BASE(), PANEL_FP_LIB_TABLE_BASE::PANEL_FP_LIB_TABLE_BASE(), PANEL_FP_PROPERTIES_3D_MODEL_BASE::PANEL_FP_PROPERTIES_3D_MODEL_BASE(), PANEL_JOBSET_BASE::PANEL_JOBSET_BASE(), PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE(), PANEL_PCBNEW_ACTION_PLUGINS_BASE::PANEL_PCBNEW_ACTION_PLUGINS_BASE(), PANEL_SETUP_BUSES_BASE::PANEL_SETUP_BUSES_BASE(), PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE(), PANEL_SETUP_TEXT_AND_GRAPHICS_BASE::PANEL_SETUP_TEXT_AND_GRAPHICS_BASE(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS_BASE::PANEL_SETUP_TIME_DOMAIN_PARAMETERS_BASE(), PANEL_SETUP_TRACKS_AND_VIAS_BASE::PANEL_SETUP_TRACKS_AND_VIAS_BASE(), PANEL_SYM_LIB_TABLE_BASE::PANEL_SYM_LIB_TABLE_BASE(), PANEL_TEMPLATE_FIELDNAMES_BASE::PANEL_TEMPLATE_FIELDNAMES_BASE(), PANEL_TEXT_VARIABLES_BASE::PANEL_TEXT_VARIABLES_BASE(), and SIMULATOR_FRAME_UI_BASE::SIMULATOR_FRAME_UI_BASE().
void WX_GRID::SetLabelFont | ( | const wxFont & | aFont | ) |
Hide wxGrid's SetLabelFont() because for some reason on MSW it's a one-shot and subsequent calls to it have no effect.
Definition at line 267 of file wx_grid.cpp.
References KIUI::GetControlFont().
Referenced by WX_GRID().
void WX_GRID::SetOptionalUnitValue | ( | int | aRow, |
int | aCol, | ||
std::optional< int > | aValue | ||
) |
Set a unitized cell's optional value.
Definition at line 763 of file wx_grid.cpp.
References getUnitsProvider().
Referenced by PANEL_SETUP_NETCLASSES::loadNetclasses().
void WX_GRID::SetTable | ( | wxGridTableBase * | table, |
bool | aTakeOwnership = false |
||
) |
Hide wxGrid's SetTable() method with one which doesn't mess up the grid column widths when setting the table.
Definition at line 273 of file wx_grid.cpp.
References EnableAlternateRowColors(), m_weOwnTable, MIN_GRIDCELL_MARGIN, onGridCellSelect(), onGridColMove(), and Pgm().
Referenced by APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SWAP_LAYERS::DIALOG_SWAP_LAYERS(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), PANEL_SYM_LIB_TABLE::onReset(), PANEL_FP_LIB_TABLE::onReset(), PANEL_DESIGN_BLOCK_LIB_TABLE::PANEL_DESIGN_BLOCK_LIB_TABLE(), PANEL_DISPLAY_OPTIONS::PANEL_DISPLAY_OPTIONS(), PANEL_FP_EDITOR_FIELD_DEFAULTS::PANEL_FP_EDITOR_FIELD_DEFAULTS(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), and PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE().
void WX_GRID::SetUnitsProvider | ( | UNITS_PROVIDER * | aProvider, |
int | aCol = 0 |
||
) |
Set a EUNITS_PROVIDER to enable use of unit- and eval-based Getters.
aProvider |
Definition at line 692 of file wx_grid.cpp.
References UNITS_PROVIDER::GetUserUnits(), m_eval, and m_unitsProviders.
Referenced by PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::PANEL_FP_EDITOR_GRAPHICS_DEFAULTS(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_TEXT_AND_GRAPHICS::PANEL_SETUP_TEXT_AND_GRAPHICS(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::PANEL_SETUP_TIME_DOMAIN_PARAMETERS(), and PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS().
void WX_GRID::SetUnitValue | ( | int | aRow, |
int | aCol, | ||
int | aValue | ||
) |
Set a unitized cell's value.
Definition at line 750 of file wx_grid.cpp.
References getUnitsProvider(), and m_autoEvalColsUnits.
Referenced by PANEL_SETUP_TIME_DOMAIN_PARAMETERS::addProfileRow(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::addViaRow(), PANEL_SETUP_TRACKS_AND_VIAS::AppendDiffPairs(), PANEL_SETUP_TRACKS_AND_VIAS::AppendTrackWidth(), PANEL_SETUP_TRACKS_AND_VIAS::AppendViaSize(), PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::loadFPSettings(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::OnAddDelayProfileClick(), PANEL_SETUP_TIME_DOMAIN_PARAMETERS::OnAddViaOverrideClick(), PANEL_FP_EDITOR_GRAPHICS_DEFAULTS::TransferDataFromWindow(), and PANEL_SETUP_NETCLASSES::validateNetclassClearance().
|
inline |
WxWidgets has a bunch of bugs in its handling of wxGrid mouse events which close cell editors right after opening them.
Helpfully, it already has a bunch of work-arounds in place (such as the SetInSetFocus() hack), including one to make slow clicks work. We re-purpose this hack to work-around the bugs when we want to open an editor.
Definition at line 195 of file wx_grid.h.
Referenced by GRID_TRICKS::showEditor().
void WX_GRID::ShowHideColumns | ( | const std::bitset< 64 > & | aShownColumns | ) |
A more performant version of ShowHideColumns (primarily for OnUpdateUI handlers).
Definition at line 508 of file wx_grid.cpp.
void WX_GRID::ShowHideColumns | ( | const wxString & | shownColumns | ) |
Show/hide the grid columns based on a tokenized string of shown column indexes.
Definition at line 490 of file wx_grid.cpp.
Referenced by DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), and PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES().
|
protected |
Definition at line 281 of file wx_grid.h.
Referenced by GetOptionalUnitValue(), GetUnitValue(), onCellEditorHidden(), onCellEditorShown(), and SetAutoEvalCols().
|
protected |
Definition at line 282 of file wx_grid.h.
Referenced by getColumnUnits(), SetAutoEvalColUnits(), and SetUnitValue().
|
protected |
Definition at line 280 of file wx_grid.h.
Referenced by GetOptionalUnitValue(), GetUnitValue(), onCellEditorHidden(), and SetUnitsProvider().
|
protected |
Definition at line 284 of file wx_grid.h.
Referenced by onCellEditorHidden(), and onCellEditorShown().
|
protected |
Definition at line 286 of file wx_grid.h.
Referenced by DoGetBestSize(), and OverrideMinSize().
|
protected |
Definition at line 279 of file wx_grid.h.
Referenced by getUnitsProvider(), and SetUnitsProvider().
|
protected |
Definition at line 277 of file wx_grid.h.
Referenced by SetTable(), and ~WX_GRID().