Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/waxy/progressdialog.py
blob: e43f96e71ed7168262a0a595d553413ebefc854c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# progressdialog.py

import wx
import waxyobject

class ProgressDialog(wx.ProgressDialog, waxyobject.WaxyObject):

    def __init__(self,parent=None,title="Progress", message="Progress", 
                  maximum=100,abort=1,modal=1,show_elapsed_time=1,show_remaining_time=1):
        style = 0
        if abort:
            style |= wx.PD_CAN_ABORT
        if modal:
            style |= wx.PD_APP_MODAL
        if show_elapsed_time:
            style |= wx.PD_ELAPSED_TIME
        if show_remaining_time:
            style |= wx.PD_REMAINING_TIME
        wx.ProgressDialog.__init__(self, title, message,
                        maximum, parent,style)

    def ShowModal(self):
        """ Simplified ShowModal(), returning strings 'ok' or 'cancel'. """
        result = wx.ProgressDialog.ShowModal(self)
        if result == wx.ID_OK:
            return 'ok'
        else:
            return 'cancel'