Discussion:
Getting to wxAuiTabCtrl through public methods
p***@gmail.com
2014-03-18 17:10:14 UTC
Permalink
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.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
p***@gmail.com
2014-04-13 04:47:42 UTC
Permalink
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.
Post by p***@gmail.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.
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.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
p***@gmail.com
2014-04-13 04:54:11 UTC
Permalink
Post by p***@gmail.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.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...