KiCad PCB EDA Suite
Loading...
Searching...
No Matches
EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT > Class Template Referenceabstract

SCH_TABLE_EDIT_TOOL and PCB_TABLE_EDIT_TOOL share most of their algorithms, which are implemented here. More...

#include <edit_table_tool_base.h>

Public Member Functions

bool getCellBlockBounds (const SELECTION &aSel, int &aColMin, int &aColMax, int &aRowMin, int &aRowMax)
 Get the bounding box of a cell block selection.
 
bool validatePasteIntoSelection (const SELECTION &aSel, wxString &aErrorMsg)
 Validate if paste-into-cells is possible for the given selection.
 
bool pasteCellsIntoSelection (const SELECTION &aSel, T_TABLE *aSourceTable, T_COMMIT &aCommit)
 Paste text content from source table into selected cells.
 
virtual TOOL_MANAGERgetToolMgr ()=0
 
virtual BASE_SCREENgetScreen ()=0
 
virtual const SELECTIONgetTableCellSelection ()=0
 
virtual void clearSelection ()=0
 
virtual T_TABLECELL * copyCell (T_TABLECELL *aSource)=0
 

Protected Member Functions

void addMenus (CONDITIONAL_MENU &selToolMenu)
 
int doAddRowAbove (const TOOL_EVENT &aEvent)
 
int doAddRowBelow (const TOOL_EVENT &aEvent)
 
int doAddColumnBefore (const TOOL_EVENT &aEvent)
 
int doAddColumnAfter (const TOOL_EVENT &aEvent)
 
int doDeleteRows (const TOOL_EVENT &aEvent)
 
int doDeleteColumns (const TOOL_EVENT &aEvent)
 
int doMergeCells (const TOOL_EVENT &aEvent)
 
int doUnmergeCells (const TOOL_EVENT &aEvent)
 

Detailed Description

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
class EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >

SCH_TABLE_EDIT_TOOL and PCB_TABLE_EDIT_TOOL share most of their algorithms, which are implemented here.

Definition at line 42 of file edit_table_tool_base.h.

Member Function Documentation

◆ addMenus()

◆ clearSelection()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
virtual void EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::clearSelection ( )
pure virtual

Implemented in PCB_EDIT_TABLE_TOOL, and SCH_EDIT_TABLE_TOOL.

Referenced by doDeleteColumns(), and doDeleteRows().

◆ copyCell()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
virtual T_TABLECELL * EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::copyCell ( T_TABLECELL * aSource)
pure virtual

◆ doAddColumnAfter()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doAddColumnAfter ( const TOOL_EVENT & aEvent)
inlineprotected

◆ doAddColumnBefore()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doAddColumnBefore ( const TOOL_EVENT & aEvent)
inlineprotected

◆ doAddRowAbove()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doAddRowAbove ( const TOOL_EVENT & aEvent)
inlineprotected

◆ doAddRowBelow()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doAddRowBelow ( const TOOL_EVENT & aEvent)
inlineprotected

◆ doDeleteColumns()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doDeleteColumns ( const TOOL_EVENT & aEvent)
inlineprotected

◆ doDeleteRows()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doDeleteRows ( const TOOL_EVENT & aEvent)
inlineprotected

◆ doMergeCells()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doMergeCells ( const TOOL_EVENT & aEvent)
inlineprotected

◆ doUnmergeCells()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
int EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::doUnmergeCells ( const TOOL_EVENT & aEvent)
inlineprotected

◆ getCellBlockBounds()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
bool EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::getCellBlockBounds ( const SELECTION & aSel,
int & aColMin,
int & aColMax,
int & aRowMin,
int & aRowMax )
inline

Get the bounding box of a cell block selection.

Parameters
aSelThe selection to analyze
aColMinOutput: minimum column index
aColMaxOutput: maximum column index (exclusive)
aRowMinOutput: minimum row index
aRowMaxOutput: maximum row index (exclusive)
Returns
true if selection forms a valid contiguous block, false otherwise

Definition at line 602 of file edit_table_tool_base.h.

References SELECTION::Size().

Referenced by pasteCellsIntoSelection(), and validatePasteIntoSelection().

◆ getScreen()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
virtual BASE_SCREEN * EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::getScreen ( )
pure virtual

◆ getTableCellSelection()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
virtual const SELECTION & EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::getTableCellSelection ( )
pure virtual

◆ getToolMgr()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
virtual TOOL_MANAGER * EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::getToolMgr ( )
pure virtual

◆ pasteCellsIntoSelection()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
bool EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::pasteCellsIntoSelection ( const SELECTION & aSel,
T_TABLE * aSourceTable,
T_COMMIT & aCommit )
inline

Paste text content from source table into selected cells.

Parameters
aSelThe target cell selection
aSourceTableThe table containing cells to paste
aCommitThe commit object for tracking changes
Returns
true if paste succeeded, false otherwise

Definition at line 697 of file edit_table_tool_base.h.

References copyCell(), SELECTION::Empty(), getCellBlockBounds(), and getScreen().

Referenced by PCB_CONTROL::Paste(), and SCH_EDITOR_CONTROL::Paste().

◆ validatePasteIntoSelection()

template<typename T_TABLE, typename T_TABLECELL, typename T_COMMIT>
bool EDIT_TABLE_TOOL_BASE< T_TABLE, T_TABLECELL, T_COMMIT >::validatePasteIntoSelection ( const SELECTION & aSel,
wxString & aErrorMsg )
inline

Validate if paste-into-cells is possible for the given selection.

Parameters
aSelThe target cell selection
aErrorMsgOutput: error message if validation fails
Returns
true if paste-into is valid, false otherwise

Definition at line 639 of file edit_table_tool_base.h.

References _, SELECTION::Empty(), getCellBlockBounds(), and table.

Referenced by PCB_CONTROL::Paste(), and SCH_EDITOR_CONTROL::Paste().


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