Flatnotebook drag'n'drop event?

Hello,

I’m using the Flatnotebook to switch between a number of pages. I would also like to be able to re-order the pages, by drag-n-dropping the pages, and get an event when it happens so I can update my data model.

From the code I can see that only these events are sent:

FlatNotebook Events:

wxEVT_FLATNOTEBOOK_PAGE_CHANGED: Event Fired When You Switch Page;

wxEVT_FLATNOTEBOOK_PAGE_CHANGING: Event Fired When You Are About To Switch Pages, But You Can Still “Veto” The Page Changing By Avoiding To Call event.Skip() In Your Event Handler;

wxEVT_FLATNOTEBOOK_PAGE_CLOSING: Event Fired When A Page Is Closing, But You Can Still “Veto” The Page Changing By Avoiding To Call event.Skip() In Your Event Handler;

wxEVT_FLATNOTEBOOK_PAGE_CLOSED: Event Fired When A Page Is Closed.

wxEVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU: Event Fired When A Menu Pops-up In A Tab.

Is there another way to detect when the order of pages changes??? (I tried setting a new DropTarget on the notebook widget but for some reason SetDropTarget had no effect). What is the right way to do this?

cheers, Morten

This e-mail is confidential, the property of NDS Ltd and intended for the addressee only. Any dissemination, copying or distribution of this message or any attachments by anyone other than the intended recipient is strictly prohibited. If you have received this message in error, please immediately notify the postmaster@nds.com and destroy the original message. Messages sent to and from NDS may be monitored. NDS cannot guarantee any message delivery method is secure or error-free. Information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. We do not accept responsibility for any errors or omissions in this message and/or attachment that arise as a result of transmission. You should carry out your own virus checks before opening any attachment. Any views or opinions presented are solely those of the author and do not necessarily represent those of NDS.

To protect the environment please do not print this e-mail unless necessary.

Perriard, Morten wrote:

Hello,
I'm using the Flatnotebook to switch between a number of pages. I would also like to be able to re-order the pages, by drag-n-dropping the pages, and get an event when it happens so I can update my data model.
  From the code I can see that only these events are sent:
# FlatNotebook Events:
# wxEVT_FLATNOTEBOOK_PAGE_CHANGED: Event Fired When You Switch Page;
# wxEVT_FLATNOTEBOOK_PAGE_CHANGING: Event Fired When You Are About To Switch Pages, But You Can Still "Veto" The Page Changing By Avoiding To Call event.Skip() In Your Event Handler;
# wxEVT_FLATNOTEBOOK_PAGE_CLOSING: Event Fired When A Page Is Closing, But You Can Still "Veto" The Page Changing By Avoiding To Call event.Skip() In Your Event Handler;
# wxEVT_FLATNOTEBOOK_PAGE_CLOSED: Event Fired When A Page Is Closed.
# wxEVT_FLATNOTEBOOK_PAGE_CONTEXT_MENU: Event Fired When A Menu Pops-up In A Tab.
Is there another way to detect when the order of pages changes??? (I tried setting a new DropTarget on the notebook widget but for some reason SetDropTarget had no effect). What is the right way to do this?

I also don't see any notifications for it, but you might be able to look at the notebook's PageContainer object and work things out from there.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!