parameters: (self, parent=None, id=-1, title="", message="",
                   agwStyle=wx.PD_APP_MODAL|wx.PD_AUTO_HIDE)
docstring: Default class constructor.
  
          :param `parent`: parent window;
          :param `id`: window identifier. A value of -1 indicates a default value;
          :param `title`: dialog title to show in titlebar;
          :param `message`: message displayed above the progress bar;
          :param `style`: the dialog style. This can be a combination of the following bits:
  
           =================== =========== ==================================================
           Window Styles       Hex Value   Description
           =================== =========== ==================================================
           ``PD_CAN_ABORT``            0x1 This flag tells the dialog that it should have a ``Cancel`` button which the user may press. If this happens, the next call to `UpdatePulse` will return ``False``.
           ``PD_APP_MODAL``            0x2 Make the progress dialog modal. If this flag is not given, it is only 'locally' modal - that is the input to the parent window is disabled, but not to the other ones.
           ``PD_AUTO_HIDE``            0x4 Causes the progress dialog to disappear from screen as soon as the maximum value of the progress meter has been reached.
           ``PD_ELAPSED_TIME``         0x8 This flag tells the dialog that it should show elapsed time (since creating the dialog).
           =================== =========== ==================================================
docstring_summary: Default class constructor.
docstring_tokens: Default class constructor .
function: def __init__(self, parent=None, id=-1, title="", message="",
                   agwStyle=wx.PD_APP_MODAL|wx.PD_AUTO_HIDE):
          """
          Default class constructor.
  
          :param `parent`: parent window;
          :param `id`: window identifier. A value of -1 indicates a default value;
          :param `title`: dialog title to show in titlebar;
          :param `message`: message displayed above the progress bar;
          :param `style`: the dialog style. This can be a combination of the following bits:
  
           =================== =========== ==================================================
           Window Styles       Hex Value   Description
           =================== =========== ==================================================
           ``PD_CAN_ABORT``            0x1 This flag tells the dialog that it should have a ``Cancel`` button which the user may press. If this happens, the next call to `UpdatePulse` will return ``False``.
           ``PD_APP_MODAL``            0x2 Make the progress dialog modal. If this flag is not given, it is only 'locally' modal - that is the input to the parent window is disabled, but not to the other ones.
           ``PD_AUTO_HIDE``            0x4 Causes the progress dialog to disappear from screen as soon as the maximum value of the progress meter has been reached.
           ``PD_ELAPSED_TIME``         0x8 This flag tells the dialog that it should show elapsed time (since creating the dialog).
           =================== =========== ==================================================
           
          """
  
          wx.Dialog.__init__(self, parent, id, title)
          
          self._delay = 3
          self._hasAbortButton = False
  
          # we may disappear at any moment, let the others know about it
          self.SetExtraStyle(self.GetExtraStyle()|wx.WS_EX_TRANSIENT)
  
          self._hasAbortButton = (agwStyle & wx.PD_CAN_ABORT)
  
          if wx.Platform == "__WXMSW__":
              # we have to remove the "Close" button from the title bar then as it is
              # confusing to have it - it doesn't work anyhow
              # FIXME: should probably have a (extended?) window style for this
              if not self._hasAbortButton:
                  self.EnableClose(False)
      
          self._state = (self._hasAbortButton and [Continue] or [Uncancelable])[0]
          self._parentTop = wx.GetTopLevelParent(parent)
  
          dc = wx.ClientDC(self)
          dc.SetFont(wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT))
          widthText, dummy = dc.GetTextExtent(message)
  
          sizer = wx.BoxSizer(wx.VERTICAL)
  
          self._msg = wx.StaticText(self, wx.ID_ANY, message)
          sizer.Add(self._msg, 0, wx.LEFT|wx.TOP, 2*LAYOUT_MARGIN)
  
          sizeDlg = wx.Size()
          sizeLabel = self._msg.GetSize()
          sizeDlg.y = 2*LAYOUT_MARGIN + sizeLabel.y
  
          self._gauge = ProgressGauge(self, -1)
  
          sizer.Add(self._gauge, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 2*LAYOUT_MARGIN)
  
          sizeGauge = self._gauge.GetSize()
          sizeDlg.y += 2*LAYOUT_MARGIN + sizeGauge.y
          
          # create the estimated/remaining/total time zones if requested
          self._elapsed = None
          self._display_estimated = self._last_timeupdate = self._break = 0
          self._ctdelay = 0
  
          label = None
  
          nTimeLabels = 0
  
          if agwStyle & wx.PD_ELAPSED_TIME:
          
              nTimeLabels += 1
              self._elapsed = self.CreateLabel("Elapsed time : ", sizer)
          
          if nTimeLabels > 0:
  
              label = wx.StaticText(self, -1, "")    
              # set it to the current time
              self._timeStart = wx.GetCurrentTime()
              sizeDlg.y += nTimeLabels*(label.GetSize().y + LAYOUT_MARGIN)
              label.Destroy()
  
          sizeDlgModified = False
          
          if wx.Platform == "__WXMSW__":
              sizerFlags = wx.ALIGN_RIGHT|wx.ALL
          else:
              sizerFlags = wx.ALIGN_CENTER_HORIZONTAL|wx.BOTTOM|wx.TOP
  
          if self._hasAbortButton:
              buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
      
              self._btnAbort = wx.Button(self, -1, "Cancel")
              self._btnAbort.Bind(wx.EVT_BUTTON, self.OnCancel)
              
              # Windows dialogs usually have buttons in the lower right corner
              buttonSizer.Add(self._btnAbort, 0, sizerFlags, LAYOUT_MARGIN)
  
              if not sizeDlgModified:
                  sizeDlg.y += 2*LAYOUT_MARGIN + wx.Button.GetDefaultSize().y
  
          if self._hasAbortButton:
              sizer.Add(buttonSizer, 0, sizerFlags, LAYOUT_MARGIN )
  
          self.Bind(wx.EVT_CLOSE, self.OnClose)
          self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy)
          
          self._agwStyle = agwStyle
          
          self.SetSizerAndFit(sizer)
      
          sizeDlg.y += 2*LAYOUT_MARGIN
  
          # try to make the dialog not square but rectangular of reasonable width
          sizeDlg.x = max(widthText, 4*sizeDlg.y/3)
          sizeDlg.x *= 3
          sizeDlg.x /= 2
          self.SetClientSize(sizeDlg)
      
          self.Centre(wx.CENTER_FRAME|wx.BOTH)
  
          if agwStyle & wx.PD_APP_MODAL:
              self._winDisabler = wx.WindowDisabler(self)
          else:
              if self._parentTop:
                  self._parentTop.Disable()
              self._winDisabler = None
      
          self.ShowDialog()
          self.Enable()
  
          # this one can be initialized even if the others are unknown for now
          # NB: do it after calling Layout() to keep the labels correctly aligned
          if self._elapsed:
              self.SetTimeLabel(0, self._elapsed)
  
          if not wx.EventLoop().GetActive():
              self.evtloop = wx.EventLoop()
              wx.EventLoop.SetActive(self.evtloop)
          
          self.Update()
function_tokens: def __init__ ( self , parent = None , id = - 1 , title = "" , message = "" , agwStyle = wx . PD_APP_MODAL | wx . PD_AUTO_HIDE ) : wx . Dialog . __init__ ( self , parent , id , title ) self . _delay = 3 self . _hasAbortButton = False # we may disappear at any moment, let the others know about it self . SetExtraStyle ( self . GetExtraStyle ( ) | wx . WS_EX_TRANSIENT ) self . _hasAbortButton = ( agwStyle & wx . PD_CAN_ABORT ) if wx . Platform == "__WXMSW__" : # we have to remove the "Close" button from the title bar then as it is # confusing to have it - it doesn't work anyhow # FIXME: should probably have a (extended?) window style for this if not self . _hasAbortButton : self . EnableClose ( False ) self . _state = ( self . _hasAbortButton and [ Continue ] or [ Uncancelable ] ) [ 0 ] self . _parentTop = wx . GetTopLevelParent ( parent ) dc = wx . ClientDC ( self ) dc . SetFont ( wx . SystemSettings_GetFont ( wx . SYS_DEFAULT_GUI_FONT ) ) widthText , dummy = dc . GetTextExtent ( message ) sizer = wx . BoxSizer ( wx . VERTICAL ) self . _msg = wx . StaticText ( self , wx . ID_ANY , message ) sizer . Add ( self . _msg , 0 , wx . LEFT | wx . TOP , 2 * LAYOUT_MARGIN ) sizeDlg = wx . Size ( ) sizeLabel = self . _msg . GetSize ( ) sizeDlg . y = 2 * LAYOUT_MARGIN + sizeLabel . y self . _gauge = ProgressGauge ( self , - 1 ) sizer . Add ( self . _gauge , 0 , wx . LEFT | wx . RIGHT | wx . TOP | wx . EXPAND , 2 * LAYOUT_MARGIN ) sizeGauge = self . _gauge . GetSize ( ) sizeDlg . y += 2 * LAYOUT_MARGIN + sizeGauge . y # create the estimated/remaining/total time zones if requested self . _elapsed = None self . _display_estimated = self . _last_timeupdate = self . _break = 0 self . _ctdelay = 0 label = None nTimeLabels = 0 if agwStyle & wx . PD_ELAPSED_TIME : nTimeLabels += 1 self . _elapsed = self . CreateLabel ( "Elapsed time : " , sizer ) if nTimeLabels > 0 : label = wx . StaticText ( self , - 1 , "" ) # set it to the current time self . _timeStart = wx . GetCurrentTime ( ) sizeDlg . y += nTimeLabels * ( label . GetSize ( ) . y + LAYOUT_MARGIN ) label . Destroy ( ) sizeDlgModified = False if wx . Platform == "__WXMSW__" : sizerFlags = wx . ALIGN_RIGHT | wx . ALL else : sizerFlags = wx . ALIGN_CENTER_HORIZONTAL | wx . BOTTOM | wx . TOP if self . _hasAbortButton : buttonSizer = wx . BoxSizer ( wx . HORIZONTAL ) self . _btnAbort = wx . Button ( self , - 1 , "Cancel" ) self . _btnAbort . Bind ( wx . EVT_BUTTON , self . OnCancel ) # Windows dialogs usually have buttons in the lower right corner buttonSizer . Add ( self . _btnAbort , 0 , sizerFlags , LAYOUT_MARGIN ) if not sizeDlgModified : sizeDlg . y += 2 * LAYOUT_MARGIN + wx . Button . GetDefaultSize ( ) . y if self . _hasAbortButton : sizer . Add ( buttonSizer , 0 , sizerFlags , LAYOUT_MARGIN ) self . Bind ( wx . EVT_CLOSE , self . OnClose ) self . Bind ( wx . EVT_WINDOW_DESTROY , self . OnDestroy ) self . _agwStyle = agwStyle self . SetSizerAndFit ( sizer ) sizeDlg . y += 2 * LAYOUT_MARGIN # try to make the dialog not square but rectangular of reasonable width sizeDlg . x = max ( widthText , 4 * sizeDlg . y / 3 ) sizeDlg . x *= 3 sizeDlg . x /= 2 self . SetClientSize ( sizeDlg ) self . Centre ( wx . CENTER_FRAME | wx . BOTH ) if agwStyle & wx . PD_APP_MODAL : self . _winDisabler = wx . WindowDisabler ( self ) else : if self . _parentTop : self . _parentTop . Disable ( ) self . _winDisabler = None self . ShowDialog ( ) self . Enable ( ) # this one can be initialized even if the others are unknown for now # NB: do it after calling Layout() to keep the labels correctly aligned if self . _elapsed : self . SetTimeLabel ( 0 , self . _elapsed ) if not wx . EventLoop ( ) . GetActive ( ) : self . evtloop = wx . EventLoop ( ) wx . EventLoop . SetActive ( self . evtloop ) self . Update ( )