Getting to wxAuiTabCtrl through public methods

103 views
Skip to first unread message

paulc...@gmail.com

unread,
Mar 18, 2014, 1:10:14 PM3/18/14
to wx-u...@googlegroups.com
Hi All,

I'm using wxlua API that is wrapped around wxwidgets and as such am limited to only using public methods. I've been looking for a way to get access to wxAuiTabCtrl class and don't see a way to do this.

It seems like a straightforward approach would be (Lua code):

nbmgr = notebook:GetAuiManager()
panes = nbmgr:GetAllPanes()
tabframe = panes:Item(1).window:DynamicCast("wxTabFrame")

Unfortunately this fails as wxTabFrame is not defined in the interface (.h file). Would it be possible to split wxTabFrame interface/implementation in auibook.cpp into interface and implementation parts?

It may also be helpful to make wxAuiNotebook::FindTab public instead of protected as it provides an alternative way of getting to wxAuiTabCtrl for a particular page.

Paul.

paulc...@gmail.com

unread,
Apr 13, 2014, 12:47:42 AM4/13/14
to wx-u...@googlegroups.com
I'd like to come back to this, as I have not been able to find any workaround and am still stuck with getting access to wxAuiTabCtrl. It's needed for several reasons (for example, I'd like to have an event handler for the windowlist button), but the only way for me to get wxAuiTabCtrl is to intercept one of tab events that include wxAuiTabCtrl in the event object. It's obviously not acceptable as it require a specific user action.

Would it be possible to do the following:

1. move wxTabFrame definition into a separate .h file. This will allow those bindings that use interfaces (wxlua is one example) to provide access to the public methods of that class, which will allow to access wxAuiTabCtrl instances.

2. move the following two calls from "protected" to "public":

    wxAuiTabCtrl* GetActiveTabCtrl();
    bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx);

I can open a ticket and provide patch(es), but wanted to check first if there is any valid reason to not do this. Thank you.

Paul.

paulc...@gmail.com

unread,
Apr 13, 2014, 12:54:11 AM4/13/14
to wx-u...@googlegroups.com
> 1. move wxTabFrame definition into a separate .h file.

To correct myself: not a separate file, but move it from auibook.cpp to auibook.h, so should be a very minor change.

Paul.

Reply all
Reply to author
Forward
0 new messages