AuiManager question

Hi, all

This is a piece of sample code from aui.py.

My question is
that when I run this code, I get a layout like this one,
, but I need it like this,
.

Anyone can help me?

import wx

import wx.aui

class MyFrame(wx.Frame):

def __init__(self, parent, id=-1, title='wx.aui Test',

             pos=wx.DefaultPosition, size=(800, 600),

             style=wx.DEFAULT_FRAME_STYLE):

    wx.Frame.__init__(self, parent, id, title, pos, size, style)

    self._mgr = wx.aui.AuiManager(self)

    # create several text controls

    text1 = wx.TextCtrl(self, -1, 'Pane 1 - sample text',

                        wx.DefaultPosition, wx.Size(200,150),

                        wx.NO_BORDER | wx.TE_MULTILINE)

    text2 = wx.TextCtrl(self, -1, 'Pane 2 - sample text',

                        wx.DefaultPosition, wx.Size(200,150),

                        wx.NO_BORDER | wx.TE_MULTILINE)

    text3 = wx.TextCtrl(self, -1, '',

                        wx.DefaultPosition, wx.Size(200,150),

                        wx.NO_BORDER | wx.TE_MULTILINE)

    # add the panes to the manager

    self._mgr.AddPane(text2, wx.BOTTOM, 'Pane Number Two')

    self._mgr.AddPane(text1, wx.LEFT, 'Pane Number One')

    self._mgr.AddPane(text3, wx.CENTER)

    # tell the manager to 'commit' all the changes just made

    self._mgr.Update()

    self.Bind(wx.EVT_CLOSE, self.OnClose)

def OnClose(self, event):

    # deinitialize the frame manager

    self._mgr.UnInit()

    # delete the frame

    self.Destroy()

app = wx.App()

frame = MyFrame(None)

frame.Show()

app.MainLoop()

original.jpg

target.jpg

···


Thanks & Best Regards,


Roy Liu
Email: Jingeelio@yahoo.com.cn
Jingeelio@gmail.com

Hi Lionel,

This is a piece of sample code from aui.py.

My question is that when I run this code, I get a layout like this one,
[img]original.jpg[/img], but I need it like this, [img]target.jpg[/img].

Anyone can help me?

If you use the AddPane call which uses the wx.aui.AuiPaneInfo class it
is much easier to layout your panes in the most complex ways you wish.
See the attached file.

HTH.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

prova142.py (1.62 KB)

···

On Thu, Nov 6, 2008 at 9:03 AM, Lionel Liu wrote:

Hi,

I think, in this simple case using the following instead of the original lines for adding the panes should do the trick:

self._mgr.AddPane(text1, wx.aui.AuiPaneInfo().Left().Layer(1).Caption(u"Pane Number One"))

self._mgr.AddPane(text2, wx.aui.AuiPaneInfo().Bottom().Layer(0).Caption(u"Pane Number Two"))

However, as there seem to be experts in AUI online, I’d like to ask a related question regarding AuiManager:

Is it possible to set the dimensions of the docked panes (using AuiPaneInfo() or otherwise - preferably, relative to size of the application window?

Basically, I have a rather complex layout of panes in multiple columns and their rows and I’d like to allmost hide the CenterPane filling the available space with remaining panes.

It seemed to me, that the size… functions in AuiPaneInfo() all deal with undocked panes, is it true?

Is there a way to set the columns to say 15, 1, 15, 15, 39 % of the available width, then to divide the given column vertically in panes, e.g. 60, 30, 10 % of the height?

(I know, one can load the previously saved perspectives from a string, but this isn’t usable for different monitor dimensions etc.)

Any help or hints would be much appreciated!

Thanks,

Vlasta

···

2008/11/6 Lionel Liu jingeelio@gmail.com

Hi, all

This is a piece of sample code from aui.py.

My question is
that when I run this code, I get a layout like this one,
, but I need it like this,
.


Thanks & Best Regards,


Roy Liu
Email: Jingeelio@yahoo.com.cn
Jingeelio@gmail.com


wxpython-users mailing list

wxpython-users@lists.wxwidgets.org

http://lists.wxwidgets.org/mailman/listinfo/wxpython-users