Page 2 of 3

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 11:07
by Das Bruce
Ok, next question. How do I nest wxnotebooks? I was trying to figure it out from a wx.python example but his explaination of "Create a panel with a notebook on it, and make that panel into a tab on the main notebook" is insufficient.

Code: Select all

wxPanel *pnlSMD = new wxPanel(notebook, -1);    
nbSMD = new wxNotebook(pnlSMD, wxID_ANY);
notebook->AddPage(pnlSMD, "SMD", true);
Gives my only a small grey square in the top left corner. notebook is my main wxNoteBook and nbSMD is my nested one.

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 11:16
by koshi
You only created the nested book with the panel as parent, try something like

Code: Select all

wxPanel *pnlSMD = new wxPanel(notebook, -1);   
nbSMD = new wxNotebook(pnlSMD, wxID_ANY);
wxBoxSizer* box = new wxBoxSizer( WX_HORIZONTAL );
box->Add( nbSMD, 1, wxEXPAND, 0 );
pnlSMD->SetSizer( box );
pnlSMD->Layout();
notebook->AddPage(pnlSMD, "SMD", true);

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 11:37
by Das Bruce
Thanks.

So my problem was I was creating the subnotebook but it wasn't expanding to fill the allotted panel, so I had to create an expanding sizer to sort of drag it out?

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 11:44
by koshi
that and the subnotebook was not placed 'on' any panel/frame

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 12:58
by Das Bruce
Now that's working, with a basic layout in the new tab, but switching main tabs causes the contents of the subtabs to disappear, however it reappears when I switch between the subtabs. Is there something I can call on the wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED message to refresh the contents?

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:01
by koshi
wxWindow::Refresh() forcefully repaints the window it's called on
However that should not really be necessary. Are you hosting your code somewhere I could take a look at?

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:12
by Das Bruce
It's my first wxwidgets experience so I'd hardly call it fit for public consumption.

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:15
by koshi
getting nothing but data errors on extracting, could you try plain zip or gzip?

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:22
by Das Bruce
FFS, my connection has been unreliable but this is ridiculous. Do you mind pastebin?

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:23
by koshi
sure, go ahead

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:36
by Das Bruce
Ok.
main.cpp http://pastebin.com/m316dd7f9
main.h http://pastebin.com/m16c4d693
wxwfrontend.h http://pastebin.com/m39ef95d7
wxwfrontend.cpp http://pastebin.com/m61f8b315
wxwfrontendopen.cpp http://pastebin.com/m41f84579
wxwfrontendcompile.cpp http://pastebin.com/m29eb84f5
resources.h http://pastebin.com/m4740797a
resource.rc is just #include <wx/msw/wx.rc>

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:44
by koshi
At a quick glance I saw nothing totally off.
You should however put your strings in approp. macros _ or _T so the compile will not fail on non-ANSI wx builds.
More when I got time to compile this, later today/tomorrow

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 13:52
by Das Bruce
I was working under the impression that _T and wxT were the same.

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 14:03
by koshi
check where you build the command string, that's not macro wrapped

edit: yes, they are in current

Code: Select all

#define wxT(x)       _T(x)

Re: Bruce <3's wxWidgets

Posted: 16 Jan 2010, 14:11
by Das Bruce
Fixed.
2am = bedtime.

Re: Bruce <3's wxWidgets

Posted: 19 Jan 2010, 11:34
by Das Bruce
Hmm, perhaps it is something to do with the order I'm creating things? Building to debug gives me this error.
error.PNG
(15.18 KiB) Downloaded 1 time

Re: Bruce <3's wxWidgets

Posted: 22 Jan 2010, 15:06
by koshi
Every tab needs to have the notebook as parent.

I went ahead and got you a cmake buildsystem:
http://springlobby.info/cgit.cgi/koshi/wxmapconv.git/
It is trimmed down from SL's, so there might be some references to it I've missed. I did not much try to use it yet, since that repo only has what you pastebinned and that won't build on unicode wx and I'm too lazy to build ansi wx.

Edit: I've also pushed the repo to http://github.com/springlobby/wxmapconv for easy forking

Re: Bruce <3's wxWidgets

Posted: 23 Jan 2010, 00:04
by Das Bruce
Sweet, as soon as I fix one little syntax issue I'll upload the new source. There are a few things I want to try but currently build time is up to 10 minutes on this machine so serious work will have to wait until I'm back at home.

Re: Bruce <3's wxWidgets

Posted: 23 Jan 2010, 13:10
by koshi
That sounds like a 486 ;-)

How are the chances of you continuing your work in a git (svn/bzr/hg) repo? Would make sharing stuff so much easier. Hosting I could provide (for git/svn) as well as buildbot and issue tracker.

Re: Bruce <3's wxWidgets

Posted: 23 Jan 2010, 14:00
by Das Bruce
Sounds fine I suppose, not sure if it's worth the bandwidth, this is just a stepping stone to bigger, buggier hackjobs. And it won't be happening until late February when I head back down to uni.