[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

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

moonrie@gmail.com

3/13/2008 3:20:00 AM

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
2 Answers

Timothy Adams" <teadams65

3/13/2008 4:48:00 AM

0

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" <moonrie@gmail.com>
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


moonrie@gmail.com

3/13/2008 8:45:00 AM

0

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" <moon...@gmail.com>
>
> 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