dabo Commit
Revision 5073
Date: 2009-02-22 18:20:41 -0800 (Sun, 22 Feb 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5073

Changed:
U   trunk/ide/ClassDesigner.py
U   trunk/ide/ClassDesignerComponents.py
U   trunk/ide/ClassDesignerFormMixin.py

Log:
Added code to help import the bizobjs when running a form from the Class 
Designer.

Fixed a bug that would happen if you right-clicked on the entry for the form in 
the Object Tree.



Diff:
Modified: trunk/ide/ClassDesigner.py
===================================================================
--- trunk/ide/ClassDesigner.py  2009-02-23 02:18:22 UTC (rev 5072)
+++ trunk/ide/ClassDesigner.py  2009-02-23 02:20:41 UTC (rev 5073)
@@ -1666,6 +1666,9 @@
 
        def onRunDesign(self, evt):
                self.flushCodeEditor()
+               currbiz = self.biz
+               full = os.path.join(os.getcwd(), self.CurrentForm._classFile)
+               self.updateNamespace(full)
                try:
                        self.CurrentForm.onRunDesign(evt)
                except AttributeError, e:
@@ -1681,9 +1684,9 @@
                                txt = e.text.strip()
                        else:
                                txt = _("<unspecified>")
-                       
                        dabo.ui.stop(_("Compilation Error: %s\nCode: %s") % 
(msg, txt),
                                        _("Compilation Error"))
+               self.biz = currbiz
 
 
        def onOpenDesign(self, evt):
@@ -2508,6 +2511,7 @@
                                dlg.show()
                                if not dlg.Accepted:
                                        # User canceled
+                                       dlg.release()
                                        return
                                try:
                                        newPgs = dlg.pageCount
@@ -3433,6 +3437,7 @@
                ret = (None, None, None)
                if dlg.Accepted:
                        ret = (dlg.slotcount.Value, dlg.chkBox.Value, 
dlg.boxcaption.Value)
+               dlg.release()
                return ret
 
 

Modified: trunk/ide/ClassDesignerComponents.py
===================================================================
--- trunk/ide/ClassDesignerComponents.py        2009-02-23 02:18:22 UTC (rev 
5072)
+++ trunk/ide/ClassDesignerComponents.py        2009-02-23 02:20:41 UTC (rev 
5073)
@@ -1966,6 +1966,10 @@
 
 
 class LayoutBasePanel(dabo.ui.dPanel, LayoutSaverMixin):
+       def createContextMenu(self):
+               """Only here for compatibility"""
+               return
+
        def _getController(self):
                try:
                        return self._controller

Modified: trunk/ide/ClassDesignerFormMixin.py
===================================================================
--- trunk/ide/ClassDesignerFormMixin.py 2009-02-23 02:18:22 UTC (rev 5072)
+++ trunk/ide/ClassDesignerFormMixin.py 2009-02-23 02:20:41 UTC (rev 5073)
@@ -174,8 +174,16 @@
        def onDeactivate(self, evt):
                if self.Controller is not None:
                        self._selection = self.Controller.Selection
-               
-       
+
+
+       def createContextMenu(self):
+               """The form doesn't allow direct access in design mode. 
Instead, call the
+               base panel, if any, and use its context menu.
+               """
+               if self.mainPanel:
+                       return self.mainPanel.createContextMenu()
+
+
        def beforeClose(self, evt):
                ret = True
                curr = self._getSavedState()
@@ -203,8 +211,8 @@
                                self._finito = True
                                self.Controller.designerFormClosing(self)
                return True
-       
-       
+
+
        def _configureForDockForm(self):
                """If the form being edited is a dDockForm, we need to fake it 
by adding
                all the functionality to the DesignerForm.



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to