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 |
for i in self.modulesCtl.modules.keys(): |
try: |
47 |
self.checkListBoxModules.Append(i) |
for i in self.modulesCtl.modules: |
48 |
|
self.checkListBoxModules.Append(i) |
49 |
|
if self.selections: |
50 |
|
for b in self.selections: |
51 |
|
self.checkListBoxModules.Check(self.modulesCtl.modules.keys().index(b)) |
52 |
|
except AttributeError: |
53 |
|
print "No Modules found" |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
def __init__(self, parent): |
def __init__(self, parent): |
59 |
self.modulesCtl = parent.engine.modules |
self.modulesCtl = parent.engine.modules |
60 |
|
self.selections = self.modulesCtl.LoadModules() |
61 |
self._init_ctrls(parent) |
self._init_ctrls(parent) |
62 |
self.__init_listbox__(parent) |
self.__init_listbox__(parent) |
63 |
|
|
64 |
def OnCheckListBoxModulesChecklistbox(self, event): |
def OnCheckListBoxModulesChecklistbox(self, event): |
65 |
event.Skip() |
try: |
66 |
|
if self.checkListBoxModules.IsChecked(event.GetInt()): |
67 |
|
print "Checked" |
68 |
|
self.selections.Append(self.modulesCtl.modules.keys()[event.GetInt()]) |
69 |
|
else: |
70 |
|
print "Unchecked" |
71 |
|
self.selections.pop(event.GetInt()) |
72 |
|
except AttributeError: |
73 |
|
self.selections = [self.modulesCtl.modules.keys()[event.GetInt()]] |
74 |
|
#print event.GetInt() |
75 |
|
|
76 |
|
|
77 |
|
def OnButtonSaveCloseButton(self, event): |
78 |
|
self.modulesCtl.SaveModules(self.selections) |
79 |
|
self.Hide() |
80 |
|
event.Skip() |
81 |
|
|