/[thuban]/trunk/thuban/Thuban/UI/classifier.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/UI/classifier.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1302 by jonathan, Wed Jun 25 09:39:33 2003 UTC revision 1307 by jonathan, Thu Jun 26 17:00:17 2003 UTC
# Line 961  class Classifier(NonModalNonParentDialog Line 961  class Classifier(NonModalNonParentDialog
961    
962          self.__SetGridTable(newIndex, group)          self.__SetGridTable(newIndex, group)
963    
964          self.__EnableButtons(EB_SELECT_FIELD, newIndex != 0)          self.__EnableButtons(EB_SELECT_FIELD)
965    
966          self.__SetFieldTypeText(newIndex)          self.__SetFieldTypeText(newIndex)
967    
# Line 1038  class Classifier(NonModalNonParentDialog Line 1038  class Classifier(NonModalNonParentDialog
1038    
1039          EVT_CLOSE(self.genDlg, self._OnGenDialogClose)          EVT_CLOSE(self.genDlg, self._OnGenDialogClose)
1040    
1041          self.__EnableButtons(EB_GEN_CLASS, False)          self.__EnableButtons(EB_GEN_CLASS)
1042    
1043          self.genDlg.Show()          self.genDlg.Show()
1044    
1045      def _OnGenDialogClose(self, event):      def _OnGenDialogClose(self, event):
1046          self.genDlg.Destroy()          self.genDlg.Destroy()
1047          self.__EnableButtons(EB_GEN_CLASS, True)          self.genDlg = None
1048            self.__EnableButtons(EB_GEN_CLASS)
1049    
1050      def _OnMoveUp(self, event):      def _OnMoveUp(self, event):
1051          sel = self.classGrid.GetCurrentSelection()          sel = self.classGrid.GetCurrentSelection()
# Line 1082  class Classifier(NonModalNonParentDialog Line 1083  class Classifier(NonModalNonParentDialog
1083          self.layer.SetTitle(obj.GetValue())          self.layer.SetTitle(obj.GetValue())
1084          self.__SetTitle(self.layer.Title())          self.__SetTitle(self.layer.Title())
1085    
1086          self.__EnableButtons(EB_LAYER_TITLE, self.layer.Title() != "")          self.__EnableButtons(EB_LAYER_TITLE)
1087    
1088      def __EnableButtons(self, case, enable):      def __EnableButtons(self, case):
1089    
1090            list = {wxID_OK                 : True,
1091                    wxID_CANCEL             : True,
1092                    ID_PROPERTY_ADD         : True,
1093                    ID_PROPERTY_MOVEUP      : True,
1094                    ID_PROPERTY_MOVEDOWN    : True,
1095                    ID_PROPERTY_REMOVE      : True,
1096                    ID_PROPERTY_SELECT      : True,
1097                    ID_PROPERTY_FIELDTEXT   : True,
1098                    ID_PROPERTY_GENCLASS    : True,
1099                    ID_PROPERTY_EDITSYM     : True}
1100    
1101          if case == EB_LAYER_TITLE:            if case == EB_LAYER_TITLE:  
1102              list = (wxID_OK,              if self.layer.Title() == "":
1103                      wxID_CANCEL)                  list[wxID_OK] = False
1104                    list[wxID_CANCEL] = False
1105    
1106          elif case == EB_SELECT_FIELD:          elif case == EB_SELECT_FIELD:
1107              list = (ID_PROPERTY_GENCLASS,              if self.fields.GetSelection() == 0:
1108                      ID_PROPERTY_ADD,                  list[ID_PROPERTY_GENCLASS] = False
1109                      ID_PROPERTY_MOVEUP,                  list[ID_PROPERTY_ADD] = False
1110                      ID_PROPERTY_MOVEDOWN,                  list[ID_PROPERTY_MOVEUP] = False
1111                      ID_PROPERTY_EDITSYM,                  list[ID_PROPERTY_MOVEDOWN] = False
1112                      ID_PROPERTY_REMOVE)                  list[ID_PROPERTY_REMOVE] = False
1113    
1114          elif case == EB_GEN_CLASS:          elif case == EB_GEN_CLASS:
1115              list = (ID_PROPERTY_SELECT,              if self.genDlg is not None:
1116                      ID_PROPERTY_FIELDTEXT,                  list[ID_PROPERTY_SELECT] = False
1117                      ID_PROPERTY_GENCLASS,                  list[ID_PROPERTY_FIELDTEXT] = False
1118                      ID_PROPERTY_EDITSYM)                  list[ID_PROPERTY_GENCLASS] = False
1119    
1120          for id in list:          for id, enable in list.items():
1121              self.FindWindowById(id).Enable(enable)              win = self.FindWindowById(id)
1122                if win:
1123                    win.Enable(enable)
1124    
1125  ID_SELPROP_SPINCTRL = 4002  ID_SELPROP_SPINCTRL = 4002
1126  ID_SELPROP_PREVIEW = 4003  ID_SELPROP_PREVIEW = 4003

Legend:
Removed from v.1302  
changed lines
  Added in v.1307

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26