dabo Commit
Revision 5159
Date: 2009-03-31 10:38:20 -0700 (Tue, 31 Mar 2009)
Author: Paul
Trac: http://trac.dabodev.com/changeset/5159
Changed:
U trunk/ide/ReportDesigner.py
Log:
After changing the expr of a report object, the object tree wouldn't reflect
the new name without fiddling. Fixed.
Diff:
Modified: trunk/ide/ReportDesigner.py
===================================================================
--- trunk/ide/ReportDesigner.py 2009-03-30 21:22:19 UTC (rev 5158)
+++ trunk/ide/ReportDesigner.py 2009-03-31 17:38:20 UTC (rev 5159)
@@ -663,17 +663,7 @@
return
if isinstance(frm, dict):
- expr = rdc.getShortExpr(frm.get("expr", ""))
- caption = frm.__class__.__name__
- if expr:
- if caption.lower() in ("group",):
- caption = expr
- elif caption.lower() in ("variable",):
- caption = frm.getProp("Name",
evaluate=False)
- else:
- expr = ": %s" % expr
- caption = "%s%s" %
(frm.__class__.__name__, expr)
- node = parentNode.appendChild(caption)
+ node = parentNode.appendChild(self.getNodeCaption(frm))
node.ReportObject = frm
node.FontSize = fontSize
for child in frm.get("Objects", []):
@@ -683,13 +673,26 @@
self.recurseLayout(frm=frm[band],
parentNode=node)
elif frm.__class__.__name__ in ("Variables", "Groups",
"TestCursor"):
- caption = frm.__class__.__name__
- node = parentNode.appendChild(caption)
+ node = parentNode.appendChild(self.getNodeCaption(frm))
node.ReportObject = frm
node.FontSize = fontSize
for child in frm:
self.recurseLayout(frm=child, parentNode=node)
+ def getNodeCaption(self, frm):
+ caption = frm.__class__.__name__
+ if not frm.__class__.__name__ in ("Variables", "Groups",
"TestCursor"):
+ expr = rdc.getShortExpr(frm.get("expr", ""))
+ if expr:
+ if caption.lower() in ("group",):
+ caption = expr
+ elif caption.lower() in ("variable",):
+ caption = frm.getProp("Name",
evaluate=False)
+ else:
+ expr = ": %s" % expr
+ caption = "%s%s" %
(frm.__class__.__name__, expr)
+ return caption
+
def refreshSelection(self):
"""Iterate through the nodes, and set their Selected status
to match if they are in the current selection of controls.
@@ -718,7 +721,10 @@
if selNodes:
self.showNode(selNodes[0])
-
+ def refreshCaption(self):
+ """Iterate the Selection, and refresh the Caption."""
+ for node in self.Selection:
+ node.Caption = self.getNodeCaption(node.ReportObject)
class ObjectTreeForm(DesignerControllerForm):
def initProperties(self):
@@ -761,6 +767,7 @@
if isinstance(obj, Group) and prop.lower() == "expr":
reInit = True
rdc.ActiveEditor.propsChanged(reinit=reInit)
+ rdc.ObjectTree.refreshCaption()
def refreshSelection(self):
objs = rdc.SelectedObjects
_______________________________________________
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]