[ wxwindows-Bugs-1516736 ] Veto() of EVT_TREE_SEL_CHANGING doesn't work

SourceForge.net noreply at sourceforge.net
Mon Jul 3 21:00:46 PDT 2006


Bugs item #1516736, was opened at 2006-07-04 11:00
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1516736&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxMSW specific
Group: Platform specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Halbakken (dhalbakken)
Assigned to: Nobody/Anonymous (nobody)
Summary: Veto() of EVT_TREE_SEL_CHANGING doesn't work

Initial Comment:
I added code to treectrl.cpp method 
wxTreeCtrl::MSWWindowProc() at line 2376 so that 
EVT_TREE_SEL_CHANGING gets called to be sure that the 
selection change is allowed. Code reads like this:

                            if (!IsItemSelected
(GetHwnd(), htItem))
                            {
                                wxTreeEvent event
(wxEVT_COMMAND_TREE_SEL_CHANGING, GetId());
                                event.SetEventObject( 
this );
                                GetEventHandler()-
>ProcessEvent( event );
                                if(event.IsAllowed())
                                {
                                    UnselectAll();

                                // prevent the click 
from starting in-place editing
                                // which should only 
happen if we click on the
                                // already selected 
item (and nothing else is
                                // selected)

                                    
TreeView_SelectItem(GetHwnd(), 0);
                                   ::SelectItem
(GetHwnd(), htItem);
                                }

I'm not sure if this is the right way to solve the 
problem, but it seems to work for me.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1516736&group_id=9863




More information about the wx-dev mailing list