X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d4b73b1b8e585418459362c9bf9173aa21da8c41..42f8298f6f42d5d63bb3caf65682b7d9d9f8b702:/wxPython/wx/lib/multisash.py diff --git a/wxPython/wx/lib/multisash.py b/wxPython/wx/lib/multisash.py index fac6afd531..fbf7217816 100644 --- a/wxPython/wx/lib/multisash.py +++ b/wxPython/wx/lib/multisash.py @@ -16,7 +16,7 @@ # 12/20/2003 - Jeff Grimmett (grimmtooth@softhome.net) # # o wxMultiSash -> MultiSash -# o wxMultiSplit -> MultiSplit wxMultiViewLeaf +# o wxMultiSplit -> MultiSplit # o wxMultiViewLeaf -> MultiViewLeaf # @@ -55,17 +55,18 @@ class MultiSash(wx.Window): def GetSaveData(self): saveData = {} - saveData['_defChild'] = str(self._defChild) + saveData['_defChild_class'] = self._defChild.__name__ + saveData['_defChild_mod'] = self._defChild.__module__ saveData['child'] = self.child.GetSaveData() return saveData def SetSaveData(self,data): - dChild = data['_defChild'] - mod = dChild.split('.')[0] + mod = data['_defChild_mod'] + dChild = mod + '.' + data['_defChild_class'] exec 'import %s' % mod self._defChild = eval(dChild) old = self.child - self.child = MultiSplit(self,self,wxPoint(0,0),self.GetSize()) + self.child = MultiSplit(self,self,wx.Point(0,0),self.GetSize()) self.child.SetSaveData(data['child']) old.Destroy() self.OnMultiSize(None) @@ -113,7 +114,7 @@ class MultiSplit(wx.Window): def SetSaveData(self,data): self.direction = data['direction'] - self.SetDimensions(data['x'],data['y'],data['w'],data['h']) + self.SetDimensions(int(data['x']), int(data['y']), int(data['w']), int(data['h'])) v1Data = data.get('view1',None) if v1Data: isSplit = data.get('view1IsSplit',None) @@ -278,8 +279,8 @@ class MultiSplit(wx.Window): else: v1h = v2h = h - self.view1.SetDimensions(v1x,v1y,v1w,v1h) - self.view2.SetDimensions(v2x,v2y,v2w,v2h) + self.view1.SetDimensions(int(v1x), int(v1y), int(v1w), int(v1h)) + self.view2.SetDimensions(int(v2x), int(v2y), int(v2w), int(v2h)) self.view1.OnSize(None) self.view2.OnSize(None) @@ -302,9 +303,13 @@ class MultiViewLeaf(wx.Window): self.Bind(wx.EVT_SIZE,self.OnSize) + self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)) + + def GetSaveData(self): saveData = {} - saveData['detailClass'] = str(self.detail.child.__class__) + saveData['detailClass_class'] = self.detail.child.__class__.__name__ + saveData['detailClass_mod'] = self.detail.child.__module__ if hasattr(self.detail.child,'GetSaveData'): attr = getattr(self.detail.child,'GetSaveData') if callable(attr): @@ -320,8 +325,8 @@ class MultiViewLeaf(wx.Window): return saveData def SetSaveData(self,data): - dChild = data['detailClass'] - mod = dChild.split('.')[0] + mod = data['detailClass_mod'] + dChild = mod + '.' + data['detailClass_class'] exec 'import %s' % mod detClass = eval(dChild) self.SetDimensions(data['x'],data['y'],data['w'],data['h']) @@ -450,6 +455,9 @@ class MultiSizer(wx.Window): self.Bind(wx.EVT_LEFT_DOWN,self.OnPress) self.Bind(wx.EVT_LEFT_UP,self.OnRelease) + self.SetBackgroundColour(wx.SystemSettings.GetColour(wx.SYS_COLOUR_3DFACE)) + + def CalcSizePos(self,parent): pw,ph = parent.GetSize() if self.side == MV_HOR: @@ -610,13 +618,13 @@ class MultiCreator(wx.Window): # Draw outline dc.SetPen(highlight) - dc.DrawLine((0,0), (0,h)) - dc.DrawLine((0,0), (w,0)) + dc.DrawLine(0,0, 0,h) + dc.DrawLine(0,0, w,0) dc.SetPen(black) - dc.DrawLine((0,h), (w+1,h)) - dc.DrawLine((w,0), (w,h)) + dc.DrawLine(0,h, w+1,h) + dc.DrawLine(w,0, w,h) dc.SetPen(shadow) - dc.DrawLine((w-1,2), (w-1,h)) + dc.DrawLine(w-1,2, w-1,h) #---------------------------------------------------------------------- @@ -692,11 +700,11 @@ def DrawSash(win,x,y,direction): bmp = wx.EmptyBitmap(8,8) bdc = wx.MemoryDC() bdc.SelectObject(bmp) - bdc.DrawRectangle((-1,-1), (10,10)) + bdc.DrawRectangle(-1,-1, 10,10) for i in range(8): for j in range(8): if ((i + j) & 1): - bdc.DrawPoint((i,j)) + bdc.DrawPoint(i,j) brush = wx.Brush(wx.Colour(0,0,0)) brush.SetStipple(bmp) @@ -726,8 +734,8 @@ def DrawSash(win,x,y,direction): h = body_h if direction == MV_HOR: - dc.DrawRectangle((x,y-2), (w,4)) + dc.DrawRectangle(x,y-2, w,4) else: - dc.DrawRectangle((x-2,y), (4,h)) + dc.DrawRectangle(x-2,y, 4,h) dc.EndDrawingOnTop()