KiCad PCB EDA Suite
Loading...
Searching...
No Matches
LIB_TABLE_GRID_TRICKS Class Referenceabstract

#include <lib_table_grid_tricks.h>

Inheritance diagram for LIB_TABLE_GRID_TRICKS:
GRID_TRICKS FP_GRID_TRICKS SYMBOL_GRID_TRICKS

Public Member Functions

 LIB_TABLE_GRID_TRICKS (WX_GRID *aGrid)
 
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. More...
 
bool GetTooltipEnabled (int aCol)
 Query if the tooltip for a column is enabled. More...
 

Protected Member Functions

virtual void optionsEditor (int aRow)=0
 
bool handleDoubleClick (wxGridEvent &aEvent) override
 
void init ()
 Shared initialization for various ctors. More...
 
void getSelectedArea ()
 Puts the selected area into a sensible rectangle of m_sel_{row,col}_{start,count} above. More...
 
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 onCharHook (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)
 
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_GRIDm_grid
 I don't own the grid, but he owns me. More...
 
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
 

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 22 of file lib_table_grid_tricks.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
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 24 of file lib_table_grid_tricks.h.

Constructor & Destructor Documentation

◆ LIB_TABLE_GRID_TRICKS()

LIB_TABLE_GRID_TRICKS::LIB_TABLE_GRID_TRICKS ( WX_GRID aGrid)
explicit

Definition at line 24 of file lib_table_grid_tricks.cpp.

◆ ~LIB_TABLE_GRID_TRICKS()

virtual LIB_TABLE_GRID_TRICKS::~LIB_TABLE_GRID_TRICKS ( )
inlinevirtual

Definition at line 37 of file lib_table_grid_tricks.h.

Member Function Documentation

◆ cutcopy()

◆ 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 282 of file grid_tricks.cpp.

References GRID_TRICKS::m_grid, GRID_TRICKS::m_sel_col_count, GRID_TRICKS::m_sel_col_start, GRID_TRICKS::m_sel_row_count, and GRID_TRICKS::m_sel_row_start.

Referenced by GRID_TRICKS::onGridCellLeftClick(), GRID_TRICKS::onKeyDown(), GRID_TRICKS::showPopupMenu(), and 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 GRID_TRICKS::m_tooltipEnabled.

◆ handleDoubleClick()

bool LIB_TABLE_GRID_TRICKS::handleDoubleClick ( wxGridEvent &  aEvent)
overrideprotectedvirtual

Reimplemented from GRID_TRICKS.

Definition at line 135 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 102 of file grid_tricks.cpp.

References GRID_TRICKS::m_grid.

Referenced by GRID_TRICKS::toggleCell().

◆ isReadOnly()

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

◆ isTextEntry()

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

Definition at line 91 of file grid_tricks.cpp.

References editor, and GRID_TRICKS::m_grid.

Referenced by GRID_TRICKS::cutcopy(), and GRID_TRICKS::showPopupMenu().

◆ onCharHook()

void GRID_TRICKS::onCharHook ( wxKeyEvent &  event)
protectedinherited

◆ onGridCellLeftClick()

void GRID_TRICKS::onGridCellLeftClick ( wxGridEvent &  event)
protectedinherited

◆ onGridCellLeftDClick()

void GRID_TRICKS::onGridCellLeftDClick ( wxGridEvent &  event)
protectedinherited

◆ onGridCellRightClick()

void GRID_TRICKS::onGridCellRightClick ( wxGridEvent &  event)
protectedinherited

Definition at line 322 of file grid_tricks.cpp.

References GRID_TRICKS::showPopupMenu().

Referenced by GRID_TRICKS::init().

◆ onGridLabelLeftClick()

void GRID_TRICKS::onGridLabelLeftClick ( wxGridEvent &  event)
protectedinherited

Definition at line 330 of file grid_tricks.cpp.

References WX_GRID::CommitPendingChanges(), and GRID_TRICKS::m_grid.

Referenced by GRID_TRICKS::init().

◆ onGridLabelRightClick()

void GRID_TRICKS::onGridLabelRightClick ( wxGridEvent &  event)
protectedinherited

Definition at line 338 of file grid_tricks.cpp.

References GRIDTRICKS_FIRST_SHOWHIDE, and GRID_TRICKS::m_grid.

Referenced by GRID_TRICKS::init().

◆ onGridMotion()

void GRID_TRICKS::onGridMotion ( wxMouseEvent &  event)
protectedinherited

Definition at line 252 of file grid_tricks.cpp.

References GRID_TRICKS::m_grid, and GRID_TRICKS::m_tooltipEnabled.

Referenced by GRID_TRICKS::init().

◆ onKeyDown()

void GRID_TRICKS::onKeyDown ( wxKeyEvent &  event)
protectedinherited

◆ onPopupSelection()

void GRID_TRICKS::onPopupSelection ( wxCommandEvent &  event)
protectedinherited

Definition at line 412 of file grid_tricks.cpp.

References GRID_TRICKS::doPopupSelection().

Referenced by GRID_TRICKS::init().

◆ onUpdateUI()

void GRID_TRICKS::onUpdateUI ( wxUpdateUIEvent &  event)
protectedinherited

Definition at line 861 of file grid_tricks.cpp.

References GRID_TRICKS::m_grid.

Referenced by GRID_TRICKS::init().

◆ optionsEditor()

virtual void LIB_TABLE_GRID_TRICKS::optionsEditor ( int  aRow)
protectedpure virtual

Implemented in SYMBOL_GRID_TRICKS, and FP_GRID_TRICKS.

Referenced by doPopupSelection(), and handleDoubleClick().

◆ paste_clipboard()

void GRID_TRICKS::paste_clipboard ( )
protectedvirtualinherited

◆ paste_text()

◆ 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 GRID_TRICKS::m_tooltipEnabled.

Referenced by PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL().

◆ showEditor()

◆ showPopupMenu()

◆ toggleCell()

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

Member Data Documentation

◆ m_addHandler

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

Definition at line 134 of file grid_tricks.h.

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

◆ m_grid

◆ m_sel_col_count

int GRID_TRICKS::m_sel_col_count
protectedinherited

◆ m_sel_col_start

int GRID_TRICKS::m_sel_col_start
protectedinherited

◆ m_sel_row_count

◆ m_sel_row_start

◆ m_tooltipEnabled

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

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