Hello:
How could I use wxAuiNotebook:Split() to get four tabs one in each corner.
With the following code I cant get exactly that
splits = {false,wx.wxRIGHT,wx.wxBOTTOM,wx.wxRIGHT}
Log = {}
for i=1,4 do
Log[i] = CreateLog()
notebookLogs:AddPage(Log[i], "Log"..i)
if splits[i] then
notebookLogs:Split(notebookLogs:GetPageIndex(Log[i]),splits[i])
end
end
Best Regards
victor bombi
On Mon, Oct 21, 2013 at 2:01 PM, Victor Bombi <so...@te...> wrote: > Hello: > > How could I use wxAuiNotebook:Split() to get four tabs one in each corner. > > I think you may need to insert a page into the beginning to get that last split. Add three pages, split into three parts. That part is straightforward, but to get that last split you probably need to insert a page before/after the single half-page then split that to get four quarter-pages. Regards, John
Sorry, I dont understand!! :-( Could you please explain it with code? With my last code I get: 1 2 4 3 3 4 instead of 1 2 3 4 I am trying to improve loadNotebook and saveNotebook (for saving notebook perspectives in Zerobrane studio) to save 2D layouts instead of of just 1D. I looked at void wxAuiNotebook::Split in auibook.cpp but it uses classes I cant reach (as wxTabFrame) and function FindTab which depends on wxTabFrame also. Thank you very much. victor ----- Original Message ----- From: John Labenski To: wxl...@li... Sent: Tuesday, October 22, 2013 4:28 AM Subject: Re: [wxlua-users] four tabs one in each corner withwxAuiNotebook:Split() On Mon, Oct 21, 2013 at 2:01 PM, Victor Bombi <so...@te...> wrote: Hello: How could I use wxAuiNotebook:Split() to get four tabs one in each corner. I think you may need to insert a page into the beginning to get that last split. Add three pages, split into three parts. That part is straightforward, but to get that last split you probably need to insert a page before/after the single half-page then split that to get four quarter-pages. Regards, John ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk ------------------------------------------------------------------------------ _______________________________________________ wxlua-users mailing list wxl...@li... https://lists.sourceforge.net/lists/listinfo/wxlua-users
On Tue, Oct 22, 2013 at 1:29 AM, Victor Bombi <so...@te...> wrote: > ** > Sorry, I dont understand!! :-( > Could you please explain it with code? > > Sorry I don't have time now, but I would try something like this: -- untested code notebook:AddPage(page1, "page1") notebook:AddPage(page2, "page2") notebook:AddPage(page3, "page3") notebook:Split(0, wx.wxRIGHT) -- now split in two, with one tab in left pane and two tabs in right pane notebook:Split(1, wx.wxBOTTOM) -- now split in 3, one tab on left pane and right has two panes, top and bottom notebook:InsertPage(0, page4, "page4") -- now have two tabs in left pane notebook:Split(0, wx.wxBOTTOM) -- now the left tabs are split vertically giving four panes with one tab in each pane. ------------- You might have to experiment with wxTOP vs. wxBOTTOM etc. Again, totally untested, but I played a little with the aui sample and got pretty close yesterday. John.
Hi John/Victor, I think I tried this method a while ago, but I couldn't make the forth tab to form a square: if you split it RIGHT, it would take its own column and if you split it BOTTOM, it would take its own row. It's possible to position them manually, but I couldn't find a way to do this programmatically (and there is no SavePerspective in wxAuiNotebook), so I put it on the back burner. I've seen suggested patches (like this one: http://www.kirix.com/forums/viewtopic.php?f=15&t=542#p1479), but they have never made it into the library. It *may* be possible to reproduce the same logic that is used when this is done manually, but unfortunately, I don't see a way to get access to wxAuiTabCtrl that is needed for this manipulation. John, a side note; it's a shame that there doesn't seem to be a way to get wxAuiTabCtrl from wxAuiNotebook. The only way I found was through capturing TAB events like wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP and then using event:GetEventObject():DynamicCast("wxAuiTabCtrl"), but this doesn't work in all other normal cases. I think I got close by using this sequence: nbmgr = notebook:GetAuiManager() -- note that wxAuiNotebook has its own AuiManager that manages its tabs as panes; you can actually save/restore its perspective this way, but it doesn't work in all cases. panes = nbmgr:GetAllPanes() tabframe = panes:Item(1).window:DynamicCast("wxTabFrame") -- this should work, but fails with "Cannot cast a wxLua type 'wxWindow' with wxClassInfo 'wxWindow' to a 'wxTabFrame'". It would be great to have access to FindTab, which returns both the tab control and tab index for the page in that control, but it's marked as protected: protected: bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx); What are your thoughts on exposing protected classes in the wxlua API? There are two more in that category wxStat and wxLstat that I'd love to have in wxlua. FWIW, you can actually play with this quite easily from Local console in ZBS; open four tabs and then try: > notebook = ide.frame.notebook > notebook:Split(0, wx.wxRIGHT) > notebook:Split(1, wx.wxBOTTOM) > notebook:Split(3, wx.wxRIGHT) You can also get access to AuiManager: mgr = ide.frame.uimgr. Paul.
On Wed, Oct 23, 2013 at 1:50 AM, Paul K <pau...@ya...> wrote: > Hi John/Victor, > > I've seen suggested patches (like this one: > http://www.kirix.com/forums/viewtopic.php?f=15&t=542#p1479), but they > have never made it into the library. It *may* be possible to reproduce > the same logic that is used when this is done manually, but > unfortunately, I don't see a way to get access to wxAuiTabCtrl that is > needed for this manipulation. > > I don't know why these patches never made it into wxWidgets, but earlier this year there was more talk about updating wxAui on the wx-dev mailing list and I think saving the perspective was part of it. I don't know what came of it though. John, a side note; it's a shame that there doesn't seem to be a way to > get wxAuiTabCtrl from wxAuiNotebook. The only way I found was through > If this is part of the C++ api I can add it for sure, it is? > panes = nbmgr:GetAllPanes() > tabframe = panes:Item(1).window:DynamicCast("wxTabFrame") -- this > should work, but fails with "Cannot cast a wxLua type 'wxWindow' with > wxClassInfo 'wxWindow' to a 'wxTabFrame'". > > It looks like wxTabFrame is not exposed though any header file. > It would be great to have access to FindTab, which returns both the > tab control and tab index for the page in that control, but it's > marked as protected: > > protected: > bool FindTab(wxWindow* page, wxAuiTabCtrl** ctrl, int* idx); > > What are your thoughts on exposing protected classes in the wxlua API? > There are two more in that category wxStat and wxLstat that I'd love > to have in wxlua. > > It is unfortunately not really possible to expose these in a generic way. wxLua can compile against a system installed copy of wxWidgets and we can't expect people to be able to change "protected:" to "public:". There really isn't a viable way to do this in C++ that isn't a complete hack that will just lead to frustrating people with compilation errors. A quick google search hints that wxPython has implemented this, how did they do it? Regards, John
Hello John >It looks like wxTabFrame is not exposed though any header file. It is defined in auibook.cpp:2799 (2.8.12) (should it be a header file?) victor
On Sun, Nov 17, 2013 at 12:57 PM, Victor Bombi <so...@te...>wrote: > Hello John > > >It looks like wxTabFrame is not exposed though any header file. > > It is defined in auibook.cpp:2799 (2.8.12) (should it be a header file?) > > > Probably, but there's not a lot we can do about it. Normal wxWidgets installs will not install the cpp files so there's no good way to find it and it doesn't look like you can #include it since it actually contains code and we'd get linker errors about duplicate functions. I do have a scheme that may work, but it is quite fragile. wxLua declares the wxTabFrame itself and we cross our fingers that it doesn't change too much. If it does then wxLua will become a mess of #if wxverX then declare one version, #else if wxverY then a different one, #else ... This is hacky to me and I really prefer to keep wxLua reasonably "clean", but in this case it may be unavoidable. Regards, John