wxTreeCtrl question

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
ninja9578
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 236
Joined: Thu Jan 29, 2009 3:33 pm

wxTreeCtrl question

Post by ninja9578 » Fri Oct 02, 2009 9:18 pm

Is there a way to determine if a EVT_TREE_SEL_CHANGED event is a selection or an expansion? I want different behavior if a user clicked on the title then if they clicked on the expand button. I also have my code capturing the EVT_TREE_ITEM_EXPANDING event.

van_user
Experienced Solver
Experienced Solver
Posts: 55
Joined: Wed Jun 11, 2008 9:28 pm
Location: UA

Post by van_user » Sat Oct 03, 2009 6:10 am

Maybe you should calculate position of the mouse and check is button under cursor?
I doubt it is possible to know in EVT_TREE_SEL_CHANGED what focus is on child control.

illnatured
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 234
Joined: Mon May 08, 2006 12:31 pm
Location: Krakow, Poland

Post by illnatured » Sat Oct 03, 2009 8:05 am

I would use the wxTreeCtrl::HitTest method.
VC++ 2005 / Windows XP / wxWidgets 2.8.9

Post Reply