#include <grid_combobox.h>
|
| GRID_CELL_COMBOBOX (const wxArrayString &names) |
|
wxGridCellEditor * | Clone () const override |
|
void | Create (wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override |
|
wxString | GetValue () const override |
|
void | SetSize (const wxRect &aRect) override |
|
void | BeginEdit (int aRow, int aCol, wxGrid *aGrid) override |
|
bool | EndEdit (int aRow, int aCol, const wxGrid *, const wxString &, wxString *aNewVal) override |
|
void | ApplyEdit (int aRow, int aCol, wxGrid *aGrid) override |
|
void | Reset () override |
|
Definition at line 35 of file grid_combobox.h.
◆ GRID_CELL_COMBOBOX()
GRID_CELL_COMBOBOX::GRID_CELL_COMBOBOX |
( |
const wxArrayString & |
names | ) |
|
◆ ApplyEdit()
void GRID_CELL_COMBOBOX::ApplyEdit |
( |
int |
aRow, |
|
|
int |
aCol, |
|
|
wxGrid * |
aGrid |
|
) |
| |
|
override |
◆ BeginEdit()
void GRID_CELL_COMBOBOX::BeginEdit |
( |
int |
aRow, |
|
|
int |
aCol, |
|
|
wxGrid * |
aGrid |
|
) |
| |
|
override |
Definition at line 75 of file grid_combobox.cpp.
76{
77 auto evtHandler = static_cast<wxGridCellEditorEvtHandler*>( m_control->GetEventHandler() );
78
79
80 evtHandler->SetInSetFocus( true );
81
82
85
86 m_value = aGrid->GetTable()->GetValue( aRow, aCol );
87
89
90
92
95
96#ifdef __WXOSX_COCOA__
97
98
99
100
102#endif
103
104
105
106#if !defined(__WXGTK20__)
107 evtHandler->SetInSetFocus( false );
108#endif
109}
void onComboDropDown(wxCommandEvent &aEvent)
void onComboCloseUp(wxCommandEvent &aEvent)
wxComboBox * Combo() const
References Combo(), m_value, onComboCloseUp(), and onComboDropDown().
◆ Clone()
wxGridCellEditor * GRID_CELL_COMBOBOX::Clone |
( |
| ) |
const |
|
override |
◆ Combo()
wxComboBox * GRID_CELL_COMBOBOX::Combo |
( |
| ) |
const |
|
inlineprotected |
◆ Create()
void GRID_CELL_COMBOBOX::Create |
( |
wxWindow * |
aParent, |
|
|
wxWindowID |
aId, |
|
|
wxEvtHandler * |
aEventHandler |
|
) |
| |
|
override |
Definition at line 49 of file grid_combobox.cpp.
50{
51 m_control = new wxComboBox( aParent, wxID_ANY, wxEmptyString,
52 wxDefaultPosition, wxDefaultSize,
m_names );
53
54 wxGridCellEditor::Create(aParent, aId, aEventHandler);
55}
References m_names.
◆ EndEdit()
bool GRID_CELL_COMBOBOX::EndEdit |
( |
int |
aRow, |
|
|
int |
aCol, |
|
|
const wxGrid * |
, |
|
|
const wxString & |
, |
|
|
wxString * |
aNewVal |
|
) |
| |
|
override |
Definition at line 112 of file grid_combobox.cpp.
113{
114 const wxString value =
Combo()->GetValue();
115
117 return false;
118
120
121 if( aNewVal )
122 *aNewVal = value;
123
124 return true;
125}
References Combo(), and m_value.
◆ GetValue()
wxString GRID_CELL_COMBOBOX::GetValue |
( |
| ) |
const |
|
override |
◆ onComboCloseUp()
void GRID_CELL_COMBOBOX::onComboCloseUp |
( |
wxCommandEvent & |
aEvent | ) |
|
|
protected |
Definition at line 149 of file grid_combobox.cpp.
150{
151 auto evtHandler = static_cast<wxGridCellEditorEvtHandler*>( m_control->GetEventHandler() );
152
153
154
155
156 wxFocusEvent event( wxEVT_KILL_FOCUS, m_control->GetId() );
157 event.SetEventObject( m_control );
158 evtHandler->ProcessEvent( event );
159}
Referenced by BeginEdit().
◆ onComboDropDown()
void GRID_CELL_COMBOBOX::onComboDropDown |
( |
wxCommandEvent & |
aEvent | ) |
|
|
protected |
Definition at line 139 of file grid_combobox.cpp.
140{
141 auto evtHandler = static_cast<wxGridCellEditorEvtHandler*>( m_control->GetEventHandler() );
142
143
144
145 evtHandler->SetInSetFocus( false );
146}
Referenced by BeginEdit().
◆ Reset()
void GRID_CELL_COMBOBOX::Reset |
( |
| ) |
|
|
override |
◆ SetSize()
void GRID_CELL_COMBOBOX::SetSize |
( |
const wxRect & |
aRect | ) |
|
|
override |
Definition at line 62 of file grid_combobox.cpp.
63{
64 wxRect rect( aRect );
65 rect.Inflate( -1 );
66
67#if defined( __WXMAC__ )
68 rect.Inflate( 3 );
69#endif
70
71 Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE );
72}
References Combo().
◆ wxDECLARE_NO_COPY_CLASS()
◆ m_names
wxArrayString GRID_CELL_COMBOBOX::m_names |
|
protected |
◆ m_value
wxString GRID_CELL_COMBOBOX::m_value |
|
protected |
The documentation for this class was generated from the following files: