VariablePanel.py
changeset 509 6f72513bc074
parent 507 42150e041dbe
child 520 7ca6c3e076f7
equal deleted inserted replaced
508:01f49e491be5 509:6f72513bc074
    69     _ = lambda x : x
    69     _ = lambda x : x
    70     return {_("All"): _("All"), _("Interface"): _("Interface"), 
    70     return {_("All"): _("All"), _("Interface"): _("Interface"), 
    71             _("   Input"): _("Input"), _("   Output"): _("Output"), _("   InOut"): _("InOut"), 
    71             _("   Input"): _("Input"), _("   Output"): _("Output"), _("   InOut"): _("InOut"), 
    72             _("   External"): _("External"), _("Variables"): _("Variables"), _("   Local"): _("Local"),
    72             _("   External"): _("External"), _("Variables"): _("Variables"), _("   Local"): _("Local"),
    73             _("   Temp"): _("Temp"), _("Global"): _("Global")}#, _("Access") : _("Access")}
    73             _("   Temp"): _("Temp"), _("Global"): _("Global")}#, _("Access") : _("Access")}
       
    74 VARIABLE_CHOICES_DICT = dict([(_(_class), _class) for _class in GetFilterChoiceTransfer().iterkeys()])
    74 VARIABLE_CLASSES_DICT = dict([(_(_class), _class) for _class in GetFilterChoiceTransfer().itervalues()])
    75 VARIABLE_CLASSES_DICT = dict([(_(_class), _class) for _class in GetFilterChoiceTransfer().itervalues()])
    75 
    76 
    76 CheckOptionForClass = {"Local": lambda x: x,
    77 CheckOptionForClass = {"Local": lambda x: x,
    77                        "Temp": lambda x: "",
    78                        "Temp": lambda x: "",
    78                        "Input": lambda x: {"Retain": "Retain", "Non-Retain": "Non-Retain"}.get(x, ""),
    79                        "Input": lambda x: {"Retain": "Retain", "Non-Retain": "Non-Retain"}.get(x, ""),
   253                     grid.SetCellTextColour(row, col, wx.RED)
   254                     grid.SetCellTextColour(row, col, wx.RED)
   254                     grid.MakeCellVisible(row, col)
   255                     grid.MakeCellVisible(row, col)
   255                 else:
   256                 else:
   256                     grid.SetCellTextColour(row, col, wx.BLACK)
   257                     grid.SetCellTextColour(row, col, wx.BLACK)
   257                     grid.SetCellBackgroundColour(row, col, wx.WHITE)
   258                     grid.SetCellBackgroundColour(row, col, wx.WHITE)
       
   259             if wx.Platform == '__WXMSW__':
       
   260                 grid.SetRowMinimalHeight(row, 20)
       
   261             else:
       
   262                 grid.SetRowMinimalHeight(row, 28)
       
   263             grid.AutoSizeRow(row, False)
   258     
   264     
   259     def SetData(self, data):
   265     def SetData(self, data):
   260         self.data = data
   266         self.data = data
   261     
   267     
   262     def GetData(self):
   268     def GetData(self):
   636         self.ParentWindow.RefreshEditor(variablepanel = False)
   642         self.ParentWindow.RefreshEditor(variablepanel = False)
   637         self.ParentWindow._Refresh(TITLE, FILEMENU, EDITMENU, INSTANCESTREE, LIBRARYTREE)
   643         self.ParentWindow._Refresh(TITLE, FILEMENU, EDITMENU, INSTANCESTREE, LIBRARYTREE)
   638         event.Skip()
   644         event.Skip()
   639     
   645     
   640     def OnClassFilter(self, event):
   646     def OnClassFilter(self, event):
   641         self.Filter = self.FilterChoiceTransfer[self.ClassFilter.GetStringSelection()]
   647         self.Filter = self.FilterChoiceTransfer[VARIABLE_CHOICES_DICT[self.ClassFilter.GetStringSelection()]]
   642         self.RefreshTypeList()
   648         self.RefreshTypeList()
   643         self.RefreshValues()
   649         self.RefreshValues()
   644         self.RefreshButtons()
   650         self.RefreshButtons()
   645         event.Skip()
   651         event.Skip()
   646 
   652