EVT_COMMAND_RANGE for wxDataViewCtrl Events?  [SOLVED]

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.
nandakishore
Experienced Solver
Experienced Solver
Posts: 57
Joined: Wed Feb 25, 2015 2:09 pm
Location: Chennai, India

EVT_COMMAND_RANGE for wxDataViewCtrl Events?

Postby nandakishore » Tue Mar 10, 2015 11:23 am

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.
Got a Problem???..No worry..Focus on Solution not on Problem :P

User avatar
doublemax
Moderator
Moderator
Posts: 11386
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: EVT_COMMAND_RANGE for wxDataViewCtrl Events?

Postby doublemax » Tue Mar 10, 2015 11:41 am

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?
Use the source, Luke!

nandakishore
Experienced Solver
Experienced Solver
Posts: 57
Joined: Wed Feb 25, 2015 2:09 pm
Location: Chennai, India

Re: EVT_COMMAND_RANGE for wxDataViewCtrl Events?

Postby nandakishore » Tue Mar 10, 2015 12:28 pm

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 :P

User avatar
doublemax
Moderator
Moderator
Posts: 11386
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: EVT_COMMAND_RANGE for wxDataViewCtrl Events?  [SOLVED]

Postby doublemax » Tue Mar 10, 2015 12:35 pm

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().

Code: Select all

wxDataViewCtrl *my_control = wxDynamicCast( evt.GetEventObject(), wxDataViewCtrl )
if( my_control != NULL )
{
  // your code here
}
Use the source, Luke!


Return to “C++ Development”

Who is online

Users browsing this forum: No registered users and 13 guests