wxNotebook Event Questions (revisited)

I am having a similar issue trying to drag something onto a notebook tab. I
thought there should be a solution along the following lines, which I hope
makes some sense.

Since it is possible to catch a mouse event like EVT_LEFT_UP that takes
place over a notebook tab, I thought that I could then generate an
EVT_LEFT_DOWN at that position by creating the appropriate wxMouseEvent. My
theory was that the programmatically generated mousedown event would trigger
the notebook to change the selected page. Once the selected page changed,
you could determine the notebook page you had landed on with GetSelection().

While I can detect the mouse down event I've generated, the notebook does
not respond to it so there seems to be something wrong with the theory that
you can programmatically generate a left_mouse_button_down event on a
notebook tab that the notebook will respond to by changing the page.

If any of the above makes any sense, any tips or advice would be
appreciated.

···

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Wednesday, April 09, 2003 2:39 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] wxNotebook Event Questions

Shane Holloway (IEEE) wrote:

I want to accomplish a few things with a wxNotebook:
   * Reorder the notebook tabs with a mouse drag
   * Popup menu based on tab identity
   * Dock/Undock notebook tab contents with mouse drag

I am able to get all the standard mouse events, but I don't know how to
get a page index from the mouse position. I did not see a method on
wxNotebook. Am I missing the boat? If not, can this functionality be
exposed in the next release?

There isn't any way to do this now, and Im not sure if it is even
possible at the platform level for all the platforms. You can enter a
feature request though and maybe if someone knows better then it will be
done.

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

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org

Zatz, Steve wrote:

I am having a similar issue trying to drag something onto a notebook tab. I
thought there should be a solution along the following lines, which I hope
makes some sense.

Since it is possible to catch a mouse event like EVT_LEFT_UP that takes
place over a notebook tab, I thought that I could then generate an
EVT_LEFT_DOWN at that position by creating the appropriate wxMouseEvent. My
theory was that the programmatically generated mousedown event would trigger
the notebook to change the selected page. Once the selected page changed,
you could determine the notebook page you had landed on with GetSelection().

While I can detect the mouse down event I've generated, the notebook does
not respond to it so there seems to be something wrong with the theory that
you can programmatically generate a left_mouse_button_down event on a
notebook tab that the notebook will respond to by changing the page.

Generating and sending a wxEvent only sends it to the wx classes that are involved. The event does not get converted to a platform specific message and passed to the native widget. (Because normally the messages are coming *from* the platform and getting converted to wxEvents. Allowing the opposite for all event types would at least double the complexity of the library.)

···

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