commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5797 - trunk/gnue-designer/src/forms


From: jcater
Subject: r5797 - trunk/gnue-designer/src/forms
Date: Sat, 8 May 2004 23:14:47 -0500 (CDT)

Author: jcater
Date: 2004-05-08 23:14:46 -0500 (Sat, 08 May 2004)
New Revision: 5797

Modified:
   trunk/gnue-designer/src/forms/Instance.py
   trunk/gnue-designer/src/forms/PropertyEditor.py
Log:
added a datasource tab to the property editor when a block is currently selected

Modified: trunk/gnue-designer/src/forms/Instance.py
===================================================================
--- trunk/gnue-designer/src/forms/Instance.py   2004-05-09 03:27:10 UTC (rev 
5796)
+++ trunk/gnue-designer/src/forms/Instance.py   2004-05-09 04:14:46 UTC (rev 
5797)
@@ -315,8 +315,8 @@
     else:
       valid = 0  # No blocks! :(
 
-    if not valid: 
-      if wxMessageDialog(self, 
+    if not valid:
+      if wxMessageDialog(self,
           _('The form definition you are about to save\n' + \
           'does not appear to be a workable definition.' + \
           '\n\nIf you save an incomplete definition, you\n' + \

Modified: trunk/gnue-designer/src/forms/PropertyEditor.py
===================================================================
--- trunk/gnue-designer/src/forms/PropertyEditor.py     2004-05-09 03:27:10 UTC 
(rev 5796)
+++ trunk/gnue-designer/src/forms/PropertyEditor.py     2004-05-09 04:14:46 UTC 
(rev 5797)
@@ -49,7 +49,7 @@
     except KeyError:
       if self.object._type == 'GFLabel':
         raise
-      layout = 0
+      layout = False
 
     #
     # GFEntry?  Show the corresponding GFField
@@ -60,10 +60,14 @@
       if self.object._block:
         self.addPage(EntryBlockInspectorPanel(self, self.notebook), "Block")
 
-    # Block?
-    if self.object.findParentOfType('GFBlock',includeSelf=0):
+    # Child of Block?
+    if self.object.findParentOfType('GFBlock',includeSelf=False):
       self.addPage(BlockInspectorPanel(self, self.notebook), "Block")
 
+    # Block?
+    if self.object._type == 'GFBlock' and hasattr(self.object,'datasource') \
+        and self.object.datasource and hasattr(self.instance,'datasources'):
+      self.addPage(DatasourceInspectorPanel(self, self.notebook), "Data 
Source")
 
     # Add layout
     if self.object._type == 'GFLayout':
@@ -97,6 +101,17 @@
     self._setCurrent(object._block)
 
 #
+# Datasource properties (when Block is selected)
+#
+class DatasourceInspectorPanel(BaseInspectorPanel):
+  def setCurrent(self, object):
+    try:
+      if hasattr(object,'datasource') and object.datasource:
+        self._setCurrent(self.editor.instance.datasources[object.datasource])
+    except AttributeError:
+      pass  # Happens on startup
+
+#
 # Character-cell layout (x,y) properties
 #
 class CharPosInspectorPanel(BaseInspectorPanel):
@@ -111,7 +126,7 @@
        'Char:height': { 'Typecast': GTypecast.whole } }
 
   def getPageText(self):
-    return "Layout"
+    return "Display"
 
 #
 # Character-cell layout (x,y) properties
@@ -126,4 +141,4 @@
        'Char:height': { 'Typecast': GTypecast.whole } }
 
   def getPageText(self):
-    return "Layout"
+    return "Display"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]