[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/designer/src GFDesigner.py Incubator.py In...
From: |
Jason Cater |
Subject: |
gnue/designer/src GFDesigner.py Incubator.py In... |
Date: |
Mon, 19 Nov 2001 21:00:16 -0500 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/11/19 21:00:16
Modified files:
designer/src : GFDesigner.py Incubator.py Instance.py
LayoutEditor.py MenuBar.py PopupMenu.py
PropertyEditor.py ToolFrame.py TreeView.py
TriggerEditor.py
Log message:
cleaned up import statements; removed recursive imports
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/GFDesigner.py.diff?cvsroot=OldCVS&tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Incubator.py.diff?cvsroot=OldCVS&tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Instance.py.diff?cvsroot=OldCVS&tr1=1.30&tr2=1.31&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/LayoutEditor.py.diff?cvsroot=OldCVS&tr1=1.28&tr2=1.29&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/MenuBar.py.diff?cvsroot=OldCVS&tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/PopupMenu.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/PropertyEditor.py.diff?cvsroot=OldCVS&tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/ToolFrame.py.diff?cvsroot=OldCVS&tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/TreeView.py.diff?cvsroot=OldCVS&tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/TriggerEditor.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
Patches:
Index: gnue/designer/src/GFDesigner.py
diff -u gnue/designer/src/GFDesigner.py:1.22
gnue/designer/src/GFDesigner.py:1.23
--- gnue/designer/src/GFDesigner.py:1.22 Sat Nov 10 17:01:08 2001
+++ gnue/designer/src/GFDesigner.py Mon Nov 19 21:00:16 2001
@@ -25,15 +25,15 @@
#
# NOTES:
-import sys, os, time
+import sys, os
from StringIO import StringIO
from wxPython.wx import *
from gnue.common import GDebug, GConfig
-from gnue.common.GClientApp import GClientApp
-from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger,
GFLibrary, UIwxpython
-from gnue.designer.Instance import *
+from gnue.designer.Instance import GFDInstance
from gnue.designer import VERSION, PACKAGE
from gnue.designer import TemplateParser, TemplateChooser
+from gnue.common.GClientApp import GClientApp
+from gnue.forms import UIwxpython, GFForm
class GFDesigner(GClientApp, wxApp):
Index: gnue/designer/src/Incubator.py
diff -u gnue/designer/src/Incubator.py:1.10 gnue/designer/src/Incubator.py:1.11
--- gnue/designer/src/Incubator.py:1.10 Mon Nov 19 16:17:55 2001
+++ gnue/designer/src/Incubator.py Mon Nov 19 21:00:16 2001
@@ -27,11 +27,11 @@
# NOTES:
#
-from gnue.common import GDebug, GConfig
-from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger,
GFLibrary, UIwxpython
+from gnue.common import GDebug
+from gnue.forms import GFParser, GFForm
-def createObject(instance, form, tag, type=None, parent=None,
- parentHint=None, attributes={}):
+def createObject(instance, form, tag, type=None, parent=None,
+ parentHint=None, attributes={}):
GDebug.printMesg(3,'Creating a "%s" object' % tag)
@@ -39,51 +39,51 @@
name = instance.getNextGenericName(tag)
- try:
- objclass = elements[tag]['BaseClass']
- if elements[tag].has_key('Attributes'):
- attrs = elements[tag]['Attributes']
+ try:
+ objclass = elements[tag]['BaseClass']
+ if elements[tag].has_key('Attributes'):
+ attrs = elements[tag]['Attributes']
else:
attrs = {}
- except KeyError:
+ except KeyError:
GDebug.printMesg(1, "Attempted to create a '%s', "
"but I don't know what to do!" % tag)
return
-
- if tag == 'trigger':
- if not attributes.has_key('type'):
+
+ if tag == 'trigger':
+ if not attributes.has_key('type'):
attributes['type'] = 'NAMED'
- if attributes['type'] == 'NAMED':
+ if attributes['type'] == 'NAMED':
parent = form
- else:
+ else:
parent = parent or parentHint
- elif tag in ('page','datasource','import'):
+ elif tag in ('page','datasource','import'):
parent = form
o = objclass(parent or parentHint)
-
+
# Pull default values for any attributes not supplied
- for attr in attrs.keys():
- if not attributes.has_key(attr):
- if attrs[attr].has_key('Default'):
+ for attr in attrs.keys():
+ if not attributes.has_key(attr):
+ if attrs[attr].has_key('Default'):
attributes[attr] = attrs[attr]['Typecast'](attrs[attr]['Default'])
- elif attr in ('x','y',):
+ elif attr in ('x','y',):
attributes[attr] = 0
- elif attr in ('height',):
+ elif attr in ('height',):
if tag in ('box','scrollbar'):
attributes[attr] = 4
else:
attributes[attr] = 1
- elif attr == 'width':
+ elif attr == 'width':
if tag in ('scrollbar',):
attributes[attr] = 1
else:
- attributes[attr] = 10
- elif attr in ('text','label'):
+ attributes[attr] = 10
+ elif attr in ('text','label'):
attributes[attr] = name
- for attr in attributes.keys():
+ for attr in attributes.keys():
if attrs.has_key(attr):
o.__dict__[attr] = attributes[attr]
o.name = name
@@ -99,7 +99,7 @@
pass
-def deleteObject(instance, form, object, newCurrentObject=None, firstRun=1):
+def deleteObject(instance, form, object, newCurrentObject=None, firstRun=1):
if firstRun:
newCurrentObject = object._parent
@@ -132,24 +132,24 @@
global elementMapping
elements = GFParser.getXMLelements()
- for tag in elements.keys():
+ for tag in elements.keys():
t = elements[tag]
- if t.has_key('UsableBySiblings'):
+ if t.has_key('UsableBySiblings'):
cascade = t['UsableBySiblings']
- else:
+ else:
cascade = 0
if t.has_key('ParentTags'):
parents = t['ParentTags']
- else:
+ else:
parents = None
- if parents != None:
+ if parents != None:
for parent in parents:
- if elementMapping.has_key(parent):
+ if elementMapping.has_key(parent):
elementMapping[parent].append(tag)
- else:
+ else:
elementMapping[parent] = [tag]
Index: gnue/designer/src/Instance.py
diff -u gnue/designer/src/Instance.py:1.30 gnue/designer/src/Instance.py:1.31
--- gnue/designer/src/Instance.py:1.30 Mon Nov 19 13:30:25 2001
+++ gnue/designer/src/Instance.py Mon Nov 19 21:00:16 2001
@@ -30,16 +30,15 @@
from wxPython.wx import *
from gnue.common import GDebug, GConfig
from gnue.common.GClientApp import GClientApp
-from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger,
GFLibrary, UIwxpython
-from gnue.designer.Debugger import DebugSession
-from gnue.designer.MenuBar import *
-from gnue.designer.LayoutEditor import *
-from gnue.designer.TreeView import *
-from gnue.designer.PropertyEditor import *
-from gnue.designer.TriggerEditor import *
-from gnue.designer import RuntimeSettings
-from gnue.designer.Incubator import elements
-from gnue.designer.ToolFrame import ToolFrame
+from gnue.forms import GFInstance, GFParser, GFObjects, GFTrigger, GFLibrary,
UIwxpython
+from MenuBar import MainMenuBar
+from PopupMenu import ObjectMenu
+from LayoutEditor import LayoutEditor
+from TreeView import TreeView
+from PropertyEditor import PropertyToolFrame
+from TriggerEditor import TriggerEditor
+import RuntimeSettings
+from ToolFrame import ToolFrame
from gnue.designer import VERSION, PACKAGE
TITLE=PACKAGE
@@ -133,7 +132,7 @@
self.propertyEditorWindow.finalize()
self.eventEditor = self.propertyEditorWindow.eventEditor
-
+
# Store all
self.objectListeners = ( self.tree,
self.layoutEditor,
@@ -147,7 +146,6 @@
vsplitter.SetSashPosition (
RuntimeSettings.getint(self.runtime_section, 'vsash', 170), true)
self.vsplitter = vsplitter
- self.layoutEditor.drawPage(self._currentPage)
self.tree.Expand(self._form._treeItem)
self._menubar.lastToolAdded()
Index: gnue/designer/src/LayoutEditor.py
diff -u gnue/designer/src/LayoutEditor.py:1.28
gnue/designer/src/LayoutEditor.py:1.29
--- gnue/designer/src/LayoutEditor.py:1.28 Mon Nov 19 16:17:55 2001
+++ gnue/designer/src/LayoutEditor.py Mon Nov 19 21:00:16 2001
@@ -29,13 +29,11 @@
import sys, os
from wxPython.wx import *
from gnue.common import GDebug, GConfig
-from gnue.common.GClientApp import GClientApp
-from gnue.forms import GFForm, GFInstance, GFParser
-from gnue.forms import GFObjects, GFTrigger, GFLibrary, UIwxpython
+from gnue.forms import UIwxpython, GFObjects
from PopupMenu import PageMenu
-class LayoutEditor (wxPanel):
- def __init__(self, instance, parentWindow):
+class LayoutEditor (wxPanel):
+ def __init__(self, instance, parentWindow):
wxPanel.__init__(self,parentWindow,-1)
self.panelColor = self.GetBackgroundColour()
self._instance = instance
@@ -87,7 +85,7 @@
for o in self._currentSelection.keys():
o.setSelected(0)
return
- if hasattr(object, '_widgetHandler'):
+ if hasattr(object, '_widgetHandler'):
self.propBar.setCurrentObject(object)
if handler != __name__:
self._setCurrentPage(object)
@@ -227,7 +225,7 @@
# EVT_MOTION(self.panel, self.OnMotion)
- def __drawItem(self, object):
+ def __drawItem(self, object):
if self.widgets.has_key(object.getObjectType()) and \
(not hasattr(object, 'hidden') or not object.hidden):
if hasattr(object, 'name'):
Index: gnue/designer/src/MenuBar.py
diff -u gnue/designer/src/MenuBar.py:1.12 gnue/designer/src/MenuBar.py:1.13
--- gnue/designer/src/MenuBar.py:1.12 Sat Nov 10 17:01:09 2001
+++ gnue/designer/src/MenuBar.py Mon Nov 19 21:00:16 2001
@@ -25,10 +25,9 @@
#
# NOTES:
-import sys, os, time, string
+import sys, os, string
from wxPython.wx import *
from gnue.common import GDebug, GConfig
-from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger,
GFLibrary, UIwxpython
import Incubator
# File menu
Index: gnue/designer/src/PopupMenu.py
diff -u gnue/designer/src/PopupMenu.py:1.6 gnue/designer/src/PopupMenu.py:1.7
--- gnue/designer/src/PopupMenu.py:1.6 Mon Nov 19 16:17:55 2001
+++ gnue/designer/src/PopupMenu.py Mon Nov 19 21:00:16 2001
@@ -28,33 +28,33 @@
import sys, os, time, string
from wxPython.wx import *
from gnue.common import GDebug, GConfig, GObjects
-from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger,
GFLibrary, UIwxpython
+from gnue.forms import GFForm, GFObjects, GFTrigger, GFLibrary
import Incubator
-class ActionMenu(wxMenu):
- def __init__(self, instance, object, parent=None, text=None,
parentText=None):
+class ActionMenu(wxMenu):
+ def __init__(self, instance, object, parent=None, text=None,
parentText=None):
wxMenu.__init__(self, text)
self.__instance = instance
self.__parent = parent
self._object = object
self._newMap = {}
- if parent:
+ if parent:
parent.AppendMenu(wxNewId(), parentText, self)
- if object == None:
-
+ if object == None:
+
self.addCreateTag('datasource','New Data Source')
self.addCreateTag('trigger','New Data Source')
self.addCreateTag('page','New Page')
- else:
+ else:
# New >
CreateObjectMenu(instance, object, self)
-
+
# Properties
id = wxNewId()
self.Append(id, "&Properties...")
@@ -172,7 +172,7 @@
oid = "%5d.%5d.%5d" % (object.y, object.x, unqId)
unqId = unqId + 1
- if object.getObjectType() == 'GFBox':
+ if object.getObjectType() == 'GFBox':
boxObjects[oid] = object
else:
navObjects[oid] = object
Index: gnue/designer/src/PropertyEditor.py
diff -u gnue/designer/src/PropertyEditor.py:1.17
gnue/designer/src/PropertyEditor.py:1.18
--- gnue/designer/src/PropertyEditor.py:1.17 Mon Nov 19 18:07:46 2001
+++ gnue/designer/src/PropertyEditor.py Mon Nov 19 21:00:16 2001
@@ -27,18 +27,15 @@
#
-import sys, os, time, string
+import sys, os, string
from wxPython.wx import *
from wxPython.grid import *
from gnue.common import GDebug, GConfig, GTypecast
-from gnue.forms import GFForm, GFInstance, GFParser, \
- GFObjects, GFTrigger, GFLibrary, UIwxpython
-from GFDesigner import *
-from Incubator import elements
from ToolFrame import ToolFrame
+from Incubator import elements
-class PropertyEditor (wxPanel):
- def __init__(self, parent, instance, form):
+class PropertyEditor (wxPanel):
+ def __init__(self, parent, instance, form):
wxPanel.__init__(self,parent,-1,pos=wxPoint(0,0))
self.panel = wxPanel(self,-1,style=wxSIMPLE_BORDER, pos=wxPoint(6,6))
@@ -60,14 +57,14 @@
def onSetCurrentObject (self, object, handler):
- if object == None:
+ if object == None:
return
if handler != __name__:
self.object = object
try:
self.attributes =
elements[string.lower(object.getObjectType()[2:])]['Attributes']
- except KeyError:
+ except KeyError:
self.attributes = {}
self.elements = elements[string.lower(object.getObjectType()[2:])]
@@ -89,7 +86,7 @@
# Only show properties for nondeprecated values (unless set)
i = 0
- while i < len(self.rowList):
+ while i < len(self.rowList):
key = self.rowList[i]
if self.attributes[key].has_key ('Deprecated') and \
self.attributes[key]['Deprecated'] and \
@@ -124,7 +121,7 @@
self.grid.SetCellEditor(i, 0,
RestrictedCellEditor(self.grid,self.attributes[key]))
elif self.attributes[key]['Typecast'] == GTypecast.boolean:
self.grid.SetCellEditor(i, 0,
BoolCellEditor(self.grid,self.attributes[key]))
- elif self.attributes[key]['Typecast'] in (GTypecast.integer,
+ elif self.attributes[key]['Typecast'] in (GTypecast.integer,
GTypecast.number, GTypecast.whole):
self.grid.SetCellEditor(i, 0,
IntCellEditor(self.grid,self.attributes[key]))
else:
@@ -145,7 +142,7 @@
i = i + 1
- # Redraw the grid
+ # Redraw the grid
self.grid.EndBatch()
try:
self.grid.ForceRefresh() # Added in 2.3.1
@@ -173,7 +170,7 @@
pass
- def onSize(self, event):
+ def onSize(self, event):
x,y = self.GetClientSizeTuple()
self.panel.SetSize((x-12,y-12))
self.grid.SetSize(self.panel.GetClientSizeTuple())
@@ -566,7 +563,7 @@
#
#
#
-class PropertyToolFrame(ToolFrame):
+class PropertyToolFrame(ToolFrame):
def __init__(self, instance, title):
ToolFrame.__init__(self, instance, "Property Editor")
Index: gnue/designer/src/ToolFrame.py
diff -u gnue/designer/src/ToolFrame.py:1.4 gnue/designer/src/ToolFrame.py:1.5
--- gnue/designer/src/ToolFrame.py:1.4 Fri Nov 16 20:00:21 2001
+++ gnue/designer/src/ToolFrame.py Mon Nov 19 21:00:16 2001
@@ -30,7 +30,6 @@
import RuntimeSettings
from wxPython.wx import *
from gnue.common import GDebug, GConfig
-from MenuBar import *
#
# Any tool frames inherit from this
Index: gnue/designer/src/TreeView.py
diff -u gnue/designer/src/TreeView.py:1.17 gnue/designer/src/TreeView.py:1.18
--- gnue/designer/src/TreeView.py:1.17 Mon Nov 19 16:17:55 2001
+++ gnue/designer/src/TreeView.py Mon Nov 19 21:00:16 2001
@@ -27,17 +27,16 @@
#
# TODO: all the SetItemImage lines in this file have been commented out as on
win32 it was segfaulting
-import sys, os, time
+import sys, os
from wxPython.wx import *
from gnue.common import GDebug, GConfig
-from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger,
GFLibrary, UIwxpython
-from GFDesigner import *
+from gnue.forms import GFForm, GFObjects, GFTrigger, GFLibrary
from PopupMenu import ObjectMenu
from Icons import treeIconMap, treeIconList
class TreeView (wxTreeCtrl):
- def __init__(self, instance, form, parent):
- wxTreeCtrl.__init__(self, parent, wxNewId(),
+ def __init__(self, instance, form, parent):
+ wxTreeCtrl.__init__(self, parent, wxNewId(),
style=wxTR_HAS_BUTTONS|wxTR_EDIT_LABELS|wxTR_HAS_VARIABLE_ROW_HEIGHT)
self.instance = instance
self.form = form
Index: gnue/designer/src/TriggerEditor.py
diff -u gnue/designer/src/TriggerEditor.py:1.9
gnue/designer/src/TriggerEditor.py:1.10
--- gnue/designer/src/TriggerEditor.py:1.9 Fri Nov 16 20:00:21 2001
+++ gnue/designer/src/TriggerEditor.py Mon Nov 19 21:00:16 2001
@@ -27,11 +27,9 @@
#
-import sys, os, time
from wxPython.wx import *
-from gnue.common import GDebug, GConfig, GParser
-from gnue.forms import GFForm, GFInstance, GFParser, GFObjects, GFTrigger,
GFLibrary, UIwxpython
-from GFDesigner import *
+from gnue.common import GDebug, GParserHelpers
+from gnue.forms import GFTrigger
# What Mode are we in?
@@ -39,18 +37,16 @@
EVENT_TRIGGER = 0
-class TriggerEditor (wxPanel):
+class TriggerEditor (wxPanel):
def __init__(self, parent, instance, form):
width = int(wxSystemSettings_GetSystemMetric( wxSYS_SCREEN_X )/3)
height = int(wxSystemSettings_GetSystemMetric( wxSYS_SCREEN_Y )/3)
-
+
wxPanel.__init__(self, parent, -1)
- self.editor =
wxTextCtrl(self,-1,style=wxTE_PROCESS_TAB|wxTE_MULTILINE|wxHSCROLL,
+ self.editor =
wxTextCtrl(self,-1,style=wxTE_PROCESS_TAB|wxTE_MULTILINE|wxHSCROLL,
pos=wxPoint(0,32))
self.SetSize(parent.GetClientSize())
- #self.SetSize(wxSize(width,height))
self.editor.SetSize(self.GetClientSize())
-# parent.SetSize(self.GetSize())
self.object = None
self.namedTriggerList = []
@@ -62,7 +58,7 @@
self.triggerList = []
EVT_SIZE(self, self._onSize)
# This isn't working! Argh!!!!!
-# EVT_KILL_FOCUS(self.editor, self.OnKillFocus)
+# EVT_KILL_FOCUS(self.editor, self.OnKillFocus)
# So I'll do this instead (slower)
EVT_TEXT(self, self.editor.GetId(), self.OnKillFocus)
self.__ignoreevent = 0
@@ -78,7 +74,7 @@
form.walk(self.inventoryObject)
- def OnNamedTriggerSelected(self, event):
+ def OnNamedTriggerSelected(self, event):
self.instance.onSetCurrentObject(
self.namedTriggerList[event.GetSelection()], __name__)
@@ -87,25 +83,25 @@
w,h = self.GetClientSizeTuple()
self.toolpanel.SetSize(wxSize(w,32))
self.editor.SetSize(wxSize(w,h-32))
+
-
def onSetCurrentObject (self, object, handler):
- if object == None:
+ if object == None:
return
- if isinstance(object, GFTrigger.GFTrigger):
+ if isinstance(object, GFTrigger.GFTrigger):
self.__ignoreevent = 1
self.editor.SetValue(object.getChildrenAsContent())
self.__ignoreevent = 0
self.object = object
if not len(self.object._children):
- GParser.GContent(object, "")
- elif len(self.object._children) > 1:
+ GParserHelpers.GContent(object, "")
+ elif len(self.object._children) > 1:
content = self.object.getChildrenAsContent()
self.object._children = []
- GParser.GContent(self.object, "")
+ GParserHelpers.GContent(self.object, "")
self.editor.SetEditable(1)
-
+
if object.type == 'NAMED':
self.mode = NAMED_TRIGGER
i = 0
@@ -142,7 +138,7 @@
if object == None:
return
- if isinstance(object, GFTrigger.GFTrigger):
+ if isinstance(object, GFTrigger.GFTrigger):
if object.type == 'NAMED':
i = 0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/designer/src GFDesigner.py Incubator.py In...,
Jason Cater <=