[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi] Switching between wxNotebook and wxListbook
From: |
Greg Chicares |
Subject: |
[lmi] Switching between wxNotebook and wxListbook |
Date: |
Thu, 20 Jul 2006 00:24:25 +0000 |
User-agent: |
Thunderbird 1.5.0.4 (Windows/20060516) |
Vadim--I've succeeded in switching between different book controls
at run time. This is a very nice capability. Some of the things I
did seem dubious, so I'd like to ask your advice.
1. Two simple text replacements:
s/wxNotebook/wxBookCtrlBase/g
s/#include <wx/notebook.h>/#include <wx/bookctrl.h>/
across all my '*.?pp' files were nearly sufficient. The only problem
I encountered was that there is no
typedef wxWindow wxBookCtrlBasePage;
corresponding to wxNotebookPage. However, it seems strange to use an
undocumented wx base class directly--I'd avoid using wxWindowBase,
for example. Is it a bad idea to use wxBookCtrlBase in user code?
Is there a better way? Of course, wxBookCtrl isn't the right way:
it's a macro for a derived class, not a common base class.
2. In an '.xrc' file, I had to change
s/class="wxNotebook"/class="wxListbook"/
as expected, but I also had to change
s/class="notebookpage"/class="listbookpage"/
which seems inconvenient. Shouldn't there be a 'class' that works
for both? I tried 'class="wxWindow"', but that didn't work at all.
3. BTW, I notice that I've got this line
<usenotebooksizer>1</usenotebooksizer>
in the '.xrc' file. As with 'class="notebookpage"', I imagine that
I just copied this from some wx example years ago; does it actually
do anything? I don't observe any difference in program behavior if
I remove this line.
4. The wxListCtrl doesn't seem to size itself automatically to make
its contents fit, even if I widen the dialog. I'll email you a tiny
'.png' that shows this. I thought this might be a wxSplitterWindow
but couldn't find a "sash" to drag. Shouldn't wxxrc resize this?
- [lmi] Switching between wxNotebook and wxListbook,
Greg Chicares <=