54 m_control =
new wxComboBox( aParent, wxID_ANY, wxEmptyString,
55 wxDefaultPosition, wxDefaultSize,
m_names );
57 wxGridCellEditor::Create(aParent, aId, aEventHandler);
63 return Combo()->GetValue();
72#if defined( __WXMAC__ )
76 Combo()->SetSize( rect, wxSIZE_ALLOW_MINUS_ONE );
82 auto evtHandler =
static_cast<wxGridCellEditorEvtHandler*
>( m_control->GetEventHandler() );
85 evtHandler->SetInSetFocus(
true );
91 m_value = aGrid->GetTable()->GetValue( aRow, aCol );
101#ifdef __WXOSX_COCOA__
111#if !defined(__WXGTK__)
112 evtHandler->SetInSetFocus(
false );
119 const wxString value =
Combo()->GetValue();
135 aGrid->GetTable()->SetValue( aRow, aCol,
m_value );
146 auto evtHandler =
static_cast<wxGridCellEditorEvtHandler*
>( m_control->GetEventHandler() );
150 evtHandler->SetInSetFocus(
false );
156 auto evtHandler =
static_cast<wxGridCellEditorEvtHandler*
>( m_control->GetEventHandler() );
161 wxFocusEvent event( wxEVT_KILL_FOCUS, m_control->GetId() );
162 event.SetEventObject( m_control );
163 evtHandler->ProcessEvent( event );
bool EndEdit(int aRow, int aCol, const wxGrid *, const wxString &, wxString *aNewVal) override
void onComboDropDown(wxCommandEvent &aEvent)
GRID_CELL_COMBOBOX(const wxArrayString &names)
~GRID_CELL_COMBOBOX() override
void Create(wxWindow *aParent, wxWindowID aId, wxEvtHandler *aEventHandler) override
void onComboCloseUp(wxCommandEvent &aEvent)
wxString GetValue() const override
void BeginEdit(int aRow, int aCol, wxGrid *aGrid) override
wxComboBox * Combo() const
void SetSize(const wxRect &aRect) override
void ApplyEdit(int aRow, int aCol, wxGrid *aGrid) override
wxGridCellEditor * Clone() const override