dabo Commit
Revision 6621
Date: 2011-06-11 10:23:53 -0700 (Sat, 11 Jun 2011)
Author: Ed
Trac: http://trac.dabodev.com/changeset/6621
Changed:
U trunk/ide/ClassDesigner.py
U trunk/ide/ClassDesignerMenu.py
Log:
Incorporated the ability to edit text files while remaining in the Class
Designer.
Diff:
Modified: trunk/ide/ClassDesigner.py
===================================================================
--- trunk/ide/ClassDesigner.py 2011-06-11 17:23:01 UTC (rev 6620)
+++ trunk/ide/ClassDesigner.py 2011-06-11 17:23:53 UTC (rev 6621)
@@ -35,6 +35,7 @@
import dabo.ui.dialogs as dlgs
from dabo.lib.utils import dictStringify
from ClassDesignerExceptions import PropertyUpdateException
+from Editor import EditorForm as TextEditorForm
# Temporary fix for wxPython 2.6 users
try:
dabo.ui.dDockForm
@@ -112,6 +113,7 @@
self._selectedClass = dui.dForm
self._currentForm = None
self._editorForm = None
+ self._textEditorForm = None
self._pemForm = None
self._tree = None
self._palette = None
@@ -289,6 +291,11 @@
ed.Controller = self
ed.Visible = True
+ # Create the Text File Editor
+ txed = self.TextEditorForm
+ txed.Controller = self
+ txed.Visible = False
+
# Set the initial selection to the form
self.select(self.CurrentForm)
@@ -1907,6 +1914,13 @@
self.setUserSetting("saveCodeInXML", newSetting)
+ def onEditTextFile(self, evt):
+ fpath = dabo.ui.getFile("py", "txt", "*")
+ if fpath:
+ self.TextEditorForm.openFile(fpath)
+ self.TextEditorForm.show()
+
+
def onSaveDesign(self, evt):
self.wrapSave(self.CurrentForm.onSaveDesign, evt)
@@ -4354,6 +4368,20 @@
return self._sizerPalette
+ def _getTextEditorForm(self):
+ noEdt = self._textEditorForm is None
+ if not noEdt:
+ # Make sure it's still a live object
+ try:
+ junk = self._textEditorForm.Visible
+ except dui.deadObjectException:
+ noEdt = True
+ if noEdt:
+ self._textEditorForm = TextEditorForm(None)
+ self._textEditorForm.Controller = self
+ return self._textEditorForm
+
+
def _getTree(self):
return self.PemForm.Tree
@@ -4393,6 +4421,9 @@
SizerPalette = property(_getSizerPalette, None, None,
_("Reference to the sizer setting palette (read-only)
(dToolForm)"))
+ TextEditorForm = property(_getTextEditorForm, None, None,
+ _("Reference to the text file editing form
(TextEditorForm)"))
+
Tree = property(_getTree, None, None,
_("Reference to the Layout Tree form (TreeSheet)") )
Modified: trunk/ide/ClassDesignerMenu.py
===================================================================
--- trunk/ide/ClassDesignerMenu.py 2011-06-11 17:23:01 UTC (rev 6620)
+++ trunk/ide/ClassDesignerMenu.py 2011-06-11 17:23:53 UTC (rev 6621)
@@ -108,6 +108,11 @@
OnHit=app.onSaveDesign,
ItemID="file_save",
help=_("Save the ClassDesigner contents as a
form"))
+ fm.prepend(_("&Edit Text File..."),
+ HotKey="Ctrl+E",
+ OnHit=app.onEditTextFile,
+ ItemID="file_edit_textfile",
+ help=_("Open a text file for editing"))
recent = dabo.ui.dMenu(Caption=_("Open Recent"),
MenuID="file_open_recent", MRU=True)
fm.prependMenu(recent)
fm.prepend(_("&Open"),
_______________________________________________
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]