|
KiCad PCB EDA Suite
|
#include <lib_table_grid_tricks.h>
Public Member Functions | |
| LIB_TABLE_GRID_TRICKS (WX_GRID *aGrid) | |
| LIB_TABLE_GRID_TRICKS (WX_GRID *aGrid, std::function< void(wxCommandEvent &)> aAddHandler) | |
| virtual | ~LIB_TABLE_GRID_TRICKS () |
| void | showPopupMenu (wxMenu &menu, wxGridEvent &aEvent) override |
| void | doPopupSelection (wxCommandEvent &event) override |
| void | SetTooltipEnable (int aCol, bool aEnable=true) |
| Enable the tooltip for a column. | |
| bool | GetTooltipEnabled (int aCol) |
| Query if the tooltip for a column is enabled. | |
Static Public Member Functions | |
| static void | AppendRowHandler (WX_GRID *aGrid) |
| static void | DeleteRowHandler (WX_GRID *aGrid) |
| static void | MoveUpHandler (WX_GRID *aGrid) |
| static void | MoveDownHandler (WX_GRID *aGrid) |
| static bool | VerifyTable (WX_GRID *aGrid, std::function< void(int aRow, int aCol)> aErrorHandler) |
Protected Member Functions | |
| virtual void | optionsEditor (int aRow)=0 |
| virtual void | openTable (const LIBRARY_TABLE_ROW &aRow)=0 |
| void | onGridCellLeftClick (wxGridEvent &aEvent) override |
| bool | handleDoubleClick (wxGridEvent &aEvent) override |
| void | onCharHook (wxKeyEvent &ev) |
| void | paste_text (const wxString &cb_text) override |
| virtual bool | supportsVisibilityColumn () |
| virtual wxString | getTablePreamble ()=0 |
| void | init () |
| Shared initialization for various ctors. | |
| void | getSelectedArea () |
| Puts the selected area into a sensible rectangle of m_sel_{row,col}_{start,count} above. | |
| void | onGridCellLeftDClick (wxGridEvent &event) |
| void | onGridCellRightClick (wxGridEvent &event) |
| void | onGridLabelLeftClick (wxGridEvent &event) |
| void | onGridLabelRightClick (wxGridEvent &event) |
| void | onPopupSelection (wxCommandEvent &event) |
| void | onKeyDown (wxKeyEvent &event) |
| void | onUpdateUI (wxUpdateUIEvent &event) |
| void | onGridMotion (wxMouseEvent &event) |
| bool | isTextEntry (int aRow, int aCol) |
| bool | isCheckbox (int aRow, int aCol) |
| bool | isReadOnly (int aRow, int aCol) |
| virtual bool | toggleCell (int aRow, int aCol, bool aPreserveSelection=false) |
| bool | showEditor (int aRow, int aCol) |
| virtual void | paste_clipboard () |
| virtual void | cutcopy (bool doCopy, bool doDelete) |
Protected Attributes | |
| WX_GRID * | m_grid |
| I don't own the grid, but he owns me. | |
| int | m_sel_row_start |
| int | m_sel_col_start |
| int | m_sel_row_count |
| int | m_sel_col_count |
| std::function< void(wxCommandEvent &)> | m_addHandler |
| std::bitset< GRIDTRICKS_MAX_COL > | m_tooltipEnabled |
| bool | m_enableSingleClickEdit |
| bool | m_multiCellEditEnabled |
Private Types | |
| enum | { LIB_TABLE_GRID_TRICKS_ACTIVATE_SELECTED = GRIDTRICKS_FIRST_CLIENT_ID , LIB_TABLE_GRID_TRICKS_DEACTIVATE_SELECTED , LIB_TABLE_GRID_TRICKS_SET_VISIBLE , LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE , LIB_TABLE_GRID_TRICKS_LIBRARY_SETTINGS , LIB_TABLE_GRID_TRICKS_OPEN_TABLE , LIB_TABLE_GRID_TRICKS_OPTIONS_EDITOR } |
Definition at line 27 of file lib_table_grid_tricks.h.
|
private |
Definition at line 29 of file lib_table_grid_tricks.h.
|
explicit |
Definition at line 30 of file lib_table_grid_tricks.cpp.
References GRID_TRICKS::GRID_TRICKS(), GRID_TRICKS::m_grid, and onCharHook().
Referenced by DESIGN_BLOCK_GRID_TRICKS::DESIGN_BLOCK_GRID_TRICKS(), FP_GRID_TRICKS::FP_GRID_TRICKS(), and SYMBOL_GRID_TRICKS::SYMBOL_GRID_TRICKS().
| LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS | ( | WX_GRID * | aGrid, |
| std::function< void(wxCommandEvent &)> | aAddHandler ) |
Definition at line 38 of file lib_table_grid_tricks.cpp.
References GRID_TRICKS::GRID_TRICKS(), GRID_TRICKS::m_grid, and onCharHook().
|
inlinevirtual |
Definition at line 44 of file lib_table_grid_tricks.h.
|
static |
Definition at line 340 of file lib_table_grid_tricks.cpp.
References COL_NICKNAME, and WX_GRID::OnAddRow().
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::appendRowHandler(), PANEL_FP_LIB_TABLE::appendRowHandler(), and PANEL_SYM_LIB_TABLE::appendRowHandler().
|
protectedvirtualinherited |
Definition at line 846 of file grid_tricks.cpp.
References COL_SEP, isReadOnly(), isTextEntry(), m_grid, m_sel_col_count, m_sel_col_start, m_sel_row_count, m_sel_row_start, and ROW_SEP.
Referenced by doPopupSelection(), onKeyDown(), and SCINTILLA_TRICKS.
|
static |
Definition at line 351 of file lib_table_grid_tricks.cpp.
References WX_GRID::CommitPendingChanges().
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::deleteRowHandler(), PANEL_FP_LIB_TABLE::deleteRowHandler(), and PANEL_SYM_LIB_TABLE::deleteRowHandler().
|
overridevirtual |
Reimplemented from GRID_TRICKS.
Definition at line 167 of file lib_table_grid_tricks.cpp.
References LIB_TABLE_GRID_DATA_MODEL::At(), GRID_TRICKS::doPopupSelection(), LIB_TABLE_GRID_TRICKS_ACTIVATE_SELECTED, LIB_TABLE_GRID_TRICKS_DEACTIVATE_SELECTED, LIB_TABLE_GRID_TRICKS_LIBRARY_SETTINGS, LIB_TABLE_GRID_TRICKS_OPEN_TABLE, LIB_TABLE_GRID_TRICKS_OPTIONS_EDITOR, LIB_TABLE_GRID_TRICKS_SET_VISIBLE, LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE, GRID_TRICKS::m_grid, GRID_TRICKS::m_sel_row_count, GRID_TRICKS::m_sel_row_start, openTable(), optionsEditor(), and LIB_TABLE_GRID_DATA_MODEL::SetValueAsBool().
|
protectedinherited |
Puts the selected area into a sensible rectangle of m_sel_{row,col}_{start,count} above.
Definition at line 288 of file grid_tricks.cpp.
References m_grid, m_sel_col_count, m_sel_col_start, m_sel_row_count, and m_sel_row_start.
Referenced by LIB_TABLE_GRID_TRICKS::onCharHook(), onGridCellLeftClick(), onKeyDown(), LIB_TABLE_GRID_TRICKS::paste_text(), showPopupMenu(), and LIB_TABLE_GRID_TRICKS::showPopupMenu().
|
protectedpure virtual |
Implemented in DESIGN_BLOCK_GRID_TRICKS, FP_GRID_TRICKS, and SYMBOL_GRID_TRICKS.
Referenced by paste_text().
|
inlineinherited |
Query if the tooltip for a column is enabled.
| aCol | is the column to query |
Definition at line 86 of file grid_tricks.h.
References m_tooltipEnabled.
|
overrideprotectedvirtual |
Reimplemented from GRID_TRICKS.
Definition at line 328 of file lib_table_grid_tricks.cpp.
References COL_OPTIONS, and optionsEditor().
|
protectedinherited |
Shared initialization for various ctors.
Definition at line 62 of file grid_tricks.cpp.
References GRIDTRICKS_FIRST_ID, GRIDTRICKS_LAST_ID, m_grid, m_sel_col_count, m_sel_col_start, m_sel_row_count, m_sel_row_start, onCharHook(), onGridCellLeftClick(), onGridCellLeftDClick(), onGridCellRightClick(), onGridLabelLeftClick(), onGridLabelRightClick(), onGridMotion(), onKeyDown(), onPopupSelection(), and onUpdateUI().
Referenced by GRID_TRICKS(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 106 of file grid_tricks.cpp.
References m_grid.
Referenced by SCINTILLA_TRICKS, and toggleCell().
|
protectedinherited |
Definition at line 116 of file grid_tricks.cpp.
References m_grid.
Referenced by cutcopy(), paste_text(), SCINTILLA_TRICKS, showEditor(), and showPopupMenu().
|
protectedinherited |
Definition at line 95 of file grid_tricks.cpp.
References editor, and m_grid.
Referenced by cutcopy(), SCINTILLA_TRICKS, and showPopupMenu().
|
static |
Definition at line 439 of file lib_table_grid_tricks.cpp.
References next(), WX_GRID::OnMoveRowDown(), LIBRARY_TABLE::Rows(), and LIB_TABLE_GRID_DATA_MODEL::Table().
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::moveDownHandler(), PANEL_FP_LIB_TABLE::moveDownHandler(), and PANEL_SYM_LIB_TABLE::moveDownHandler().
|
static |
Definition at line 417 of file lib_table_grid_tricks.cpp.
References WX_GRID::OnMoveRowUp(), LIBRARY_TABLE::Rows(), and LIB_TABLE_GRID_DATA_MODEL::Table().
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::moveUpHandler(), PANEL_FP_LIB_TABLE::moveUpHandler(), and PANEL_SYM_LIB_TABLE::moveUpHandler().
|
protected |
Definition at line 218 of file lib_table_grid_tricks.cpp.
References COL_NICKNAME, GRID_TRICKS::getSelectedArea(), GRID_TRICKS::m_grid, GRID_TRICKS::onCharHook(), paste_text(), table, and text.
Referenced by LIB_TABLE_GRID_TRICKS(), and LIB_TABLE_GRID_TRICKS().
|
overrideprotectedvirtual |
Reimplemented from GRID_TRICKS.
Definition at line 47 of file lib_table_grid_tricks.cpp.
References _, COL_STATUS, DisplayErrorMessage(), LIBRARY_TABLE_ROW::ErrorDescription(), LIBRARY_TABLE_ROW::IsOk(), LIBRARY_MANAGER_ADAPTER::LibraryError(), GRID_TRICKS::m_grid, LIBRARY_TABLE_ROW::Nickname(), GRID_TRICKS::onGridCellLeftClick(), openTable(), LIBRARY_MANAGER_ADAPTER::ShowConfigurationDialog(), LIBRARY_MANAGER_ADAPTER::SupportsConfigurationDialog(), table, LIBRARY_TABLE_ROW::TABLE_TYPE_NAME, and LIBRARY_TABLE_ROW::Type().
|
protectedinherited |
Definition at line 251 of file grid_tricks.cpp.
References handleDoubleClick(), and onGridCellLeftClick().
Referenced by init(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 328 of file grid_tricks.cpp.
References showPopupMenu().
Referenced by init(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 336 of file grid_tricks.cpp.
References m_grid.
Referenced by init(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 344 of file grid_tricks.cpp.
References GRIDTRICKS_FIRST_SHOWHIDE, and m_grid.
Referenced by init(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 258 of file grid_tricks.cpp.
References m_grid, and m_tooltipEnabled.
Referenced by init(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 540 of file grid_tricks.cpp.
References cutcopy(), end, getSelectedArea(), m_grid, paste_clipboard(), and toggleCell().
Referenced by init(), SCINTILLA_TRICKS::onCharHook(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 424 of file grid_tricks.cpp.
References doPopupSelection().
Referenced by init(), and SCINTILLA_TRICKS.
|
protectedinherited |
Definition at line 894 of file grid_tricks.cpp.
References m_grid.
Referenced by init(), and SCINTILLA_TRICKS.
|
protectedpure virtual |
Implemented in DESIGN_BLOCK_GRID_TRICKS, FP_GRID_TRICKS, and SYMBOL_GRID_TRICKS.
Referenced by doPopupSelection(), and onGridCellLeftClick().
|
protectedpure virtual |
Implemented in DESIGN_BLOCK_GRID_TRICKS, FP_GRID_TRICKS, and SYMBOL_GRID_TRICKS.
Referenced by doPopupSelection(), and handleDoubleClick().
|
protectedvirtualinherited |
Definition at line 698 of file grid_tricks.cpp.
References m_grid, paste_text(), and text.
Referenced by doPopupSelection(), onKeyDown(), and SCINTILLA_TRICKS.
|
overrideprotectedvirtual |
Reimplemented from GRID_TRICKS.
Definition at line 279 of file lib_table_grid_tricks.cpp.
References DisplayError(), GRID_TRICKS::getSelectedArea(), getTablePreamble(), LIBRARY_TABLE::IsOk(), GRID_TRICKS::m_grid, GRID_TRICKS::paste_text(), LIBRARY_TABLE::Rows(), LIBRARY_TABLE::Scope(), LIB_TABLE_GRID_DATA_MODEL::Table(), and text.
Referenced by onCharHook().
|
inlineinherited |
Enable the tooltip for a column.
The tooltip is read from the string contained in the cell data.
| aCol | is the column to use |
| aEnable | is true to enable the tooltip (default) |
Definition at line 75 of file grid_tricks.h.
References m_tooltipEnabled.
Referenced by DESIGN_BLOCK_GRID_TRICKS::DESIGN_BLOCK_GRID_TRICKS(), FP_GRID_TRICKS::FP_GRID_TRICKS(), PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(), and SYMBOL_GRID_TRICKS::SYMBOL_GRID_TRICKS().
|
protectedinherited |
Definition at line 162 of file grid_tricks.cpp.
References isReadOnly(), m_grid, m_sel_col_count, m_sel_col_start, m_sel_row_count, and m_sel_row_start.
Referenced by onGridCellLeftClick(), and SCINTILLA_TRICKS.
|
overridevirtual |
Reimplemented from GRID_TRICKS.
Definition at line 90 of file lib_table_grid_tricks.cpp.
References _, LIB_TABLE_GRID_DATA_MODEL::Adapter(), COL_NICKNAME, GRID_TRICKS::getSelectedArea(), LIB_TABLE_GRID_DATA_MODEL::GetValue(), LIB_TABLE_GRID_DATA_MODEL::GetValueAsBool(), LIB_TABLE_GRID_TRICKS_ACTIVATE_SELECTED, LIB_TABLE_GRID_TRICKS_DEACTIVATE_SELECTED, LIB_TABLE_GRID_TRICKS_LIBRARY_SETTINGS, LIB_TABLE_GRID_TRICKS_OPEN_TABLE, LIB_TABLE_GRID_TRICKS_OPTIONS_EDITOR, LIB_TABLE_GRID_TRICKS_SET_VISIBLE, LIB_TABLE_GRID_TRICKS_UNSET_VISIBLE, GRID_TRICKS::m_grid, GRID_TRICKS::m_sel_row_count, GRID_TRICKS::m_sel_row_start, GRID_TRICKS::showPopupMenu(), supportsVisibilityColumn(), and LIBRARY_TABLE_ROW::TABLE_TYPE_NAME.
|
inlineprotectedvirtual |
Reimplemented in SYMBOL_GRID_TRICKS.
Definition at line 72 of file lib_table_grid_tricks.h.
Referenced by showPopupMenu().
|
protectedvirtualinherited |
Definition at line 122 of file grid_tricks.cpp.
References isCheckbox(), and m_grid.
Referenced by onGridCellLeftClick(), onKeyDown(), and SCINTILLA_TRICKS.
|
static |
Definition at line 460 of file lib_table_grid_tricks.cpp.
References _, COL_NICKNAME, COL_URI, COL_VISIBLE, LIB_TABLE_GRID_DATA_MODEL::DeleteRows(), LIB_ID::FindIllegalLibraryNameChar(), LIB_TABLE_GRID_DATA_MODEL::GetNumberRows(), LIB_TABLE_GRID_DATA_MODEL::GetValue(), and LIB_TABLE_GRID_DATA_MODEL::SetValue().
Referenced by PANEL_DESIGN_BLOCK_LIB_TABLE::verifyTables(), PANEL_FP_LIB_TABLE::verifyTables(), and PANEL_SYM_LIB_TABLE::verifyTables().
|
protectedinherited |
Definition at line 137 of file grid_tricks.h.
Referenced by GRID_TRICKS(), GRID_TRICKS(), onCharHook(), and paste_text().
|
protectedinherited |
Definition at line 141 of file grid_tricks.h.
Referenced by GRID_TRICKS(), JOBS_GRID_TRICKS::JOBS_GRID_TRICKS(), and onGridCellLeftClick().
|
protectedinherited |
I don't own the grid, but he owns me.
Definition at line 128 of file grid_tricks.h.
Referenced by cutcopy(), CURSORS_GRID_TRICKS::doPopupSelection(), EMBEDDED_FILES_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), FIELDS_GRID_TRICKS::doPopupSelection(), doPopupSelection(), JOBS_GRID_TRICKS::doPopupSelection(), LIB_FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), LIB_TABLE_GRID_TRICKS::doPopupSelection(), MEASUREMENTS_GRID_TRICKS::doPopupSelection(), PLUGINS_GRID_TRICKS::doPopupSelection(), SIGNALS_GRID_TRICKS::doPopupSelection(), VIEW_CONTROLS_GRID_TRICKS::doPopupSelection(), FIELDS_GRID_TRICKS::getFieldRow(), getSelectedArea(), GRID_TRICKS(), GRID_TRICKS(), JOBS_GRID_TRICKS::handleDoubleClick(), init(), isCheckbox(), isReadOnly(), isTextEntry(), LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS(), LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS(), onCharHook(), LIB_TABLE_GRID_TRICKS::onCharHook(), onGridCellLeftClick(), LIB_TABLE_GRID_TRICKS::onGridCellLeftClick(), onGridLabelLeftClick(), onGridLabelRightClick(), onGridMotion(), onKeyDown(), onUpdateUI(), DESIGN_BLOCK_GRID_TRICKS::optionsEditor(), FP_GRID_TRICKS::optionsEditor(), SYMBOL_GRID_TRICKS::optionsEditor(), paste_clipboard(), paste_text(), LIB_TABLE_GRID_TRICKS::paste_text(), showEditor(), CURSORS_GRID_TRICKS::showPopupMenu(), FIELDS_EDITOR_GRID_TRICKS::showPopupMenu(), FIELDS_GRID_TRICKS::showPopupMenu(), showPopupMenu(), JOBS_GRID_TRICKS::showPopupMenu(), LIB_FIELDS_EDITOR_GRID_TRICKS::showPopupMenu(), LIB_TABLE_GRID_TRICKS::showPopupMenu(), MEASUREMENTS_GRID_TRICKS::showPopupMenu(), PLUGINS_GRID_TRICKS::showPopupMenu(), SIGNALS_GRID_TRICKS::showPopupMenu(), and toggleCell().
|
protectedinherited |
Definition at line 142 of file grid_tricks.h.
Referenced by GRID_TRICKS(), JOBS_GRID_TRICKS::JOBS_GRID_TRICKS(), paste_text(), and showPopupMenu().
|
protectedinherited |
Definition at line 135 of file grid_tricks.h.
Referenced by cutcopy(), getSelectedArea(), init(), paste_text(), showEditor(), and showPopupMenu().
|
protectedinherited |
Definition at line 133 of file grid_tricks.h.
Referenced by cutcopy(), getSelectedArea(), init(), paste_text(), showEditor(), and showPopupMenu().
|
protectedinherited |
Definition at line 134 of file grid_tricks.h.
Referenced by cutcopy(), LIB_TABLE_GRID_TRICKS::doPopupSelection(), getSelectedArea(), init(), onGridCellLeftClick(), paste_text(), showEditor(), showPopupMenu(), and LIB_TABLE_GRID_TRICKS::showPopupMenu().
|
protectedinherited |
Definition at line 132 of file grid_tricks.h.
Referenced by cutcopy(), LIB_TABLE_GRID_TRICKS::doPopupSelection(), getSelectedArea(), init(), onGridCellLeftClick(), paste_text(), showEditor(), showPopupMenu(), and LIB_TABLE_GRID_TRICKS::showPopupMenu().
|
protectedinherited |
Definition at line 139 of file grid_tricks.h.
Referenced by GetTooltipEnabled(), onGridMotion(), and SetTooltipEnable().