KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PLUGINS_GRID_TRICKS Class Reference
Inheritance diagram for PLUGINS_GRID_TRICKS:
GRID_TRICKS

Public Member Functions

 PLUGINS_GRID_TRICKS (WX_GRID *aGrid)
 
void EnableColumnBulkEdit (bool aEnable=true)
 Apply an edit to every selected cell in the edited cell's column.
 
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.
 

Protected Member Functions

void showPopupMenu (wxMenu &menu, wxGridEvent &aEvent) override
 
void doPopupSelection (wxCommandEvent &event) override
 
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.
 
virtual void onGridCellLeftClick (wxGridEvent &event)
 
void onGridCellLeftDClick (wxGridEvent &event)
 
void onGridCellRightClick (wxGridEvent &event)
 
void onGridLabelLeftClick (wxGridEvent &event)
 
void onGridLabelRightClick (wxGridEvent &event)
 
void onPopupSelection (wxCommandEvent &event)
 
void onKeyDown (wxKeyEvent &event)
 
virtual void onCharHook (wxKeyEvent &event)
 
void onUpdateUI (wxUpdateUIEvent &event)
 
void onGridMotion (wxMouseEvent &event)
 
void onGridCellChanging (wxGridEvent &aEvent)
 
void onGridCellChanged (wxGridEvent &aEvent)
 
void onGridEditorCreated (wxGridEditorCreatedEvent &aEvent)
 
void onGridEditorShown (wxGridEvent &aEvent)
 
void onGridEditorHidden (wxGridEvent &aEvent)
 
void onEditorInput (wxCommandEvent &aEvent)
 
void onEditorKeyDown (wxKeyEvent &aEvent)
 
void onEditorTextEnter (wxCommandEvent &aEvent)
 
void onEditorDropdownOpened (wxCommandEvent &aEvent)
 
void onEditorDropdownClosed (wxCommandEvent &aEvent)
 
void finishDropdown ()
 
wxComboCtrl * shownGenericPopup (const wxKeyEvent &aEnterKey)
 
bool finishEditor (bool aCancel, bool aMoveDown=false)
 
virtual bool handleDoubleClick (wxGridEvent &aEvent)
 
virtual void appendPopupMenuItems (wxMenu &aMenu)
 
bool isTextEntry (int aRow, int aCol)
 
bool isChoiceEditor (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 paste_text (const wxString &cb_text)
 
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
 
bool m_columnBulkEditEnabled = false
 
wxGridCellCoords m_bulkEditSource
 
wxString m_bulkEditValue
 
std::vector< std::pair< int, wxString > > m_bulkEditRows
 
BULK_EDIT_SESSION m_bulkEditor
 
bool m_bulkEditorEnterHandled = false
 
bool m_bulkEditorOpening = false
 
bool m_bulkEditorClosing = false
 

Detailed Description

Definition at line 56 of file panel_pcbnew_action_plugins.cpp.

Constructor & Destructor Documentation

◆ PLUGINS_GRID_TRICKS()

PLUGINS_GRID_TRICKS::PLUGINS_GRID_TRICKS ( WX_GRID * aGrid)
inline

Definition at line 59 of file panel_pcbnew_action_plugins.cpp.

References GRID_TRICKS::GRID_TRICKS().

Member Function Documentation

◆ appendPopupMenuItems()

virtual void GRID_TRICKS::appendPopupMenuItems ( wxMenu & aMenu)
inlineprotectedvirtualinherited

Reimplemented in FIELDS_TABLE_GRID_TRICKS.

Definition at line 139 of file grid_tricks.h.

Referenced by showPopupMenu().

◆ cutcopy()

void GRID_TRICKS::cutcopy ( bool doCopy,
bool doDelete )
protectedvirtualinherited

◆ doPopupSelection()

◆ EnableColumnBulkEdit()

void GRID_TRICKS::EnableColumnBulkEdit ( bool aEnable = true)
inlineinherited

Apply an edit to every selected cell in the edited cell's column.

The grid switches to native wxGrid selection so disjoint selections survive opening an editor.

Definition at line 72 of file grid_tricks.h.

References m_columnBulkEditEnabled, and m_grid.

Referenced by DIALOG_FP_EDIT_PAD_TABLE::DIALOG_FP_EDIT_PAD_TABLE(), and DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE().

◆ finishDropdown()

void GRID_TRICKS::finishDropdown ( )
protectedinherited

Definition at line 568 of file grid_tricks.cpp.

References finishEditor(), m_bulkEditor, and m_grid.

Referenced by onEditorDropdownClosed(), onEditorInput(), and SCINTILLA_TRICKS.

◆ finishEditor()

bool GRID_TRICKS::finishEditor ( bool aCancel,
bool aMoveDown = false )
protectedinherited

◆ getSelectedArea()

void GRID_TRICKS::getSelectedArea ( )
protectedinherited

◆ GetTooltipEnabled()

bool GRID_TRICKS::GetTooltipEnabled ( int aCol)
inlineinherited

Query if the tooltip for a column is enabled.

Parameters
aColis the column to query
Returns
if the tooltip is enabled for the column

Definition at line 97 of file grid_tricks.h.

References m_tooltipEnabled.

◆ handleDoubleClick()

bool GRID_TRICKS::handleDoubleClick ( wxGridEvent & aEvent)
protectedvirtualinherited

Reimplemented in JOBS_GRID_TRICKS, and LIB_TABLE_GRID_TRICKS.

Definition at line 822 of file grid_tricks.cpp.

Referenced by onGridCellLeftDClick(), and SCINTILLA_TRICKS.

◆ init()

◆ isCheckbox()

bool GRID_TRICKS::isCheckbox ( int aRow,
int aCol )
protectedinherited

Definition at line 134 of file grid_tricks.cpp.

References m_grid.

Referenced by toggleCell().

◆ isChoiceEditor()

bool GRID_TRICKS::isChoiceEditor ( int aRow,
int aCol )
protectedinherited

Definition at line 122 of file grid_tricks.cpp.

References editor, and m_grid.

Referenced by showPopupMenu().

◆ isReadOnly()

bool GRID_TRICKS::isReadOnly ( int aRow,
int aCol )
protectedinherited

◆ isTextEntry()

bool GRID_TRICKS::isTextEntry ( int aRow,
int aCol )
protectedinherited

Definition at line 110 of file grid_tricks.cpp.

References editor, and m_grid.

Referenced by cutcopy(), and showPopupMenu().

◆ onCharHook()

◆ onEditorDropdownClosed()

void GRID_TRICKS::onEditorDropdownClosed ( wxCommandEvent & aEvent)
protectedinherited

◆ onEditorDropdownOpened()

void GRID_TRICKS::onEditorDropdownOpened ( wxCommandEvent & aEvent)
protectedinherited

◆ onEditorInput()

void GRID_TRICKS::onEditorInput ( wxCommandEvent & aEvent)
protectedinherited

◆ onEditorKeyDown()

void GRID_TRICKS::onEditorKeyDown ( wxKeyEvent & aEvent)
protectedinherited

◆ onEditorTextEnter()

void GRID_TRICKS::onEditorTextEnter ( wxCommandEvent & aEvent)
protectedinherited

Definition at line 511 of file grid_tricks.cpp.

References m_bulkEditorEnterHandled, and m_columnBulkEditEnabled.

Referenced by onGridEditorCreated(), and SCINTILLA_TRICKS.

◆ onGridCellChanged()

void GRID_TRICKS::onGridCellChanged ( wxGridEvent & aEvent)
protectedinherited

Definition at line 730 of file grid_tricks.cpp.

References m_bulkEditRows, m_bulkEditSource, m_bulkEditValue, m_columnBulkEditEnabled, m_grid, and rows.

Referenced by init(), and SCINTILLA_TRICKS.

◆ onGridCellChanging()

void GRID_TRICKS::onGridCellChanging ( wxGridEvent & aEvent)
protectedinherited

◆ onGridCellLeftClick()

void GRID_TRICKS::onGridCellLeftClick ( wxGridEvent & event)
protectedvirtualinherited

◆ onGridCellLeftDClick()

void GRID_TRICKS::onGridCellLeftDClick ( wxGridEvent & event)
protectedinherited

Definition at line 792 of file grid_tricks.cpp.

References handleDoubleClick(), and onGridCellLeftClick().

Referenced by init(), and SCINTILLA_TRICKS.

◆ onGridCellRightClick()

void GRID_TRICKS::onGridCellRightClick ( wxGridEvent & event)
protectedinherited

Definition at line 891 of file grid_tricks.cpp.

References m_columnBulkEditEnabled, m_grid, and showPopupMenu().

Referenced by init(), and SCINTILLA_TRICKS.

◆ onGridEditorCreated()

void GRID_TRICKS::onGridEditorCreated ( wxGridEditorCreatedEvent & aEvent)
protectedinherited

◆ onGridEditorHidden()

void GRID_TRICKS::onGridEditorHidden ( wxGridEvent & aEvent)
protectedinherited

Definition at line 660 of file grid_tricks.cpp.

References editor, m_bulkEditor, m_bulkEditRows, m_columnBulkEditEnabled, and m_grid.

Referenced by init(), and SCINTILLA_TRICKS.

◆ onGridEditorShown()

void GRID_TRICKS::onGridEditorShown ( wxGridEvent & aEvent)
protectedinherited

Definition at line 411 of file grid_tricks.cpp.

References m_bulkEditor, m_columnBulkEditEnabled, and m_grid.

Referenced by init(), and SCINTILLA_TRICKS.

◆ onGridLabelLeftClick()

void GRID_TRICKS::onGridLabelLeftClick ( wxGridEvent & event)
protectedinherited

Definition at line 923 of file grid_tricks.cpp.

References m_grid.

Referenced by init(), and SCINTILLA_TRICKS.

◆ onGridLabelRightClick()

void GRID_TRICKS::onGridLabelRightClick ( wxGridEvent & event)
protectedinherited

Definition at line 931 of file grid_tricks.cpp.

References GRIDTRICKS_FIRST_SHOWHIDE, and m_grid.

Referenced by init(), and SCINTILLA_TRICKS.

◆ onGridMotion()

void GRID_TRICKS::onGridMotion ( wxMouseEvent & event)
protectedinherited

Definition at line 799 of file grid_tricks.cpp.

References m_grid, and m_tooltipEnabled.

Referenced by init(), and SCINTILLA_TRICKS.

◆ onKeyDown()

void GRID_TRICKS::onKeyDown ( wxKeyEvent & event)
protectedinherited

◆ onPopupSelection()

void GRID_TRICKS::onPopupSelection ( wxCommandEvent & event)
protectedinherited

Definition at line 1015 of file grid_tricks.cpp.

References doPopupSelection().

Referenced by init(), and SCINTILLA_TRICKS.

◆ onUpdateUI()

void GRID_TRICKS::onUpdateUI ( wxUpdateUIEvent & event)
protectedinherited

Definition at line 1631 of file grid_tricks.cpp.

References m_grid.

Referenced by init(), and SCINTILLA_TRICKS.

◆ paste_clipboard()

void GRID_TRICKS::paste_clipboard ( )
protectedvirtualinherited

Definition at line 1418 of file grid_tricks.cpp.

References m_columnBulkEditEnabled, m_grid, paste_text(), and text.

Referenced by doPopupSelection(), and onKeyDown().

◆ paste_text()

void GRID_TRICKS::paste_text ( const wxString & cb_text)
protectedvirtualinherited

◆ SetTooltipEnable()

void GRID_TRICKS::SetTooltipEnable ( int aCol,
bool aEnable = true )
inlineinherited

Enable the tooltip for a column.

The tooltip is read from the string contained in the cell data.

Parameters
aColis the column to use
aEnableis true to enable the tooltip (default)

Definition at line 86 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().

◆ showEditor()

bool GRID_TRICKS::showEditor ( int aRow,
int aCol )
protectedinherited

◆ shownGenericPopup()

wxComboCtrl * GRID_TRICKS::shownGenericPopup ( const wxKeyEvent & aEnterKey)
protectedinherited

Definition at line 591 of file grid_tricks.cpp.

References editor, m_columnBulkEditEnabled, and m_grid.

Referenced by onCharHook(), onEditorKeyDown(), and SCINTILLA_TRICKS.

◆ showPopupMenu()

void PLUGINS_GRID_TRICKS::showPopupMenu ( wxMenu & menu,
wxGridEvent & aEvent )
overrideprotectedvirtual

◆ toggleCell()

Member Data Documentation

◆ m_addHandler

std::function<void( wxCommandEvent& )> GRID_TRICKS::m_addHandler
protectedinherited

Definition at line 185 of file grid_tricks.h.

Referenced by GRID_TRICKS(), GRID_TRICKS(), onCharHook(), and paste_text().

◆ m_bulkEditor

◆ m_bulkEditorClosing

bool GRID_TRICKS::m_bulkEditorClosing = false
protectedinherited

Definition at line 198 of file grid_tricks.h.

Referenced by finishEditor(), and onEditorDropdownClosed().

◆ m_bulkEditorEnterHandled

bool GRID_TRICKS::m_bulkEditorEnterHandled = false
protectedinherited

Definition at line 196 of file grid_tricks.h.

Referenced by onCharHook(), onEditorKeyDown(), and onEditorTextEnter().

◆ m_bulkEditorOpening

bool GRID_TRICKS::m_bulkEditorOpening = false
protectedinherited

Definition at line 197 of file grid_tricks.h.

Referenced by onCharHook(), onEditorDropdownOpened(), and onEditorInput().

◆ m_bulkEditRows

std::vector<std::pair<int, wxString> > GRID_TRICKS::m_bulkEditRows
protectedinherited

Definition at line 194 of file grid_tricks.h.

Referenced by onGridCellChanged(), onGridCellChanging(), and onGridEditorHidden().

◆ m_bulkEditSource

wxGridCellCoords GRID_TRICKS::m_bulkEditSource
protectedinherited

Definition at line 192 of file grid_tricks.h.

Referenced by onGridCellChanged(), and onGridCellChanging().

◆ m_bulkEditValue

wxString GRID_TRICKS::m_bulkEditValue
protectedinherited

Definition at line 193 of file grid_tricks.h.

Referenced by onGridCellChanged(), and onGridCellChanging().

◆ m_columnBulkEditEnabled

◆ m_enableSingleClickEdit

bool GRID_TRICKS::m_enableSingleClickEdit
protectedinherited

◆ m_grid

WX_GRID* GRID_TRICKS::m_grid
protectedinherited

I don't own the grid, but he owns me.

Definition at line 176 of file grid_tricks.h.

Referenced by FIELDS_TABLE_GRID_TRICKS::appendPopupMenuItems(), FIELDS_TABLE_GRID_TRICKS::copyFromVariant(), cutcopy(), FOOTPRINT_FIELDS_EDITOR_GRID_TRICKS::doFieldsTablePopupSelection(), LIB_FIELDS_EDITOR_GRID_TRICKS::doFieldsTablePopupSelection(), LIB_FOOTPRINT_FIELDS_EDITOR_GRID_TRICKS::doFieldsTablePopupSelection(), SYMBOL_FIELDS_EDITOR_GRID_TRICKS::doFieldsTablePopupSelection(), CURSORS_GRID_TRICKS::doPopupSelection(), EMBEDDED_FILES_GRID_TRICKS::doPopupSelection(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_TABLE_GRID_TRICKS::doPopupSelection(), doPopupSelection(), JOBS_GRID_TRICKS::doPopupSelection(), LIB_TABLE_GRID_TRICKS::doPopupSelection(), MEASUREMENTS_GRID_TRICKS::doPopupSelection(), PLUGINS_GRID_TRICKS::doPopupSelection(), SIGNALS_GRID_TRICKS::doPopupSelection(), EnableColumnBulkEdit(), finishDropdown(), finishEditor(), FIELDS_GRID_TRICKS::getFieldRow(), getSelectedArea(), GRID_TRICKS(), GRID_TRICKS(), JOBS_GRID_TRICKS::handleDoubleClick(), LIB_TABLE_GRID_TRICKS::handleDoubleClick(), init(), isCheckbox(), isChoiceEditor(), isReadOnly(), isTextEntry(), onCharHook(), LIB_TABLE_GRID_TRICKS::onCharHook(), onEditorDropdownClosed(), onEditorInput(), onGridCellChanged(), onGridCellChanging(), onGridCellLeftClick(), LIB_TABLE_GRID_TRICKS::onGridCellLeftClick(), onGridCellRightClick(), onGridEditorHidden(), onGridEditorShown(), 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(), FOOTPRINT_FIELDS_EDITOR_GRID_TRICKS::showFieldsTablePopupMenu(), LIB_FIELDS_EDITOR_GRID_TRICKS::showFieldsTablePopupMenu(), LIB_FOOTPRINT_FIELDS_EDITOR_GRID_TRICKS::showFieldsTablePopupMenu(), SYMBOL_FIELDS_EDITOR_GRID_TRICKS::showFieldsTablePopupMenu(), shownGenericPopup(), CURSORS_GRID_TRICKS::showPopupMenu(), FIELDS_GRID_TRICKS::showPopupMenu(), FIELDS_TABLE_GRID_TRICKS::showPopupMenu(), showPopupMenu(), JOBS_GRID_TRICKS::showPopupMenu(), LIB_TABLE_GRID_TRICKS::showPopupMenu(), MEASUREMENTS_GRID_TRICKS::showPopupMenu(), PIN_MAP_GRID_TRICKS::showPopupMenu(), PLUGINS_GRID_TRICKS::showPopupMenu(), SIGNALS_GRID_TRICKS::showPopupMenu(), FOOTPRINT_FIELDS_EDITOR_GRID_TRICKS::toggleCell(), toggleCell(), LIB_FIELDS_EDITOR_GRID_TRICKS::toggleCell(), LIB_FOOTPRINT_FIELDS_EDITOR_GRID_TRICKS::toggleCell(), and SYMBOL_FIELDS_EDITOR_GRID_TRICKS::toggleCell().

◆ m_multiCellEditEnabled

bool GRID_TRICKS::m_multiCellEditEnabled
protectedinherited

◆ m_sel_col_count

int GRID_TRICKS::m_sel_col_count
protectedinherited

Definition at line 183 of file grid_tricks.h.

Referenced by cutcopy(), getSelectedArea(), init(), paste_text(), showEditor(), and showPopupMenu().

◆ m_sel_col_start

int GRID_TRICKS::m_sel_col_start
protectedinherited

Definition at line 181 of file grid_tricks.h.

Referenced by cutcopy(), getSelectedArea(), init(), paste_text(), showEditor(), and showPopupMenu().

◆ m_sel_row_count

◆ m_sel_row_start

◆ m_tooltipEnabled

std::bitset<GRIDTRICKS_MAX_COL> GRID_TRICKS::m_tooltipEnabled
protectedinherited

Definition at line 187 of file grid_tricks.h.

Referenced by GetTooltipEnabled(), onGridMotion(), and SetTooltipEnable().


The documentation for this class was generated from the following file: