149 |
|
|
150 |
return completed |
return completed |
151 |
|
|
152 |
|
def cancel(self): |
153 |
|
self.wizard.EndModal(0) |
154 |
|
|
155 |
|
|
156 |
class WizardPage(wxPanel): |
class WizardPage(wxPanel): |
157 |
def __init__(self, parser, parent): |
def __init__(self, parser, parent): |
310 |
|
|
311 |
if self.parser.template.variables.has_key(object.variable): |
if self.parser.template.variables.has_key(object.variable): |
312 |
o.set(self.parser.template.variables[object.variable]) |
o.set(self.parser.template.variables[object.variable]) |
313 |
|
|
314 |
# Add our buttons to the focus list |
# Add our buttons to the focus list |
315 |
if self.prevStep: |
if self.prevStep: |
316 |
self.textctrlList.append(self.parser.prevButton) |
self.textctrlList.append(self.parser.prevButton) |
577 |
|
|
578 |
self.OnSelectRight(None) |
self.OnSelectRight(None) |
579 |
|
|
580 |
|
|
581 |
def OnRemove(self, event): |
def OnRemove(self, event): |
582 |
sel = list(self.list2.GetSelections()) |
sel = list(self.list2.GetSelections()) |
583 |
sel.sort(lambda a,b : cmp (b,a)) |
sel.sort(lambda a,b : cmp (b,a)) |
635 |
self.template = template |
self.template = template |
636 |
self.instance = instance |
self.instance = instance |
637 |
instance.registerEventListeners( |
instance.registerEventListeners( |
638 |
{ 'Wizard:%s' % template['BaseID']: self.run } ) |
{ 'Wizard:%s' % template['BaseID']: self.run, |
639 |
|
'Cancel:Wizard:%s' % template['BaseID']: self.cancel } ) |
640 |
|
|
641 |
def run(self, event): |
def run(self, event, *args, **parms): |
642 |
self.instance.dispatchEvent('BeginWizard', template=self.template) |
self.instance.dispatchEvent('BeginWizard', template=self.template) |
643 |
self.instance.dispatchEvent('BeginUndoGroup') |
self.instance.dispatchEvent('BeginUndoGroup') |
644 |
TemplateParser(self.instance, self.instance.rootObject, |
self.parser = TemplateParser(self.instance, self.instance.rootObject, |
645 |
self.instance, self.template).run() |
self.instance, self.template) |
646 |
|
self.parser.run(*args, **parms) |
647 |
self.instance.dispatchEvent('EndUndoGroup') |
self.instance.dispatchEvent('EndUndoGroup') |
648 |
self.instance.dispatchEvent(Event('EndWizard', template=self.template)) |
self.instance.dispatchEvent('EndWizard', template=self.template) |
649 |
|
|
650 |
|
def cancel(self, event=None): |
651 |
|
self.parser.cancel() |
652 |
|
|
653 |
def finalize(self): |
def finalize(self): |
654 |
pass |
pass |
655 |
|
|
|
|
|
656 |
class WrappedStaticText(wxStaticText): |
class WrappedStaticText(wxStaticText): |
657 |
def __init__(self, parent, id, label, width, *args, **params): |
def __init__(self, parent, id, label, width, *args, **params): |
658 |
wxStaticText.__init__(self, parent, id, "bah!", *args, **params) |
wxStaticText.__init__(self, parent, id, "bah!", *args, **params) |