Changeset 4064
- Timestamp:
- 05/04/08 13:04:33 (2 months ago)
- Files:
-
- trunk/dabo/ui/uiwx/dSplitForm.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dabo/ui/uiwx/dSplitForm.py
r3303 r4064 10 10 11 11 class dSplitForm(dabo.ui.dForm): 12 def _afterInit(self): 13 win = self.splitter = dSplitter(self, createPanes=True, RegID="MainSplitter") 14 super(dSplitForm, self)._afterInit() 15 self.Sizer.append1x(win) 16 win.Visible = True 17 self.layout() 12 def __init__(self, *args, **kwargs): 13 self._splitter = None 14 super(dSplitForm, self).__init__(*args, **kwargs) 18 15 19 16 20 17 def unsplit(self): 21 self. splitter.unsplit()18 self.Splitter.unsplit() 22 19 23 20 24 21 def split(self, dir=None): 25 self. splitter.split(dir)22 self.Splitter.split(dir) 26 23 27 24 28 25 def _getMinPanelSize(self): 29 return self. splitter.MinPanelSize26 return self.Splitter.MinPanelSize 30 27 31 28 def _setMinPanelSize(self, val): 32 29 if self._constructed(): 33 self. splitter.MinPanelSize = val30 self.Splitter.MinPanelSize = val 34 31 else: 35 32 self._properties["MinPanelSize"] = val … … 37 34 38 35 def _getOrientation(self): 39 return self. splitter.Orientation36 return self.Splitter.Orientation 40 37 41 38 def _setOrientation(self, val): 42 39 if self._constructed(): 43 self. splitter.Orientation = val40 self.Splitter.Orientation = val 44 41 else: 45 42 self._properties["MinPanelSize"] = val … … 47 44 48 45 def _getPanel1(self): 49 return self. splitter.Panel146 return self.Splitter.Panel1 50 47 51 48 def _setPanel1(self, pnl): 52 49 if self._constructed(): 53 self. splitter.Panel1 = pnl50 self.Splitter.Panel1 = pnl 54 51 else: 55 52 self._properties["Panel1"] = pnl … … 57 54 58 55 def _getPanel2(self): 59 return self. splitter.Panel256 return self.Splitter.Panel2 60 57 61 58 def _setPanel2(self, pnl): 62 59 if self._constructed(): 63 self. splitter.Panel2 = pnl60 self.Splitter.Panel2 = pnl 64 61 else: 65 62 self._properties["Panel2"] = pnl … … 67 64 68 65 def _getSashPosition(self): 69 return self. splitter.SashPosition66 return self.Splitter.SashPosition 70 67 71 68 def _setSashPosition(self, val): 72 69 if self._constructed(): 73 self. splitter.SashPosition = val70 self.Splitter.SashPosition = val 74 71 else: 75 72 self._properties["SashPosition"] = val 76 73 77 74 75 def _getSplitter(self): 76 if self._splitter is None: 77 win = self._splitter = dSplitter(self, createPanes=True, RegID="MainSplitter") 78 def addToSizer(frm, itm): 79 if not frm.Sizer: 80 dabo.ui.callAfter(addToSizer, frm, itm) 81 else: 82 frm.Sizer.append1x(itm) 83 frm.layout() 84 win.Visible = True 85 dabo.ui.callAfter(addToSizer, self, win) 86 return self._splitter 87 88 78 89 79 90 MinPanelSize = property(_getMinPanelSize, _setMinPanelSize, None, 80 91 _("Controls the minimum width/height of the panels. (int)")) 81 DynamicMinPanelSize = makeDynamicProperty(MinPanelSize)82 92 83 93 Orientation = property(_getOrientation, _setOrientation, None, 84 94 _("Determines if the window splits Horizontally or Vertically. (str)")) 85 DynamicOrientation = makeDynamicProperty(Orientation)86 95 87 96 Panel1 = property(_getPanel1, _setPanel1, None, … … 93 102 SashPosition = property(_getSashPosition, _setSashPosition, None, 94 103 _("Position of the sash when the window is split. (int)")) 104 105 Splitter = property(_getSplitter, None, None, 106 _("Reference to the main splitter in the form (dSplitter")) 107 108 109 110 DynamicMinPanelSize = makeDynamicProperty(MinPanelSize) 111 DynamicOrientation = makeDynamicProperty(Orientation) 95 112 DynamicSashPosition = makeDynamicProperty(SashPosition) 96 97 113 98 114 … … 102 118 103 119 def afterInit(self): 104 self. splitter.Panel1.BackColor = dabo.dColors.randomColor()105 self. splitter.Panel2.BackColor = dabo.dColors.randomColor()120 self.Splitter.Panel1.BackColor = dabo.dColors.randomColor() 121 self.Splitter.Panel2.BackColor = dabo.dColors.randomColor() 106 122 107 123
