NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
CombinedCellEditor Class Reference

This class represents the grid cell editor which automatically selects the necessary edit control for the underlying column data type. More...

#include <cellattributes.hpp>

Inheritance diagram for CombinedCellEditor:
Collaboration diagram for CombinedCellEditor:

Public Member Functions

 CombinedCellEditor (wxGrid *grid)
 Construct this editor for the current wxGrid. More...
 
virtual void Create (wxWindow *parent, wxWindowID id, wxEvtHandler *evtHandler) override
 Create the necessary edit controls. More...
 
virtual void SetSize (const wxRect &_rect) override
 Set size and position of the controls. More...
 
virtual void PaintBackground (wxDC &dc, const wxRect &rectCell, const wxGridCellAttr &attr) override
 Paint the background. More...
 
virtual bool IsAcceptedKey (wxKeyEvent &event) override
 Determine, whether the pressed key is accepted by this editor and will start the editing process. More...
 
virtual void BeginEdit (int row, int col, wxGrid *grid) override
 Begin the editing process. Will select the correct edit control depending on the underlying column data type. More...
 
virtual bool EndEdit (int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval) override
 End the editing process. Will store the value of the edit control internally and reset the edit control to its original state. More...
 
virtual void ApplyEdit (int row, int col, wxGrid *grid) override
 Called after EndEdit if the user did not cancel the process and will store the value in the correct cell. More...
 
virtual void Reset () override
 Reset the control to its initial state. More...
 
virtual void StartingClick () override
 Called after BeginEdit if the user clicked on this cell to handle the click event. More...
 
virtual void StartingKey (wxKeyEvent &event) override
 Called after BeginEdit to give this control the possibility to respond to the initial key. More...
 
virtual void HandleReturn (wxKeyEvent &event) override
 We do not handle the return key as a character. More...
 
virtual wxGridCellEditor * Clone () const override
 Get a copy of this editor instance. More...
 
virtual wxString GetValue () const override
 Get the value stored in this editor. More...
 
virtual void Show (bool show, wxGridCellAttr *attr=nullptr) override
 Show or hide the edit control. Will in fact only hide the controls. Showing them is done in BeginEdit. More...
 

Protected Member Functions

void SetTextCtrlSize (const wxRect &_rect)
 Set the size and position of the text control and the combo box. More...
 
void SetCheckBoxSize (const wxRect &_rect)
 Set size and position of the check box. More...
 
void OnEnterKey (wxCommandEvent &event)
 Respond to ENTER key events created by the combo box control. More...
 
void finalize (bool moveCursor)
 Inform the grid to finalize the editing process. More...
 

Protected Attributes

wxTextCtrl * m_text
 
wxCheckBox * m_checkBox
 
wxComboBox * m_comboBox
 
wxGrid * m_grid
 
wxString m_value
 
bool m_finished
 

Detailed Description

This class represents the grid cell editor which automatically selects the necessary edit control for the underlying column data type.

Definition at line 319 of file cellattributes.hpp.

Constructor & Destructor Documentation

◆ CombinedCellEditor()

CombinedCellEditor::CombinedCellEditor ( wxGrid *  grid)
inline

Construct this editor for the current wxGrid.

Parameters
gridwxGrid*

Definition at line 329 of file cellattributes.hpp.

Referenced by Clone().

Member Function Documentation

◆ ApplyEdit()

virtual void CombinedCellEditor::ApplyEdit ( int  row,
int  col,
wxGrid *  grid 
)
inlineoverridevirtual

Called after EndEdit if the user did not cancel the process and will store the value in the correct cell.

Parameters
rowint
colint
gridwxGrid*
Returns
void

Definition at line 581 of file cellattributes.hpp.

References m_value.

◆ BeginEdit()

virtual void CombinedCellEditor::BeginEdit ( int  row,
int  col,
wxGrid *  grid 
)
inlineoverridevirtual

Begin the editing process. Will select the correct edit control depending on the underlying column data type.

Parameters
rowint
colint
gridwxGrid*
Returns
void

Definition at line 430 of file cellattributes.hpp.

References GridNumeReTable::getCategories(), GridNumeReTable::getColumnTypes(), GridNumeReTable::GetValue(), m_checkBox, m_comboBox, m_finished, m_text, m_value, Reset(), TableColumn::TYPE_CATEGORICAL, and TableColumn::TYPE_LOGICAL.

Here is the call graph for this function:

◆ Clone()

virtual wxGridCellEditor * CombinedCellEditor::Clone ( ) const
inlineoverridevirtual

Get a copy of this editor instance.

Returns
wxGridCellEditor*

Definition at line 750 of file cellattributes.hpp.

References CombinedCellEditor(), and m_grid.

Here is the call graph for this function:

◆ Create()

virtual void CombinedCellEditor::Create ( wxWindow *  parent,
wxWindowID  id,
wxEvtHandler *  evtHandler 
)
inlineoverridevirtual

Create the necessary edit controls.

Parameters
parentwxWindow*
idwxWindowID
evtHandlerwxEvtHandler*
Returns
void

Definition at line 340 of file cellattributes.hpp.

References m_checkBox, m_comboBox, m_text, and OnEnterKey().

Here is the call graph for this function:

◆ EndEdit()

virtual bool CombinedCellEditor::EndEdit ( int  row,
int  col,
const wxGrid *  grid,
const wxString &  oldval,
wxString *  newval 
)
inlineoverridevirtual

End the editing process. Will store the value of the edit control internally and reset the edit control to its original state.

Parameters
rowint
colint
gridconst wxGrid*
oldvalconst wxString&
newvalwxString*
Returns
bool

Definition at line 519 of file cellattributes.hpp.

References m_checkBox, m_comboBox, m_finished, m_text, m_value, and toString().

Here is the call graph for this function:

◆ finalize()

void CombinedCellEditor::finalize ( bool  moveCursor)
inlineprotected

Inform the grid to finalize the editing process.

Parameters
moveCursorbool
Returns
void

Definition at line 934 of file cellattributes.hpp.

References m_grid.

Referenced by OnEnterKey(), and StartingClick().

◆ GetValue()

virtual wxString CombinedCellEditor::GetValue ( ) const
inlineoverridevirtual

Get the value stored in this editor.

Returns
wxString

Definition at line 761 of file cellattributes.hpp.

References m_value.

◆ HandleReturn()

virtual void CombinedCellEditor::HandleReturn ( wxKeyEvent &  event)
inlineoverridevirtual

We do not handle the return key as a character.

Parameters
eventwxKeyEvent&
Returns
virtual void

Definition at line 739 of file cellattributes.hpp.

◆ IsAcceptedKey()

virtual bool CombinedCellEditor::IsAcceptedKey ( wxKeyEvent &  event)
inlineoverridevirtual

Determine, whether the pressed key is accepted by this editor and will start the editing process.

Parameters
eventwxKeyEvent&
Returns
bool

Definition at line 403 of file cellattributes.hpp.

◆ OnEnterKey()

void CombinedCellEditor::OnEnterKey ( wxCommandEvent &  event)
inlineprotected

Respond to ENTER key events created by the combo box control.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 921 of file cellattributes.hpp.

References finalize().

Referenced by Create().

Here is the call graph for this function:

◆ PaintBackground()

virtual void CombinedCellEditor::PaintBackground ( wxDC &  dc,
const wxRect &  rectCell,
const wxGridCellAttr &  attr 
)
inlineoverridevirtual

Paint the background.

Parameters
dcwxDC&
rectCellconst wxRect&
attrconst wxGridCellAttr&
Returns
void

Definition at line 389 of file cellattributes.hpp.

◆ Reset()

virtual void CombinedCellEditor::Reset ( )
inlineoverridevirtual

Reset the control to its initial state.

Returns
void

Definition at line 593 of file cellattributes.hpp.

References m_checkBox, m_comboBox, m_text, and m_value.

Referenced by BeginEdit(), and StartingKey().

◆ SetCheckBoxSize()

void CombinedCellEditor::SetCheckBoxSize ( const wxRect &  _rect)
inlineprotected

Set size and position of the check box.

Parameters
_rectconst wxRect&
Returns
void

Definition at line 854 of file cellattributes.hpp.

References m_checkBox.

Referenced by SetSize().

◆ SetSize()

virtual void CombinedCellEditor::SetSize ( const wxRect &  _rect)
inlineoverridevirtual

Set size and position of the controls.

Parameters
_rectconst wxRect&
Returns
void

Definition at line 374 of file cellattributes.hpp.

References SetCheckBoxSize(), and SetTextCtrlSize().

Here is the call graph for this function:

◆ SetTextCtrlSize()

void CombinedCellEditor::SetTextCtrlSize ( const wxRect &  _rect)
inlineprotected

Set the size and position of the text control and the combo box.

Parameters
_rectconst wxRect&
Returns
void

Definition at line 809 of file cellattributes.hpp.

References m_comboBox, and m_text.

Referenced by SetSize().

◆ Show()

virtual void CombinedCellEditor::Show ( bool  show,
wxGridCellAttr *  attr = nullptr 
)
inlineoverridevirtual

Show or hide the edit control. Will in fact only hide the controls. Showing them is done in BeginEdit.

Parameters
showbool
attrwxGridCellAttr*
Returns
void

Definition at line 776 of file cellattributes.hpp.

References m_checkBox, m_comboBox, and m_text.

◆ StartingClick()

virtual void CombinedCellEditor::StartingClick ( )
inlineoverridevirtual

Called after BeginEdit if the user clicked on this cell to handle the click event.

Returns
void

Definition at line 617 of file cellattributes.hpp.

References finalize(), and m_checkBox.

Here is the call graph for this function:

◆ StartingKey()

virtual void CombinedCellEditor::StartingKey ( wxKeyEvent &  event)
inlineoverridevirtual

Called after BeginEdit to give this control the possibility to respond to the initial key.

Parameters
eventwxKeyEvent&
Returns
void

Definition at line 635 of file cellattributes.hpp.

References m_checkBox, m_comboBox, m_text, m_value, Reset(), and StartingKey().

Referenced by StartingKey().

Here is the call graph for this function:

Member Data Documentation

◆ m_checkBox

wxCheckBox* CombinedCellEditor::m_checkBox
protected

◆ m_comboBox

wxComboBox* CombinedCellEditor::m_comboBox
protected

Definition at line 796 of file cellattributes.hpp.

Referenced by BeginEdit(), Create(), EndEdit(), Reset(), SetTextCtrlSize(), Show(), and StartingKey().

◆ m_finished

bool CombinedCellEditor::m_finished
protected

Definition at line 799 of file cellattributes.hpp.

Referenced by BeginEdit(), and EndEdit().

◆ m_grid

wxGrid* CombinedCellEditor::m_grid
protected

Definition at line 797 of file cellattributes.hpp.

Referenced by Clone(), and finalize().

◆ m_text

wxTextCtrl* CombinedCellEditor::m_text
protected

Definition at line 794 of file cellattributes.hpp.

Referenced by BeginEdit(), Create(), EndEdit(), Reset(), SetTextCtrlSize(), Show(), and StartingKey().

◆ m_value

wxString CombinedCellEditor::m_value
protected

Definition at line 798 of file cellattributes.hpp.

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


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