wxAuiNotebook splitter sizer event

43 views
Skip to first unread message

ro...@uberware.net

unread,
May 12, 2018, 9:24:11 AM5/12/18
to wx-u...@googlegroups.com

Hi List

 

I use the wxAuiNotebook control with the ability to dynamically split the tabs into separate panes (wxAUI_NB_TAB_SPLIT), and I have found code that can save and load the layout perspective (https://forums.wxwidgets.org/viewtopic.php?t=21868)

 

The only issue I have at this point is that, while there is an event emitted when a user drags a tab around (wxEVT_AUINOTEBOOK_DRAG_DONE), there is no event when a user drags the splitter between two panes to resize them. This means I don’t have a way to get notified that the size has changed if the user resizes the panes without dragging the tabs to reorder or rearrange them.

 

The solution would be another event when the drag completes. To do this correctly, it seems that there should be some kind of wxEVT_AUINOTEBOOK_SPLITTER_SASH_POS_CHANGED event, or perhaps it can simply re-use the wxSplitterWindow events?

 

I’m curious what others think is the best approach. Thanks,

-robin

 

Robin Scher  |  Uberware  |  213.448.0443  |  ro...@uberware.net  |  www.uberware.net

 

Vadim Zeitlin

unread,
May 13, 2018, 8:04:43 AM5/13/18
to wx-u...@googlegroups.com
On Tue, 8 May 2018 16:43:48 -0700 wrote:

> I use the wxAuiNotebook control with the ability to dynamically split the
> tabs into separate panes (wxAUI_NB_TAB_SPLIT), and I have found code that
> can save and load the layout perspective
> (https://forums.wxwidgets.org/viewtopic.php?t=21868)
>
> The only issue I have at this point is that, while there is an event emitted
> when a user drags a tab around (wxEVT_AUINOTEBOOK_DRAG_DONE), there is no
> event when a user drags the splitter between two panes to resize them. This
> means I don't have a way to get notified that the size has changed if the
> user resizes the panes without dragging the tabs to reorder or rearrange
> them.

Yes, looking at wxAuiManager::DoEndResizeAction() it doesn't seem to send
any events currently, unfortunately. You might be able to catch wxEVT_SIZE
somewhere (e.g. in the page itself, which will be resized), but this isn't
the most straightforward way to do things, of course.

> The solution would be another event when the drag completes. To do this
> correctly, it seems that there should be some kind of
> wxEVT_AUINOTEBOOK_SPLITTER_SASH_POS_CHANGED event, or perhaps it can simply
> re-use the wxSplitterWindow events?

I think it would be better to use AUI-specific events, e.g.
wxEVT_AUINOTEBOOK_SPLITTER_{BEGIN,END,CANCEL}_DRAG as well as
wxEVT_AUINOTEBOOK_SPLITTER_DRAG_MOTION for consistency with the existing
events with the same names without the "SPLITTER" part. But, indeed, it
would seem to make sense to add these events.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Reply all
Reply to author
Forward
0 new messages