Hi,
Been fighting with this one on and off for the last couple weeks and
am at a bit of a loss. When an aui notebook has been split I was
running into issues where the right click event was returning the
wrong tab index. In the attached sample app have tracked it down an
anomaly where in depending upon where the event is bound wx is
delivering different coords to the event handler.
If the event handler for EVT_AUINOTEBOOK_TAB_RIGHT_UP is bound
directly to the notebook control it will return the wrong index in
some cases after the book has been split, however if the handler is
bound to the notebooks parent then it works correctly.
To reproduce in the attached sample: (Windows 7, wx2.9.2.4)
1) Run it
2) Drag Page 3 to the right to split the notebook in two
3) right click on Page 3
4) Observe the correct index / label printed to the console
5) Close it
6) Comment out the event binding to the WrapPanel class, and
un-comment the binding/handler in the MyBook class
7) Repeat step 1-3
8) Observe it now reports Page 0 as being clicked on.
Debugging into the auibook code shows that the mouse coords sent to
the control in its handler for the mouse event are different in these
two cases. In the case of being bound directly to the notebook it
appears the coords are in client coords for two separate windows where
as for when bound to the parent the coords appear as the "two"
notebooks are one window.
Any thoughts / ideas?
Thanks,
Cody
aui_nb_index.py (2.74 KB)