/[cvs]/nfo/projects/netfraggle/bin/FraggleDialogModules.py
ViewVC logotype

Diff of /nfo/projects/netfraggle/bin/FraggleDialogModules.py

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

revision 1.4 by xabbu, Sun Sep 5 10:09:26 2004 UTC revision 1.5 by xabbu, Sun Sep 5 12:17:20 2004 UTC
# Line 33  class FraggleDialogModules(wxDialog): Line 33  class FraggleDialogModules(wxDialog):
33          self.buttonSaveClose = wxButton(id=wxID_FRAGGLEDIALOGMODULESBUTTONSAVECLOSE,          self.buttonSaveClose = wxButton(id=wxID_FRAGGLEDIALOGMODULESBUTTONSAVECLOSE,
34                label='Save and Close', name='buttonSaveClose', parent=self,                label='Save and Close', name='buttonSaveClose', parent=self,
35                pos=wxPoint(8, 264), size=wxSize(88, 16), style=0)                pos=wxPoint(8, 264), size=wxSize(88, 16), style=0)
36            EVT_BUTTON(self.buttonSaveClose,
37                  wxID_FRAGGLEDIALOGMODULESBUTTONSAVECLOSE,
38                  self.OnButtonSaveCloseButton)
39    
40          self.button1 = wxButton(id=wxID_FRAGGLEDIALOGMODULESBUTTON1,          self.button1 = wxButton(id=wxID_FRAGGLEDIALOGMODULESBUTTON1,
41                label='Cancel', name='button1', parent=self, pos=wxPoint(104,                label='Cancel', name='button1', parent=self, pos=wxPoint(104,
42                264), size=wxSize(72, 16), style=0)                264), size=wxSize(72, 16), style=0)
43    
44      def __init_listbox__(self,parent):      def __init_listbox__(self,parent):
45          #print self.modulesCtl.modules.keys()          
46           try:           try:
47            for i in self.modulesCtl.modules.keys():            for i in self.modulesCtl.modules.keys():
48                self.checkListBoxModules.Append(i)                self.checkListBoxModules.Append(i)
49           except AttributeError:           except AttributeError:
50                print "No Modules found"                  print "No Modules found"  
51            
52             for b in self.selections:
53                 self.checkListBoxModules.Check(self.modulesCtl.modules.keys().index(b))
54                
55                                
56      def __init__(self, parent):      def __init__(self, parent):
57          self.modulesCtl = parent.engine.modules          self.modulesCtl = parent.engine.modules
58            self.selections = self.modulesCtl.LoadModules()
59          self._init_ctrls(parent)          self._init_ctrls(parent)
60          self.__init_listbox__(parent)          self.__init_listbox__(parent)
61            
62      def OnCheckListBoxModulesChecklistbox(self, event):      def OnCheckListBoxModulesChecklistbox(self, event):
63          event.Skip()          try:
64                if self.checkListBoxModules.IsChecked(event.GetInt()):
65                    print "Checked"
66                    self.selections.Append(self.modulesCtl.modules.keys()[event.GetInt()])
67                else:
68                    print "Unchecked"
69                    self.selections.pop(event.GetInt())
70            except AttributeError:
71                self.selections = [self.modulesCtl.modules.keys()[event.GetInt()]]
72            #print event.GetInt()
73                    
74    
75        def OnButtonSaveCloseButton(self, event):
76            self.modulesCtl.SaveModules(self.selections)
77            self.Hide()
78            event.Skip()
79                    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed