main logo
Subject: [dabo-dev] dabodesigner Commit 93
Author: noreply .AT. paulmcnett .DOT com
Posted: 2004/11/30 19:11:48
 
View Entire Thread
New Search


dabodesigner Commit
Revision 93
Date: 2004-11-30 16:11:47 -0800 (Tue, 30 Nov 2004)
Author: paul

Log:
Playing around with the old designer, I got it to save runnable scripts
without error again. My changes are kind of hackish, though.



Changed:
U trunk/oldDesigner/daboDesigner.py

Diff:
Modified: trunk/oldDesigner/daboDesigner.py
===================================================================
--- trunk/oldDesigner/daboDesigner.py 2004-11-19 14:41:35 UTC (rev 92)
+++ trunk/oldDesigner/daboDesigner.py 2004-12-01 00:11:47 UTC (rev 93)
@@ -363,7 +363,7 @@
# Items were just copied, so create new ones
newObjs = []
for obj in self.clipObjects:
- pvDict = self.getPropValDict(obj)
+ pvDict = obj.getProperties()
x,y = obj.GetPosition()
sz = obj.GetSize()
typeID = obj.TypeID
@@ -372,7 +372,7 @@
del pvDict["Name"]

ctl = self.createControl(-1, typeID, (x,y), sz)
- self.applyPropValDict(ctl, pvDict)
+ ctl.setProperties(pvDict)
ctl.TypeID = typeID
ctl.SetPosition( (x+8, y+8) )
newObjs.append(ctl)
@@ -551,13 +551,13 @@
postProps = ""
ignoreProps = ["BaseClass", "Bottom", "Class", "Font", "FontFace", "FontInfo",
"MousePointer", "Parent", "Position", "Right", "Size", "SuperClass",
- "WindowHandle"]
+ "WindowHandle", "EventBindings", "TypeID"]

childTemplate = self.getChildObjTemplate()
clsTemplate = self.getClassTemplate()
ctlParent = ctl.Parent
if ctl is self:
- super = "dPanel"
+ super_ = "dabo.ui.dPanel"
name = "MainPanel"
holder = "%s"
frmWidth = ctl.Width
@@ -565,15 +565,16 @@
else:
className = str(ctl.BaseClass).split("'")[1] # split on the single quotes
# Get the last element when splitting on the periods.
- super = className.split(".")[-1:][0]
+ super_ = "dabo.ui.%s" % className.split(".")[-1]
name = ctl.Name
holder = ""

- junkPanel = dPanel(self)
- plainCtl = eval(super + "(junkPanel)")
+ junkPanel = dabo.ui.dPanel(self)
+ print super_
+ plainCtl = eval(super_ + "(junkPanel)")

- pvd = ctl.getPropValDict(ctl)
- pvdPlain = plainCtl.getPropValDict(plainCtl)
+ pvd = ctl.getProperties()
+ pvdPlain = plainCtl.getProperties()

propKeys = pvd.keys()
propKeys.sort()
@@ -609,7 +610,7 @@
preProps = preProps[:-1]
postProps = postProps[:-1]

- clsDef = clsTemplate % (name, super, name, preProps, postProps)
+ clsDef = clsTemplate % (name, super_, name, preProps, postProps)

if ctl is self:
clsPanel = clsDef + "\n" + childTemplate + "\n"
@@ -1069,17 +1070,19 @@


def getSaveTemplate(self):
- return """import wx
-from dabo.ui import *
+ return """import dabo
+dabo.ui.loadUI("wx")

%s
if __name__ == "__main__":
- app = wx.PySimpleApp()
- form = dForm(None)
+ app = dabo.dApp()
+ app.MainFormClass = None
+ app.setup()
+ form = dabo.ui.dForm(None)
form.SetSize( (%s, %s) )
form.addObject(MainPanel, "MainPanel")
form.Show(True)
- app.MainLoop()
+ app.start()
"""





 
©2004 noreply .at. paulmcnett D.O.T com
<-- Prior Message New Search Next Message -->