wxNotebook Event Questions (revisited)

Robin,

Thanks for the explanation. I have gone to Plan Z, which is to capture the
LEFT_UP at the end of the mouse drag and calculate the notebook tab it
occurred over based on the position of the event. Works well on platforms
that provide a uniform fixed tab width option, but even then if you have
more tabs than can be shown without scrolling it fails since a given x
position is no longer uniquely associated with a specific tab. You can't
have everything. Thanks again for your help.

Steve

ยทยทยท

-----Original Message-----
From: Robin Dunn [mailto:robin@alldunn.com]
Sent: Thursday, May 15, 2003 1:27 PM
To: wxPython-users@lists.wxwindows.org
Subject: Re: [wxPython-users] wxNotebook Event Questions (revisited)

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!

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