Ticket #14792 (closed enhancement: fixed)

Opened 7 months ago

Last modified 7 months ago

wxGenericDirCtrl selected event EVT_DIRCTRL_CHANGED()

Reported by: troelsk Owned by:
Priority: normal Milestone:
Component: GUI-generic Version: 2.9-svn
Keywords: wxGenericDirCtrl Cc:
Blocked By: Patch: yes
Blocking:

Description

Currently it is not obvious how to/that you can get selection events (from the tree control embedded inside wxGenericDirCtrl)
Patch: Make it obvious

Attachments

event.patch download (4.2 KB) - added by troelsk 7 months ago.
Trunk
event2.patch download (0.8 KB) - added by troelsk 7 months ago.
Event details

Change History

Changed 7 months ago by troelsk

Trunk

Changed 7 months ago by vadz

  • status changed from new to confirmed

Nice, thanks, I'll commit it soon.

But currently the event is sent even for the changes done by the program (which, BTW, resulted in a crash on startup of the widgets sample if the wxDirCtrl page was the initially selected one, as we received an event before m_dirCtrl was initialized). I'm not sure if it's really a good idea, perhaps the code of the control should be modified to ignore the changes from the program itself?

Changed 7 months ago by VZ

  • status changed from confirmed to closed
  • resolution set to fixed

(In [72842]) Added wxEVT_COMMAND_DIRCTRL_CHANGED for wxDirCtrl selection changes.

This makes it much simpler to react to the changes in the control, update the
sample to show it.

Closes #14792.

Changed 7 months ago by troelsk

Great, thanks.

Not something I need myself, but maybe Veto() should be taken into account,

wxGenericDirCtrl::OnTreeSelChange()
{
    ....
    if (changedEvent.IsAllowed())
    {
        event.Skip();
    }
    else
    {
        event.Veto();
    }
}

Changed 7 months ago by troelsk

Event details

Changed 7 months ago by troelsk

Argh, also forget SetEventObject(). Added patch.

Changed 7 months ago by VZ

(In [72912]) Minor improvements to wxEVT_COMMAND_DIRCTRL_CHANGED generation.

Set the event object for this event. Also don't skip the original tree event
if the wxEVT_COMMAND_DIRCTRL_CHANGED event was handled and disallowed.

Closes #14792.

Note: See TracTickets for help on using tickets.