Changeset 4086
- Timestamp:
- 05/20/08 22:47:20 (6 months ago)
- Files:
-
- trunk/ide/ClassDesignerComponents.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ide/ClassDesignerComponents.py
r4007 r4086 107 107 ra["designerClass"] = self.getClassName() 108 108 109 # hasSizer = not isClass and (hasattr(self, "ControllingSizerItem") and self.ControllingSizerItem) 110 hasSizer = (hasattr(self, "ControllingSizerItem") and self.ControllingSizerItem) 109 hasSizer = bool(hasattr(self, "ControllingSizerItem") and self.ControllingSizerItem) 111 110 # We want to include some props whether they are the 112 111 # default or not. … … 208 207 itmProps = self.ControllingSizer.getItemProps(self.ControllingSizerItem) 209 208 if insideClass: 210 itmDiffProps = self._diffSizerItemProps(itmProps, classDict )209 itmDiffProps = self._diffSizerItemProps(itmProps, classDict, direct=True) 211 210 else: 212 211 itmDiffProps = self._diffSizerItemProps(itmProps, self.ControllingSizer) 213 # try:214 # defProps = self.Controller.getDefaultSizerProps(self.superControl)215 # itmDiffProps = self._diffSizerItemProps(itmProps, defProps, direct=True)216 # except:217 # itmDiffProps = self._diffSizerItemProps(itmProps, self.ControllingSizer)218 212 ret["attributes"]["sizerInfo"] = itmDiffProps 219 213 except AttributeError: … … 236 230 def _diffSizerItemProps(self, dct, szOrDict, direct=False): 237 231 """Remove all of the default values from the sizer item props.""" 238 # First, what type of sizer is it? 239 is2D = isinstance(szOrDict, dabo.ui.dGridSizer) 240 defaults = {True: szItemDefaults[2], False: szItemDefaults[1]}[is2D].copy() 232 if direct: 233 defaults = szOrDict 234 else: 235 # First, what type of sizer is it? 236 is2D = isinstance(szOrDict, dabo.ui.dGridSizer) 237 defaults = {True: szItemDefaults[2], False: szItemDefaults[1]}[is2D].copy() 241 238 if isinstance(self, LayoutPanel): 242 239 defaults["Expand"] = True
