daboide Commit
Revision 229
Date: 2005-11-09 15:41:56 -0800 (Wed, 09 Nov 2005)
Author: ed

Changed:
U   trunk/wizards/QuickLayoutWizard.py

Log:
Fixed a couple of small glitches. Changed the code to use the new 'Wizard' 
property of WizardPages.


Diff:
Modified: trunk/wizards/QuickLayoutWizard.py
===================================================================
--- trunk/wizards/QuickLayoutWizard.py  2005-11-09 22:07:57 UTC (rev 228)
+++ trunk/wizards/QuickLayoutWizard.py  2005-11-09 23:41:56 UTC (rev 229)
@@ -18,7 +18,7 @@
                sz.appendSpacer(16)
                lbl = dabo.ui.dLabel(self, Caption="Select Table:")
                tb = self.tblSelector = dabo.ui.dDropdownList(self)
-               tbls = self.Form.DE.keys()
+               tbls = self.Wizard.DE.keys()
                tbls.sort()
                tb.Choices = tbls
                tb.PositionValue = 0
@@ -57,7 +57,7 @@
        def onEnterPage(self, dir):
                dd = self.tblSelector
                chc = dd.Choices
-               keys = self.Form.DE.keys()
+               keys = self.Wizard.DE.keys()
                if chc != keys:
                        # DE has changed
                        dd.Choices = keys
@@ -74,7 +74,7 @@
                        return
                self.lstFields.clear()
                # Create the items for the list
-               fldDict = self.Form.DE[self._currTable]
+               fldDict = self.Wizard.DE[self._currTable]
                flds = fldDict.keys()
                flds.sort()
                pktext={True:"X", False:""}
@@ -98,8 +98,8 @@
                        if not(selFlds) or not (selTbl):
                                dabo.ui.info("Please select something first.")
                                return False
-               self.Form.flds = selFlds
-               self.Form.tbl = selTbl
+               self.Wizard.flds = selFlds
+               self.Wizard.tbl = selTbl
 
 
 class PgLayout(WizardPage):
@@ -109,7 +109,7 @@
                # select a layout type
                lt = self.layoutType = dabo.ui.dListBox(self, 
                                Height=160, ValueMode="Position")
-               lt.bindEvent(dEvents.Hit, self.onLayoutSelect)
+               lt.bindEvent(dEvents.ListSelection, self.onLayoutSelect)
                
                # Define images for each layout. They will be 
                # accessed by position relative to the choices 
@@ -124,14 +124,14 @@
                
                
        def onLayoutSelect(self, evt=None):
-               self.Form.layoutType = 
self.Form.availableLayouts[self.layoutType.Value]
+               self.Wizard.layoutType = 
self.Wizard.availableLayouts[self.layoutType.Value]
                self.layoutImg.Picture = self.imgs[self.layoutType.Value]
                self.layout()
                
                
        def onEnterPage(self, dir):
-               layouts = self.Form.availableLayouts
-               if len(self.Form.flds) == 1:
+               layouts = self.Wizard.availableLayouts
+               if len(self.Wizard.flds) == 1:
                        layouts.remove("Grid") 
                self.layoutType.Choices = layouts
                if dir == "forward":
@@ -154,12 +154,12 @@
 
 
        def onEnterPage(self, dir):
-               self.fldSorter.Choices = self.Form.flds
+               self.fldSorter.Choices = self.Wizard.flds
 
 
        def onLeavePage(self, dir):
                if dir == "forward":
-                       self.Form.flds = self.fldSorter.Choices
+                       self.Wizard.flds = self.fldSorter.Choices
 
 
 
@@ -175,8 +175,8 @@
        def onEnterPage(self, dir):
                if dir != "forward":
                        return
-               layType = self.Form.layoutType
-               flds = self.Form.flds
+               layType = self.Wizard.layoutType
+               flds = self.Wizard.flds
                if (layType == self.lastStyle) and (flds == self.lastFldList):
                        # Nothing has changed
                        return
@@ -285,7 +285,7 @@
        def onEndLblEdit(self, evt):                    
                tx = self.editText.Value
                if tx:
-                       #### ALSO: need to update the form's fields
+                       #### ALSO: need to update the wizard's fields
                        self.editLabel.Caption = tx
                        self.controls[self.editLabel.origCap]["caption"] = tx
                        self.layout()
@@ -294,7 +294,7 @@
 
        
        def makeGrid(self):
-               frm = self.Form
+               frm = self.Wizard
                flds = frm.flds
                tblInfo = frm.DE[frm.tbl]
                sp = self.samplePanel
@@ -340,7 +340,7 @@
 
        def onLeavePage(self, dir):
                if dir == "forward":
-                       self.wizard.controlInfo = self.controls
+                       self.Wizard.controlInfo = self.controls
                return True
                
 
@@ -382,6 +382,6 @@
 if __name__ == "__main__":
        app = dabo.dApp()
        app.MainFormClass = None
+       app.setup()
        wiz = QuickLayoutWizard()
-       app.setup()
        wiz.start()




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to