Hi,
I'm Creating multiple wxDataViewCtrl in the runtime. How to handle events for them?.
I'm unable to use EVT_COMMAND_RANGE for handling multiple wxDataViewCtrl event.
EVT_COMMAND_RANGE for wxDataViewCtrl Events? Topic is solved
-
- Experienced Solver
- Posts: 57
- Joined: Wed Feb 25, 2015 2:09 pm
- Location: Chennai, India
EVT_COMMAND_RANGE for wxDataViewCtrl Events?
Got a Problem???..No worry..Focus on Solution not on Problem
Re: EVT_COMMAND_RANGE for wxDataViewCtrl Events?
EVT_COMMAND_RANGE is used for something else, e.g. if you want to catch a button click event for a range of IDs like 1000-2000.
What exactly is your problem?
What exactly is your problem?
Use the source, Luke!
-
- Experienced Solver
- Posts: 57
- Joined: Wed Feb 25, 2015 2:09 pm
- Location: Chennai, India
Re: EVT_COMMAND_RANGE for wxDataViewCtrl Events?
i want to catch EVT_DATAVIEW_ITEM_CONTEXT_MENU event which is part of wxDataViewCtrl for multiple times
Got a Problem???..No worry..Focus on Solution not on Problem
Re: EVT_COMMAND_RANGE for wxDataViewCtrl Events?
If you use wxID_ANY as id in the event table macro, it's valid for all wxDataViewCtrl instances.
Inside the event handler you can get a pointer to the correct instance using wxEvent::GetEventObject().
Inside the event handler you can get a pointer to the correct instance using wxEvent::GetEventObject().
Code: Select all
wxDataViewCtrl *my_control = wxDynamicCast( evt.GetEventObject(), wxDataViewCtrl )
if( my_control != NULL )
{
// your code here
}
Use the source, Luke!