how bind wxGridCellChoiceEditor with event

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Zertas
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Jan 22, 2018 5:03 pm

how bind wxGridCellChoiceEditor with event

Post by Zertas »

something

Code: Select all

 wxObj->Bind(wxEVT_CHANGE_CHOICE_EDITOR,&CLASS::func,this);
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: how bind wxGridCellChoiceEditor with event

Post by catalin »

Something like myGrid->GetXXXEditorXXX(...)->GetControl()->Bind(...)

But mind that
- the editor is most probably null until it is needed for the first time;
- it is very likely that not all cells have the same editor;
- you probably need wxEVT_COMBOBOX.
Zertas
In need of some credit
In need of some credit
Posts: 5
Joined: Mon Jan 22, 2018 5:03 pm

Re: how bind wxGridCellChoiceEditor with event

Post by Zertas »

catalin wrote:Something like myGrid->GetXXXEditorXXX(...)->GetControl()->Bind(...)

But mind that
- the editor is most probably null until it is needed for the first time;
- it is very likely that not all cells have the same editor;
- you probably need wxEVT_COMBOBOX.
grid->SetCellEditor(rows, 1, new wxGridCellChoiceEditor(3, features, false));

wxControl *wxControl1 = grid->GetCellEditor(0, 1)->GetControl();

GetControl() return nullptr
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: how bind wxGridCellChoiceEditor with event

Post by doublemax »

The actual control is only created when you start editing a cell and immediately destroyed afterwards.
Use the source, Luke!
Post Reply