help please, splitter windows like in maya or 3ds max

Discussion in 'Python' started by moonrie, Mar 13, 2008.

  1. moonrie

    moonrie Guest

    hi, everyone there, I am doing a 3D modeling project. I like to do it
    with Python( am a newbie), but have no idea with the wxSplitterWindow
    to create the 4-view windows( top, front, side, perspective), like the
    mfc CSplitterWnd guy),
    anyone can give me some help with wxPython?

    thanks in advance.

    - moonrie
     
    moonrie, Mar 13, 2008
    #1
    1. Advertising

  2. This seems to work... split then split each side. then tandem the size.

    import wx


    class Layout(wx.Frame):




    def __init__(self, parent, id, title):

    wx.Frame.__init__(self, parent, id, title)

    sizer = wx.BoxSizer(wx.HORIZONTAL)

    panel = wx.Panel(self,-1)


    splitter = wx.SplitterWindow(panel)


    sizer_left = wx.BoxSizer(wx.VERTICAL)

    panel_left = wx.Panel(splitter,-1)

    splitter_left = wx.SplitterWindow(panel_left)

    splitter_left.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED,self.leftChange,id=splitter_left.GetId())


    panel_left_upper = wx.Panel(splitter_left,style= wx.BORDER_SUNKEN)


    panel_left_upper.SetBackgroundColour("WHITE")

    panel_left_lower = wx.Panel(splitter_left,style= wx.BORDER_SUNKEN)

    splitter_left.SplitHorizontally(panel_left_upper,panel_left_lower)

    sizer_left.Add(splitter_left,1,wx.EXPAND)


    sizer_right = wx.BoxSizer(wx.VERTICAL)

    panel_right = wx.Panel(splitter,-1)

    splitter_right =wx.SplitterWindow(panel_right)

    splitter_right.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED,self.rightChange,id=splitter_right.GetId())

    panel_right_upper = wx.Panel(splitter_right,style= wx.BORDER_SUNKEN)

    panel_right_lower = wx.Panel(splitter_right,style= wx.BORDER_SUNKEN)

    panel_right_lower.SetBackgroundColour("WHITE")

    splitter_right.SplitHorizontally(panel_right_upper,panel_right_lower)

    sizer_right.Add(splitter_right,1,wx.EXPAND)


    splitter.SplitVertically(panel_left,panel_right)


    sizer.Add(splitter,1,wx.EXPAND)


    panel.SetSizer(sizer)

    panel_left.SetSizer(sizer_left)

    panel_right.SetSizer(sizer_right)

    self.splitter_left = splitter_left

    self.splitter_right = splitter_right

    def leftChange(self,event):


    pos = self.splitter_left.GetSashPosition()

    self.splitter_right.SetSashPosition(pos)

    event.Skip()

    def rightChange(self,event):


    pos = self.splitter_right.GetSashPosition()

    self.splitter_left.SetSashPosition(pos)

    event.Skip()


    app = wx.App(0)

    k = Layout(None, -1, 'layout.py')

    k.Show(True)


    app.MainLoop()

    -- Andrew

    ----- Original Message -----
    From: "moonrie" <>
    Newsgroups: comp.lang.python
    Sent: Wednesday, March 12, 2008 10:19 PM
    Subject: help please, splitter windows like in maya or 3ds max


    > hi, everyone there, I am doing a 3D modeling project. I like to do it
    > with Python( am a newbie), but have no idea with the wxSplitterWindow
    > to create the 4-view windows( top, front, side, perspective), like the
    > mfc CSplitterWnd guy),
    > anyone can give me some help with wxPython?
    >
    > thanks in advance.
    >
    > - moonrie
     
    Andrew Rekdal, Mar 13, 2008
    #2
    1. Advertising

  3. moonrie

    moonrie Guest

    On Mar 13, 12:47 pm, "Andrew Rekdal" <<nospam>@comcast.net> wrote:
    > This seems to work... split then split each side. then tandem the size.
    >
    > import wx
    >
    > class Layout(wx.Frame):
    >
    > def __init__(self, parent, id, title):
    >
    > wx.Frame.__init__(self, parent, id, title)
    >
    > sizer = wx.BoxSizer(wx.HORIZONTAL)
    >
    > panel = wx.Panel(self,-1)
    >
    > splitter = wx.SplitterWindow(panel)
    >
    > sizer_left = wx.BoxSizer(wx.VERTICAL)
    >
    > panel_left = wx.Panel(splitter,-1)
    >
    > splitter_left = wx.SplitterWindow(panel_left)
    >
    > splitter_left.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED,self.leftChange,id=splitter_left.GetId())
    >
    > panel_left_upper = wx.Panel(splitter_left,style= wx.BORDER_SUNKEN)
    >
    > panel_left_upper.SetBackgroundColour("WHITE")
    >
    > panel_left_lower = wx.Panel(splitter_left,style= wx.BORDER_SUNKEN)
    >
    > splitter_left.SplitHorizontally(panel_left_upper,panel_left_lower)
    >
    > sizer_left.Add(splitter_left,1,wx.EXPAND)
    >
    > sizer_right = wx.BoxSizer(wx.VERTICAL)
    >
    > panel_right = wx.Panel(splitter,-1)
    >
    > splitter_right =wx.SplitterWindow(panel_right)
    >
    > splitter_right.Bind(wx.EVT_SPLITTER_SASH_POS_CHANGED,self.rightChange,id=splitter_right.GetId())
    >
    > panel_right_upper = wx.Panel(splitter_right,style= wx.BORDER_SUNKEN)
    >
    > panel_right_lower = wx.Panel(splitter_right,style= wx.BORDER_SUNKEN)
    >
    > panel_right_lower.SetBackgroundColour("WHITE")
    >
    > splitter_right.SplitHorizontally(panel_right_upper,panel_right_lower)
    >
    > sizer_right.Add(splitter_right,1,wx.EXPAND)
    >
    > splitter.SplitVertically(panel_left,panel_right)
    >
    > sizer.Add(splitter,1,wx.EXPAND)
    >
    > panel.SetSizer(sizer)
    >
    > panel_left.SetSizer(sizer_left)
    >
    > panel_right.SetSizer(sizer_right)
    >
    > self.splitter_left = splitter_left
    >
    > self.splitter_right = splitter_right
    >
    > def leftChange(self,event):
    >
    > pos = self.splitter_left.GetSashPosition()
    >
    > self.splitter_right.SetSashPosition(pos)
    >
    > event.Skip()
    >
    > def rightChange(self,event):
    >
    > pos = self.splitter_right.GetSashPosition()
    >
    > self.splitter_left.SetSashPosition(pos)
    >
    > event.Skip()
    >
    > app = wx.App(0)
    >
    > k = Layout(None, -1, 'layout.py')
    >
    > k.Show(True)
    >
    > app.MainLoop()
    >
    > -- Andrew
    >
    > ----- Original Message -----
    > From: "moonrie" <>
    >
    > Newsgroups: comp.lang.python
    > Sent: Wednesday, March 12, 2008 10:19 PM
    > Subject: help please, splitter windows like in maya or 3ds max
    >
    > > hi, everyone there, I am doing a 3D modeling project. I like to do it
    > > with Python( am a newbie), but have no idea with the wxSplitterWindow
    > > to create the 4-view windows( top, front, side, perspective), like the
    > > mfc CSplitterWnd guy),
    > > anyone can give me some help with wxPython?

    >
    > > thanks in advance.

    >
    > > - moonrie


    should be these ones,

    thanks, :p
     
    moonrie, Mar 13, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. iherage
    Replies:
    1
    Views:
    4,866
    James Harvey
    Apr 24, 2006
  2. Brandon J. Van Every

    Maya API with Python?

    Brandon J. Van Every, Apr 26, 2004, in forum: Python
    Replies:
    3
    Views:
    687
    Brandon J. Van Every
    Apr 26, 2004
  3. Matthias Baas
    Replies:
    0
    Views:
    391
    Matthias Baas
    Apr 13, 2006
  4. mac
    Replies:
    3
    Views:
    505
    LILkillaBEE aka Nikola
    Jun 24, 2005
  5. stephanie borg
    Replies:
    8
    Views:
    106
    stephanie borg
    Mar 17, 2011
Loading...

Share This Page