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

Public Member Functions

 DESIGN_BLOCK_GRID_TRICKS (DIALOG_EDIT_LIBRARY_TABLES *aParent, WX_GRID *aGrid)
 
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.
 

Protected Member Functions

void optionsEditor (int aRow) override
 
void paste_text (const wxString &cb_text) override
 handle specialized clipboard text, with leading "(design_block_lib_table", OR spreadsheet formatted text.
 
bool handleDoubleClick (wxGridEvent &aEvent) override
 
void onCharHook (wxKeyEvent &ev)
 
virtual bool supportsVisibilityColumn ()
 
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 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)
 
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

DIALOG_EDIT_LIBRARY_TABLESm_dialog
 
WX_GRIDm_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_COLm_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_OPTIONS_EDITOR
}
 

Detailed Description

Definition at line 131 of file panel_design_block_lib_table.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
privateinherited
Enumerator
LIB_TABLE_GRID_TRICKS_ACTIVATE_SELECTED 
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_OPTIONS_EDITOR 

Definition at line 25 of file lib_table_grid_tricks.h.

Constructor & Destructor Documentation

◆ DESIGN_BLOCK_GRID_TRICKS()

DESIGN_BLOCK_GRID_TRICKS::DESIGN_BLOCK_GRID_TRICKS ( DIALOG_EDIT_LIBRARY_TABLES * aParent,
WX_GRID * aGrid )
inline

Member Function Documentation

◆ cutcopy()

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

◆ doPopupSelection()

◆ getSelectedArea()

void GRID_TRICKS::getSelectedArea ( )
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(), FP_GRID_TRICKS::paste_text(), SYMBOL_GRID_TRICKS::paste_text(), showPopupMenu(), and LIB_TABLE_GRID_TRICKS::showPopupMenu().

◆ 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 86 of file grid_tricks.h.

References m_tooltipEnabled.

◆ handleDoubleClick()

bool LIB_TABLE_GRID_TRICKS::handleDoubleClick ( wxGridEvent & aEvent)
overrideprotectedvirtualinherited

Reimplemented from GRID_TRICKS.

Definition at line 206 of file lib_table_grid_tricks.cpp.

References COL_OPTIONS, and optionsEditor().

◆ init()

◆ isCheckbox()

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

Definition at line 106 of file grid_tricks.cpp.

References m_grid.

Referenced by toggleCell().

◆ isReadOnly()

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

Definition at line 116 of file grid_tricks.cpp.

References m_grid.

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

◆ isTextEntry()

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

Definition at line 95 of file grid_tricks.cpp.

References editor, and m_grid.

Referenced by cutcopy(), and showPopupMenu().

◆ onCharHook()

void LIB_TABLE_GRID_TRICKS::onCharHook ( wxKeyEvent & ev)
protectedinherited

◆ onGridCellLeftClick()

void GRID_TRICKS::onGridCellLeftClick ( wxGridEvent & event)
protectedinherited

◆ onGridCellLeftDClick()

void GRID_TRICKS::onGridCellLeftDClick ( wxGridEvent & event)
protectedinherited

Definition at line 251 of file grid_tricks.cpp.

References handleDoubleClick(), and onGridCellLeftClick().

Referenced by init().

◆ onGridCellRightClick()

void GRID_TRICKS::onGridCellRightClick ( wxGridEvent & event)
protectedinherited

Definition at line 328 of file grid_tricks.cpp.

References showPopupMenu().

Referenced by init().

◆ onGridLabelLeftClick()

void GRID_TRICKS::onGridLabelLeftClick ( wxGridEvent & event)
protectedinherited

Definition at line 336 of file grid_tricks.cpp.

References m_grid.

Referenced by init().

◆ onGridLabelRightClick()

void GRID_TRICKS::onGridLabelRightClick ( wxGridEvent & event)
protectedinherited

Definition at line 344 of file grid_tricks.cpp.

References GRIDTRICKS_FIRST_SHOWHIDE, and m_grid.

Referenced by init().

◆ onGridMotion()

void GRID_TRICKS::onGridMotion ( wxMouseEvent & event)
protectedinherited

Definition at line 258 of file grid_tricks.cpp.

References m_grid, and m_tooltipEnabled.

Referenced by init().

◆ onKeyDown()

void GRID_TRICKS::onKeyDown ( wxKeyEvent & event)
protectedinherited

Definition at line 540 of file grid_tricks.cpp.

References cutcopy(), end, getSelectedArea(), m_grid, paste_clipboard(), and toggleCell().

Referenced by init(), and SCINTILLA_TRICKS::onCharHook().

◆ onPopupSelection()

void GRID_TRICKS::onPopupSelection ( wxCommandEvent & event)
protectedinherited

Definition at line 424 of file grid_tricks.cpp.

References doPopupSelection().

Referenced by init().

◆ onUpdateUI()

void GRID_TRICKS::onUpdateUI ( wxUpdateUIEvent & event)
protectedinherited

Definition at line 894 of file grid_tricks.cpp.

References m_grid.

Referenced by init().

◆ optionsEditor()

◆ paste_clipboard()

void GRID_TRICKS::paste_clipboard ( )
protectedvirtualinherited

Definition at line 698 of file grid_tricks.cpp.

References m_grid, paste_text(), and text.

Referenced by doPopupSelection(), and onKeyDown().

◆ paste_text()

void DESIGN_BLOCK_GRID_TRICKS::paste_text ( const wxString & cb_text)
inlineoverrideprotectedvirtual

◆ 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 75 of file grid_tricks.h.

References m_tooltipEnabled.

Referenced by PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL().

◆ showEditor()

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

◆ showPopupMenu()

◆ supportsVisibilityColumn()

virtual bool LIB_TABLE_GRID_TRICKS::supportsVisibilityColumn ( )
inlineprotectedvirtualinherited

Reimplemented in SYMBOL_GRID_TRICKS.

Definition at line 50 of file lib_table_grid_tricks.h.

Referenced by showPopupMenu().

◆ toggleCell()

bool GRID_TRICKS::toggleCell ( int aRow,
int aCol,
bool aPreserveSelection = false )
protectedvirtualinherited

Reimplemented in FP_GRID_TRICKS.

Definition at line 122 of file grid_tricks.cpp.

References isCheckbox(), and m_grid.

Referenced by onGridCellLeftClick(), onKeyDown(), and FP_GRID_TRICKS::toggleCell().

Member Data Documentation

◆ m_addHandler

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

Definition at line 137 of file grid_tricks.h.

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

◆ m_dialog

DIALOG_EDIT_LIBRARY_TABLES* DESIGN_BLOCK_GRID_TRICKS::m_dialog
protected

◆ 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 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(), onGridLabelLeftClick(), onGridLabelRightClick(), onGridMotion(), onKeyDown(), onUpdateUI(), DESIGN_BLOCK_GRID_TRICKS::optionsEditor(), FP_GRID_TRICKS::optionsEditor(), SYMBOL_GRID_TRICKS::optionsEditor(), paste_clipboard(), DESIGN_BLOCK_GRID_TRICKS::paste_text(), FP_GRID_TRICKS::paste_text(), paste_text(), SYMBOL_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().

◆ m_multiCellEditEnabled

bool GRID_TRICKS::m_multiCellEditEnabled
protectedinherited

◆ m_sel_col_count

int GRID_TRICKS::m_sel_col_count
protectedinherited

Definition at line 135 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 133 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 139 of file grid_tricks.h.

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


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