daboide Commit
Revision 221
Date: 2005-10-31 22:05:28 -0800 (Mon, 31 Oct 2005)
Author: paul

Changed:
U   trunk/wizards/AppWizardX/AppWizard.py
U   trunk/wizards/AppWizardX/spec-App.py
U   trunk/wizards/AppWizardX/spec-FrmBase.py
A   trunk/wizards/AppWizardX/spec-FrmMain.py
U   trunk/wizards/AppWizardX/spec-MenReports.py

Log:
Added a generated dFormMain subclass, for use when MDI is on.

Also added generated code to move the Quick Report menu option from the 
Actions menu to the Reports Menu, instead of creating a new one and
deleting the old.


Diff:
Modified: trunk/wizards/AppWizardX/AppWizard.py
===================================================================
--- trunk/wizards/AppWizardX/AppWizard.py       2005-11-01 05:06:25 UTC (rev 
220)
+++ trunk/wizards/AppWizardX/AppWizard.py       2005-11-01 06:05:28 UTC (rev 
221)
@@ -767,6 +767,9 @@
                        ## base form:
                        open("./FrmBase.py", "w").write(self.getFrmBase())
 
+                       ## FrmMain:
+                       open("./FrmMain.py", "w").write(self.getFrmMain())
+
                        # Write each form:
                        for table in selTb:
                                f = open("./Frm%s.py" % table.title(), "w")
@@ -878,6 +881,11 @@
                                "spec-FrmBase.py")).read() % locals()
 
 
+       def getFrmMain(self):
+               return open(os.path.join(self.Application.HomeDirectory, 
+                               "spec-FrmMain.py")).read() % locals()
+
+
        def getFrmReportBase(self):
                return open(os.path.join(self.Application.HomeDirectory, 
                                "spec-FrmReportBase.py")).read() % locals()

Modified: trunk/wizards/AppWizardX/spec-App.py
===================================================================
--- trunk/wizards/AppWizardX/spec-App.py        2005-11-01 05:06:25 UTC (rev 
220)
+++ trunk/wizards/AppWizardX/spec-App.py        2005-11-01 06:05:28 UTC (rev 
221)
@@ -1,11 +1,14 @@
 import dabo
+import ui
 
 
 class App(dabo.dApp):
 
        def initProperties(self):
-               if not dabo.settings.MDI:
-                       # no need for main form:
+               if dabo.settings.MDI:
+                       self.MainFormClass = ui.FrmMain
+               else:
+                       # no need for main form in SDI mode:
                        self.MainFormClass = None
 
                ## The following information can be used in various places in 
your app:
@@ -18,10 +21,4 @@
                self.setAppInfo("companyUrl", "Your company url")
 
 
-       def setup(self):
-               App.doDefault()
-               mf = self.MainForm
-               if mf:
-                       fileMenu = mf.MenuBar.getMenu("File")
-                       fileMenu.prependMenu(self.ui.MenFileOpen(fileMenu))
 

Modified: trunk/wizards/AppWizardX/spec-FrmBase.py
===================================================================
--- trunk/wizards/AppWizardX/spec-FrmBase.py    2005-11-01 05:06:25 UTC (rev 
220)
+++ trunk/wizards/AppWizardX/spec-FrmBase.py    2005-11-01 06:05:28 UTC (rev 
221)
@@ -38,9 +38,12 @@
                self.MenuBar.insertMenu(idx, menReports)
 
                # The datanav form puts a Quick Report option at the end of the 
Actions
-               # menu, but because our wizard code has placed a Quick Report 
option at 
-               # the top of the Reports menu, let's remove the one on the 
Actions menu.
+               # menu, but let's move it over to the Reports menu instead.
                menu = self.MenuBar.getMenu("Actions")
                idx = menu.getItemIndex("Quick Report")
                if idx is not None:
-                       menu.remove(idx)
+                       qrItem = menu.remove(idx, False)
+
+               menReports = self.MenuBar.getMenu("Reports")
+               menReports.prependSeparator()
+               menReports.prependItem(qrItem)

Added: trunk/wizards/AppWizardX/spec-FrmMain.py
===================================================================
--- trunk/wizards/AppWizardX/spec-FrmMain.py    2005-11-01 05:06:25 UTC (rev 
220)
+++ trunk/wizards/AppWizardX/spec-FrmMain.py    2005-11-01 06:05:28 UTC (rev 
221)
@@ -0,0 +1,17 @@
+import dabo.ui
+
+
+class FrmMain(dabo.ui.dFormMain):
+
+       def afterInit(self):
+               FrmMain.doDefault()
+               self.fillFileOpenMenu()
+
+
+       def fillFileOpenMenu(self):
+               """Add the File|Open menu, with menu items for opening each 
form."""
+               app = self.Application
+               fileMenu = self.MenuBar.getMenu("File")
+               fileMenu.prependMenu(app.ui.MenFileOpen(fileMenu))
+
+


Property changes on: trunk/wizards/AppWizardX/spec-FrmMain.py
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/wizards/AppWizardX/spec-MenReports.py
===================================================================
--- trunk/wizards/AppWizardX/spec-MenReports.py 2005-11-01 05:06:25 UTC (rev 
220)
+++ trunk/wizards/AppWizardX/spec-MenReports.py 2005-11-01 06:05:28 UTC (rev 
221)
@@ -13,12 +13,6 @@
                app = self.Application
                autoHotKeys = False
 
-               # Insert the Quick Report option at the top:
-               itm = dabo.ui.dMenuItem(self, Caption="Quick Report")
-               itm.bindEvent(dEvents.Hit, self.onQuickReport)
-               self.appendItem(itm)
-               self.appendSeparator()
-               
                # Define the forms you want in your report menu here. Insert a 
("-", None) 
                # tuple and the code below will insert a separator in its 
place. Explicitly
                # set up which character has the hotkey by adding a & in front 
of it and
@@ -48,5 +42,3 @@
                frm.show()
                frm.release()
 
-       def onQuickReport(self, evt):
-               self.Form.onQuickReport(evt)




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

Reply via email to