Hi Andrea,
Andrea Gavana wrote:
Hi All,
> Hi Tim,
>
>> is it possible to design my own AuiTabArt for wx.aui.AuiNotebook? I know
there are 2
>> preconfigured AuiTabArts (default and simple) but I'd like to have something
more
>> colourful or with free scalable angles.
>> I guess I have to inherit from PyAuiTabArt and use the DrawTab() function,
but I don't
>> know exactly how to implement this. Is there any documentation to this topic?
Or has
>> anybody done this before? I thought about something like the FlatNotebook
from Andrea.
>
> I did some work in the past weeks to create new tab arts for AUINotebook.. What
I did was based on FlatNotebook tab styles, but they are still not ready to be
shared with the wxPython community. I'll see if I can polish them and post them
somewhere.
It looks like my other e-mail got eaten by some internet monster...
I have actually tried to re-run the AuiTabArts I implemented few weeks
ago... needless to say, they do not work :-D. The area reserved for
tabs is waaaaay too small..
That's very kind of you to try that stuff again. I've just reviewed your code and the code in aui.py. Some things I recognized (please correct me if I'm wrong):
1. Commenting your GetTabSize() function makes the tab area appear in normal height. I guess this function does not have to be overridden because the low level implementation should do just fine.
It seems there are a couple of issues:
- AuiNotebook style flags can not be retrieved in the PyAuiTabArt
derived class, nor can the default bitmaps for buttons, arrows and so
on;
2. I haven't played around with style flags. For me it's more important to find a general way to create user-defined tabs
at the moment.
- Overridden methods like DrawTab and GetBestTabCtrlSize are never
called in the derived class.
3. I've bugged each(!) function that is concerned with AuiNotebook (AuiNotebook, AuiTabArt, AuiTabContainer, AuiTabCtrl, PyAuiTabArt) with a print statement like 'class.function',args, kwargs. Here is the result of your test frame WITHOUT self.nb.SetArtProvider(AuiTabArt):
AuiNotebook.__init__ (<__main__.TestPanel; proxy of <Swig Object of type 'wxPanel *' at 0xc3f600> >,) {}
AuiNotebook.AddPage (<wx.aui.AuiNotebook; proxy of <Swig Object of type 'wxAuiNotebook *' at 0x1cfb228> >, <wx._controls.TextCtrl; proxy of <Swig
Object of type 'wxTextCtrl *' at 0xff15a8> >, 'Welcome') {}
AuiNotebook.AddPage (<wx.aui.AuiNotebook; proxy of <Swig Object of type 'wxAuiNotebook *' at 0x1cfb228> >, <wx._controls.TextCtrl; proxy of <Swig
Object of type 'wxTextCtrl *' at 0x1d021d8> >, 'Tab Number 1') {}
AuiNotebook.AddPage (<wx.aui.AuiNotebook; proxy of <Swig Object of type 'wxAuiNotebook *' at 0x1cfb228> >, <wx._controls.TextCtrl; proxy of <Swig
Object of type 'wxTextCtrl *' at 0x1d02458> >, 'Tab Number 2') {}
AuiNotebook.AddPage (<wx.aui.AuiNotebook; proxy of <Swig Object of type 'wxAuiNotebook *' at 0x1cfb228> >, <wx._controls.TextCtrl; proxy of <Swig
Object of type 'wxTextCtrl *' at 0x1d026d8> >, 'Tab Number 3') {}
AuiNotebook.AddPage (<wx.aui.AuiNotebook; proxy of <Swig Object of type 'wxAuiNotebook *' at 0x1cfb228> >, <wx._controls.TextCtrl; proxy of <Swig
Object of type 'wxTextCtrl *' at 0x1d02978> >, 'Tab Number 4') {}
As you can see, DrawTab is never called as well.. I guess all the draw stuff is handled by the low level implementation for both of the delivered styles and never calls DrawTab which makes it even more difficult. Your TestPanel with SetArtProvider(AuiTabArt) extends the shown output by:
PyAuiTabArt.__init__ () {}
PyAuiTabArt._setCallbackInfo (<__main__.AuiTabArt; proxy of <Swig Object of type 'wxPyAuiTabArt *' at 0x1cef318> >, <__main__.AuiTabArt; proxy of
<Swig Object of type 'wxPyAuiTabArt *' at 0x1cef318> >, <class 'wx.aui.PyAuiTabArt'>) {}
AuiNotebook.SetArtProvider (<wx.aui.AuiNotebook; proxy of <Swig Object of type 'wxAuiNotebook *' at 0x1cfab68> >, <__main__.AuiTabArt; proxy of
<Swig Object of type 'wxPyAuiTabArt *' at 0x1cef318> >) {}
I don't know if this really helps but it shows very precise that a lot of the magic is done in the background. Does anyone has the source of _aui.pyc? Maybe this could help to de-mystify the AuiTabs=).
I am using the latest pre-release, 2.8.9.2.pre20090128 (msw-unicode)
with Python 2..5.2 on Windows XP. I attach a very basic implementation
of my AuiTabArt for others to test and to discover my stupid mistakes.
Thank you for your suggestions.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
I've also played around with explicitly calling DrawTab but I got stuck in the missing documentation for all the parameters.
I hope all that brainstorming leads to some editable tab (and tab container) designs. So far,
Tim
···
On Mon, Feb 2, 2009 at 2:12 PM, Gavana, Andrea wrote: