KiCad PCB EDA Suite
Loading...
Searching...
No Matches
GRID_CELL_RUN_FUNCTION_EDITOR Class Reference

A cell editor which runs a provided function when the grid cell button is clicked. More...

#include <grid_text_button_helpers.h>

Inheritance diagram for GRID_CELL_RUN_FUNCTION_EDITOR:
GRID_CELL_TEXT_BUTTON GRID_CELL_NULLABLE_INTERFACE

Public Member Functions

 GRID_CELL_RUN_FUNCTION_EDITOR (DIALOG_SHIM *aParent, const std::function< void(int, int)> aFunction, const bool aIsNullable=false)
 
wxGridCellEditor * Clone () const override
 
void Create (wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override
 
void BeginEdit (int aRow, int aCol, wxGrid *aGrid) override
 
wxString GetValue () const override
 
void SetSize (const wxRect &aRect) override
 
void StartingKey (wxKeyEvent &event) override
 
bool EndEdit (int, int, const wxGrid *, const wxString &, wxString *aNewVal) override
 
void ApplyEdit (int aRow, int aCol, wxGrid *aGrid) override
 
void Reset () override
 
virtual bool IsNullable () const
 

Protected Member Functions

wxComboCtrl * Combo () const
 
 wxDECLARE_NO_COPY_CLASS (GRID_CELL_TEXT_BUTTON)
 

Protected Attributes

DIALOG_SHIMm_dlg
 
int m_row
 
int m_col
 
std::function< void(int, int)> m_function
 
wxString m_value
 
bool m_isNullable { false }
 

Detailed Description

A cell editor which runs a provided function when the grid cell button is clicked.

The function has the signature (int, int) -> void. The passed parameters are the (row, col) of the clicked grid cell

Definition at line 233 of file grid_text_button_helpers.h.

Constructor & Destructor Documentation

◆ GRID_CELL_RUN_FUNCTION_EDITOR()

GRID_CELL_RUN_FUNCTION_EDITOR::GRID_CELL_RUN_FUNCTION_EDITOR ( DIALOG_SHIM * aParent,
const std::function< void(int, int)> aFunction,
const bool aIsNullable = false )
inline

Member Function Documentation

◆ ApplyEdit()

void GRID_CELL_TEXT_BUTTON::ApplyEdit ( int aRow,
int aCol,
wxGrid * aGrid )
overrideinherited

Definition at line 153 of file grid_text_button_helpers.cpp.

References m_value.

◆ BeginEdit()

void GRID_CELL_RUN_FUNCTION_EDITOR::BeginEdit ( int aRow,
int aCol,
wxGrid * aGrid )
override

Definition at line 672 of file grid_text_button_helpers.cpp.

References GRID_CELL_TEXT_BUTTON::BeginEdit(), m_col, and m_row.

◆ Clone()

wxGridCellEditor * GRID_CELL_RUN_FUNCTION_EDITOR::Clone ( ) const
inlineoverride

◆ Combo()

◆ Create()

void GRID_CELL_RUN_FUNCTION_EDITOR::Create ( wxWindow * aParent,
wxWindowID aId,
wxEvtHandler * aEventHandler )
override

◆ EndEdit()

bool GRID_CELL_TEXT_BUTTON::EndEdit ( int ,
int ,
const wxGrid * ,
const wxString & ,
wxString * aNewVal )
overrideinherited

Definition at line 137 of file grid_text_button_helpers.cpp.

References Combo(), and m_value.

◆ GetValue()

wxString GRID_CELL_TEXT_BUTTON::GetValue ( ) const
overrideinherited

Definition at line 57 of file grid_text_button_helpers.cpp.

References Combo().

◆ IsNullable()

virtual bool GRID_CELL_NULLABLE_INTERFACE::IsNullable ( ) const
inlinevirtualinherited

◆ Reset()

void GRID_CELL_TEXT_BUTTON::Reset ( )
overrideinherited

Definition at line 159 of file grid_text_button_helpers.cpp.

References Combo(), and m_value.

◆ SetSize()

void GRID_CELL_TEXT_BUTTON::SetSize ( const wxRect & aRect)
overrideinherited

◆ StartingKey()

void GRID_CELL_TEXT_BUTTON::StartingKey ( wxKeyEvent & event)
overrideinherited

Definition at line 72 of file grid_text_button_helpers.cpp.

References Combo().

◆ wxDECLARE_NO_COPY_CLASS()

GRID_CELL_TEXT_BUTTON::wxDECLARE_NO_COPY_CLASS ( GRID_CELL_TEXT_BUTTON )
protectedinherited

Member Data Documentation

◆ m_col

int GRID_CELL_RUN_FUNCTION_EDITOR::m_col
protected

Definition at line 258 of file grid_text_button_helpers.h.

Referenced by BeginEdit(), Create(), and GRID_CELL_RUN_FUNCTION_EDITOR().

◆ m_dlg

DIALOG_SHIM* GRID_CELL_RUN_FUNCTION_EDITOR::m_dlg
protected

Definition at line 256 of file grid_text_button_helpers.h.

Referenced by Clone(), Create(), and GRID_CELL_RUN_FUNCTION_EDITOR().

◆ m_function

std::function<void( int, int )> GRID_CELL_RUN_FUNCTION_EDITOR::m_function
protected

Definition at line 259 of file grid_text_button_helpers.h.

Referenced by Clone(), Create(), and GRID_CELL_RUN_FUNCTION_EDITOR().

◆ m_isNullable

bool GRID_CELL_NULLABLE_INTERFACE::m_isNullable { false }
protectedinherited

◆ m_row

int GRID_CELL_RUN_FUNCTION_EDITOR::m_row
protected

Definition at line 257 of file grid_text_button_helpers.h.

Referenced by BeginEdit(), Create(), and GRID_CELL_RUN_FUNCTION_EDITOR().

◆ m_value

wxString GRID_CELL_TEXT_BUTTON::m_value
protectedinherited

Definition at line 69 of file grid_text_button_helpers.h.

Referenced by ApplyEdit(), BeginEdit(), EndEdit(), and Reset().


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