VariablePanel.py
changeset 424 d19c4a6460ab
parent 422 31c3dc45cfab
child 425 dbc4a66190a6
--- a/VariablePanel.py	Mon Sep 14 10:57:12 2009 -0600
+++ b/VariablePanel.py	Tue Sep 15 14:06:59 2009 -0600
@@ -35,8 +35,8 @@
 def GetVariableTableColnames(location):
     _ = lambda x : x
     if location:
-    	return ["#", _("Name"), _("Class"), _("Type"), _("Location"), _("Initial Value"), _("Retain"), _("Constant")]
-    return ["#", _("Name"), _("Class"), _("Type"), _("Initial Value"), _("Retain"), _("Constant")]
+    	return ["#", _("Name"), _("Class"), _("Type"), _("Location"), _("Initial Value"), _("Retain"), _("Constant"), _("Documentation")]
+    return ["#", _("Name"), _("Class"), _("Type"), _("Initial Value"), _("Retain"), _("Constant"), _("Documentation")]
 
 def GetAlternativeOptions():
     _ = lambda x : x
@@ -472,30 +472,60 @@
         self.FilterChoices = []
         self.FilterChoiceTransfer = GetFilterChoiceTransfer()
         
+        self.DefaultValue = {   "Name" : "", "Class" : "", "Type" : "INT", "Location" : "",
+                                "Initial Value" : "", "Retain" : "No", "Constant" : "No",
+                                "Documentation" : "", "Edit" : True
+                            }
+
         if element_type in ["config", "resource"]:
             self.DefaultTypes = {"All" : "Global"}
-            self.DefaultValue = {"Name" : "", "Class" : "", "Type" : "INT", "Location" : "", "Initial Value" : "", "Retain" : "No", "Constant" : "No", "Edit" : True}
         else:
             self.DefaultTypes = {"All" : "Local", "Interface" : "Input", "Variables" : "Local"}
-            self.DefaultValue = {"Name" : "", "Class" : "", "Type" : "INT", "Location" : "", "Initial Value" : "", "Retain" : "No", "Constant" : "No", "Edit" : True}
-        if element_type in ["config", "resource"] or element_type in ["program", "transition", "action"]:
+
+        if element_type in ["config", "resource"] \
+        or element_type in ["program", "transition", "action"]:
+            # this is an element that can have located variables
             self.Table = VariableTable(self, [], GetVariableTableColnames(True))
-            if element_type not in ["config", "resource"]:
-                self.FilterChoices = ["All", "Interface", "   Input", "   Output", "   InOut", "   External", "Variables", "   Local", "   Temp"]#,"Access"]
+
+            if element_type in ["config", "resource"]:
+                self.FilterChoices = ["All", "Global"]#,"Access"]
             else:
-                self.FilterChoices = ["All", "Global"]#,"Access"]
-            self.ColSizes = [40, 80, 70, 80, 80, 80, 60, 70]
-            self.ColAlignements = [wx.ALIGN_CENTER, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_CENTER, wx.ALIGN_CENTER]
-        else:
+                self.FilterChoices = ["All",
+                                        "Interface", "   Input", "   Output", "   InOut", "   External",
+                                        "Variables", "   Local", "   Temp"]#,"Access"]
+
+            # these condense the ColAlignements list
+            l = wx.ALIGN_LEFT
+            c = wx.ALIGN_CENTER 
+
+            #                      Num  Name    Class   Type    Loc     Init    Retain  Const   Doc
+            self.ColSizes       = [40,  80,     70,     80,     80,     80,     60,     70,     80]
+            self.ColAlignements = [c,   l,      l,      l,      l,      l,      c,      c,      l]
+
+        else:
+            # this is an element that cannot have located variables
             self.Table = VariableTable(self, [], GetVariableTableColnames(False))
+
             if element_type == "function":
-                self.FilterChoices = ["All", "Interface", "   Input", "   Output", "   InOut", "Variables", "   Local", "   Temp"]
+                self.FilterChoices = ["All",
+                                        "Interface", "   Input", "   Output", "   InOut",
+                                        "Variables", "   Local", "   Temp"]
             else:
-                self.FilterChoices = ["All", "Interface", "   Input", "   Output", "   InOut", "   External", "Variables", "   Local", "   Temp"]
-            self.ColSizes = [40, 120, 70, 80, 120, 60, 70]
-            self.ColAlignements = [wx.ALIGN_CENTER, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_LEFT, wx.ALIGN_CENTER, wx.ALIGN_CENTER]
+                self.FilterChoices = ["All",
+                                        "Interface", "   Input", "   Output", "   InOut", "   External",
+                                        "Variables", "   Local", "   Temp"]
+
+            # these condense the ColAlignements list
+            l = wx.ALIGN_LEFT
+            c = wx.ALIGN_CENTER 
+
+            #                      Num  Name    Class   Type    Init    Retain  Const   Doc
+            self.ColSizes       = [40,  80,     70,     80,     80,     60,     70,     160]
+            self.ColAlignements = [c,   l,      l,      l,      l,      c,      c,      l]
+
         for choice in self.FilterChoices:
             self.ClassFilter.Append(_(choice))
+
         reverse_transfer = {}
         for filter, choice in self.FilterChoiceTransfer.items():
             reverse_transfer[choice] = filter