Changeset 4425
- Timestamp:
- 08/21/08 05:29:47 (3 months ago)
- Files:
-
- trunk/ide/ClassDesigner.py (modified) (8 diffs)
- trunk/ide/ClassDesignerControlMixin.py (modified) (4 diffs)
- trunk/ide/ClassDesignerEditor.py (modified) (2 diffs)
- trunk/ide/ClassDesignerPropSheet.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ide/ClassDesigner.py
r4388 r4425 671 671 self.CurrentForm = frm 672 672 frm._classFile = pth 673 frm._formMode = frm.SaveRestorePosition =isFormClass673 frm._formMode = isFormClass 674 674 if isFormClass: 675 675 # See if there is any code associated with the form … … 836 836 defAtts.update(dictStringify(atts)) 837 837 atts = defAtts 838 sz.setPropertiesFromAtts(atts) 838 if isinstance(sz.Parent, dabo.ui.dSlidePanel): 839 # Main sizer for a slide panel; don't do anything 840 pass 841 else: 842 sz.setPropertiesFromAtts(atts) 839 843 if classID: 840 844 sz.classID = classID … … 1030 1034 if grandkids: 1031 1035 self._srcObj = pnl 1032 self.recreateChildren(p g, grandkids, None, False)1036 self.recreateChildren(pnl, grandkids, None, False) 1033 1037 elif isSplitter: 1034 1038 for pos, kid in enumerate(kids): … … 1542 1546 obj = pgf.Pages[-1] 1543 1547 cleanup = "pgf.PageCount = %s" % pp 1548 if issubclass(cls, dui.dSlidePanel) and isinstance(srcObj.Parent, 1549 dui.dSlidePanelControl): 1550 spc = srcObj.Parent 1551 pp = spc.PanelCount 1552 spc.PanelCount += 1 1553 obj = spc.Panels[-1] 1554 cleanup = "spc.PanelCount = %s" % pp 1544 1555 elif issubclass(cls, dui.dColumn): 1545 1556 grd = srcObj.Parent … … 1558 1569 if cleanup: 1559 1570 exec cleanup in locals() 1560 1561 if not issubclass(cls, dui.dPage): 1571 if not issubclass(cls, (dui.dPage, dui.dSlidePanel)): 1562 1572 # Pages will be released by their parent. 1563 1573 obj.release() … … 2595 2605 isSlidePanelControl = issubclass(cls, dui.dSlidePanelControl) 2596 2606 if isSlidePanelControl: 2597 dabo.ui.exclaim("NOT IMPLEMENTED YET")2598 return2599 2607 # Make sure it has some panels. 2600 2608 newPanels = None … … 2738 2746 if useSizers: 2739 2747 sz = pnl.Sizer = LayoutSizer("v") 2748 sz.Parent = pnl 2740 2749 pnl0 = LayoutPanel(pnl) 2741 2750 … … 3406 3415 itm = None 3407 3416 if itm: 3417 if isinstance(newSizer.Parent, dabo.ui.dSlidePanel): 3418 #This is the main sizer 3419 itm = None 3420 if itm: 3408 3421 if sizerAtts: 3409 3422 if isSpacer: trunk/ide/ClassDesignerControlMixin.py
r4388 r4425 85 85 elif isinstance(self, dabo.ui.dImage): 86 86 self.bindEvent(dEvents.Resize, self._onResize) 87 elif isinstance(self, (dabo.ui.dSlidePanelControl, dabo.ui.dSlidePanel)): 88 pass 87 89 else: 88 90 # This removes all previously-defined bindings … … 113 115 # Bind the active page to the current selection 114 116 self.bindEvent(dEvents.PageChanged, self.desSelectPage) 117 elif isinstance(self, dabo.ui.dSlidePanel): 118 self.bindEvent(dEvents.SlidePanelChange, self.desSlidePanelChg) 115 119 elif isinstance(self, (dabo.ui.dPanel, dabo.ui.dImage, dabo.ui.dBitmap, 116 120 dabo.ui.dBitmapButton, dabo.ui.dToggleButton)): … … 133 137 self.Form.createControlHandles(self) 134 138 # self.bindKey("left", self.Form.keyMoveLeft) 135 136 139 140 137 141 def _insertPageOverride(self, pos, pgCls=None, caption="", imgKey=None, 138 142 makeActive=False, ignoreOverride=False): … … 466 470 """Called when a node in a tree is selected""" 467 471 self.Form.selectControl(self.Selection, False) 468 469 472 473 474 def desSlidePanelChg(self, evt): 475 dabo.ui.callAfterInterval(100, self.Form.refresh) 476 477 470 478 def moveControl(self, pos, shft=False): 471 479 """ Wraps the Move command with the necessary trunk/ide/ClassDesignerEditor.py
r4388 r4425 273 273 274 274 def _getMethodBase(self, mthd, isEvt): 275 cd = ("def %s(self): \n\t" % mthd, "def %s(self, evt):\n\t" % mthd)275 cd = ("def %s(self):" % mthd, "def %s(self, evt):" % mthd) 276 276 if isEvt is None: 277 277 return cd … … 545 545 mthd = ed.Method 546 546 mb = self._getMethodBase(mthd, None) 547 isEmpty = (txt.strip() == "") or (txt in mb) 547 ts = txt.strip() 548 isEmpty = (ts == "") or (ts in mb) 548 549 obj = ed.Object 549 550 objCode = rep.get(obj) trunk/ide/ClassDesignerPropSheet.py
r4122 r4425 709 709 return None 710 710 try: 711 return self.propDict[prop]711 return self.propDict[prop] 712 712 except KeyError, e: 713 713 print "PROP DICT ERROR: >%s<, row=%s" % (prop, row) … … 717 717 super(PropertyGrid, self).fillGrid(force) 718 718 # Set the renderers and editors manually by cell 719 if not self.Application.Selection: 720 return 719 721 valColumn = self.Columns[1] 720 722 for row in range(self.RowCount): … … 752 754 ret = typ in ("str", "string", "unicode", "u") 753 755 else: 756 if not self.Application.Selection: 757 return type(None) 754 758 pd = self.getPropDictForRow(row) 755 759 756 760 if not isinstance(pd, dict): 757 761 if pd is None: 758 print _("None PROP DICT:, ROW="), row 762 if dabo.verboseLogging: 763 # Not technically logging, but this is such a non-event... 764 print _("None PROP DICT:, ROW="), row, col, typ 759 765 else: 760 766 print _("BAD PROP DICT:"), pd, type(pd), _("ROW="), row … … 810 816 if col is None: 811 817 col = self.CurrentColumn 818 if not self.Application.Selection: 819 self.CurrentRow = self.CurrentColumn = 0 820 return 812 821 pd = self.getPropDictForRow(row) 813 822 if pd is None:
