Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

dlgProgress Class Reference

Progress dialog which shows a moving progress bar. More...

#include <dlgProgress.hpp>

List of all members.

Public Member Functions

void createControls (const wxString &message=wxEmptyString)
 Creates and initializes the controls of the dialog.

 dlgProgress (const wxString &title, const wxString &message, int maximum=100, wxWindow *parent=NULL, int style=wxPD_APP_MODAL|wxPD_AUTO_HIDE)
 Creates and displays dialog, disables event handling for other frames or parent frame to avoid recursion problems.

bool isPaused () const
 Is the user has clicked on Pause ?

void Resume ()
 Can be called to continue after the Cancel button has been pressed.

bool Show (bool show=true)
 Shows the dialog.

bool Update (int value, const wxString &newmsg=wxEmptyString)
 Update the status bar to the new value.

virtual ~dlgProgress ()
 The class descructor.


Protected Types

enum  { BTN_PAUSE }
 Controls IDs. More...

enum  State {
  Uncancelable = -1, Paused, Canceled, Continue,
  Finished
}
 Continue processing or not (return value for Update()). More...


Protected Member Functions

void btnCancelClick (wxCommandEvent &event)
 Processes button Cancel.

void btnPauseClick (wxCommandEvent &event)
 Processes button Pause.

void FrameClose (wxCloseEvent &event)
 Event handler to respond to system close events.

void ReenableOtherWindows ()
 Reenables the other windows temporarily disabled while the dialog was shown.

void SetTimeLabel (unsigned long val, wxStaticText *label)
 Updates the label to show the given time (in seconds).


Protected Attributes

wxButton * btnCancel
 Cancel and close button.

wxButton * btnPause
 Pause button.

wxWindow * ctrParentTop
 Parent top level window (may be NULL).

wxGauge * gauProgress
 Progress bar.

wxStaticText * lblElapsed
 Elapsed time.

wxStaticText * lblEstimated
 Estimated time.

wxStaticText * lblMessage
 The message displayed.

wxStaticText * lblRemaining
 Remaining time.

int maximum
 The maximum value.

enum dlgProgress::State state
 Continue processing or not (return value for Update()).

unsigned long timeStart
 Time when the dialog was created.

wxWindowDisabler * winDisabler
 Disable all others windows (for wxPD_APP_MODAL case).


Private Member Functions

 dlgProgress ()
 Default constructor. Don't use it.

virtual void Update ()
 Virtual function hiding supression.


Detailed Description

Progress dialog which shows a moving progress bar.

Taken from wxWidgets.

Definition at line 50 of file dlgProgress.hpp.


Member Enumeration Documentation

anonymous enum [protected]
 

Controls IDs.

Definition at line 84 of file dlgProgress.hpp.

enum dlgProgress::State [protected]
 

Continue processing or not (return value for Update()).

Definition at line 97 of file dlgProgress.hpp.


Constructor & Destructor Documentation

dlgProgress::dlgProgress const wxString &  title,
const wxString &  message,
int  maximum = 100,
wxWindow *  parent = NULL,
int  style = wxPD_APP_MODAL | wxPD_AUTO_HIDE
 

Creates and displays dialog, disables event handling for other frames or parent frame to avoid recursion problems.

Parameters:
title Title for window.
message Message to display in window.
maximum Value for status bar, if <= 0, no bar is shown.
parent Window or NULL.
style Is the bit mask of wxPD_XXX constants from wx/defs.h.

Definition at line 66 of file dlgProgress.cpp.

dlgProgress::~dlgProgress  )  [virtual]
 

The class descructor.

Definition at line 281 of file dlgProgress.cpp.

References ReenableOtherWindows().

dlgProgress::dlgProgress  )  [inline, private]
 

Default constructor. Don't use it.

Definition at line 140 of file dlgProgress.hpp.


Member Function Documentation

void dlgProgress::btnCancelClick wxCommandEvent &  event  )  [protected]
 

Processes button Cancel.

Parameters:
event The event's parameters

Definition at line 452 of file dlgProgress.cpp.

References btnCancel, btnCancelClick(), btnPause, and state.

Referenced by btnCancelClick().

void dlgProgress::btnPauseClick wxCommandEvent &  event  )  [protected]
 

Processes button Pause.

Parameters:
event The event's parameters

Definition at line 480 of file dlgProgress.cpp.

References btnPause, btnPauseClick(), and state.

Referenced by btnPauseClick().

void dlgProgress::createControls const wxString &  message = wxEmptyString  ) 
 

Creates and initializes the controls of the dialog.

Definition at line 138 of file dlgProgress.cpp.

References btnCancel, btnPause, CONTROL_SPACE, createControls(), gauProgress, lblElapsed, lblEstimated, lblMessage, lblRemaining, and maximum.

Referenced by createControls().

void dlgProgress::FrameClose wxCloseEvent &  event  )  [protected]
 

Event handler to respond to system close events.

Parameters:
event event parameters.

Definition at line 510 of file dlgProgress.cpp.

References FrameClose(), and state.

Referenced by FrameClose().

bool dlgProgress::isPaused  )  const
 

Is the user has clicked on Pause ?

Returns:
true if the dialog has been paused, false otherwise.

Definition at line 539 of file dlgProgress.cpp.

References state.

Referenced by getFilesInSubdirectoriesRec(), ChecksumsListView::removeFilesInList(), and ChecksumsListView::ChecksumProgress::update().

void dlgProgress::ReenableOtherWindows  )  [protected]
 

Reenables the other windows temporarily disabled while the dialog was shown.

Must be called to reenable the other windows temporarily disabled while the dialog was shown.

Definition at line 295 of file dlgProgress.cpp.

References ctrParentTop, and winDisabler.

Referenced by Show(), Update(), and ~dlgProgress().

void dlgProgress::Resume  ) 
 

Can be called to continue after the Cancel button has been pressed.

Definition at line 410 of file dlgProgress.cpp.

References btnCancel, btnPause, and state.

void dlgProgress::SetTimeLabel unsigned long  val,
wxStaticText *  label
[protected]
 

Updates the label to show the given time (in seconds).

Parameters:
val Time value.
label Label to change (can be NULL).

Definition at line 552 of file dlgProgress.cpp.

References SetTimeLabel().

Referenced by SetTimeLabel(), and Update().

bool dlgProgress::Show bool  show = true  ) 
 

Shows the dialog.

Parameters:
show If true displays the window. Otherwise, hides it.
Returns:
true if the window has been shown or hidden or false if nothing was done because it already was in the requested state.

Definition at line 434 of file dlgProgress.cpp.

References ReenableOtherWindows(), and Show().

Referenced by Show().

bool dlgProgress::Update int  value,
const wxString &  newmsg = wxEmptyString
 

Update the status bar to the new value.

Parameters:
value New value.
newmsg If used, new message to display.
Returns:
true if Cancel button has not been pressed.

Definition at line 316 of file dlgProgress.cpp.

References btnCancel, btnPause, gauProgress, lblElapsed, lblEstimated, lblMessage, lblRemaining, maximum, ReenableOtherWindows(), SetTimeLabel(), state, and timeStart.

virtual void dlgProgress::Update  )  [inline, private, virtual]
 

Virtual function hiding supression.

Definition at line 117 of file dlgProgress.hpp.

Referenced by ChecksumsListView::ChecksumProgress::finished(), getFilesInSubdirectories(), getFilesInSubdirectoriesRec(), ChecksumsListView::removeFilesInList(), and ChecksumsListView::ChecksumProgress::update().


Member Data Documentation

wxButton* dlgProgress::btnCancel [protected]
 

Cancel and close button.

Definition at line 71 of file dlgProgress.hpp.

Referenced by btnCancelClick(), createControls(), Resume(), and Update().

wxButton* dlgProgress::btnPause [protected]
 

Pause button.

Definition at line 72 of file dlgProgress.hpp.

Referenced by btnCancelClick(), btnPauseClick(), createControls(), Resume(), and Update().

wxWindow* dlgProgress::ctrParentTop [protected]
 

Parent top level window (may be NULL).

Definition at line 106 of file dlgProgress.hpp.

Referenced by ReenableOtherWindows().

wxGauge* dlgProgress::gauProgress [protected]
 

Progress bar.

Definition at line 66 of file dlgProgress.hpp.

Referenced by createControls(), and Update().

wxStaticText* dlgProgress::lblElapsed [protected]
 

Elapsed time.

Definition at line 68 of file dlgProgress.hpp.

Referenced by createControls(), and Update().

wxStaticText* dlgProgress::lblEstimated [protected]
 

Estimated time.

Definition at line 69 of file dlgProgress.hpp.

Referenced by createControls(), and Update().

wxStaticText* dlgProgress::lblMessage [protected]
 

The message displayed.

Definition at line 67 of file dlgProgress.hpp.

Referenced by createControls(), and Update().

wxStaticText* dlgProgress::lblRemaining [protected]
 

Remaining time.

Definition at line 70 of file dlgProgress.hpp.

Referenced by createControls(), and Update().

int dlgProgress::maximum [protected]
 

The maximum value.

Definition at line 108 of file dlgProgress.hpp.

Referenced by createControls(), and Update().

enum dlgProgress::State dlgProgress::state [protected]
 

Continue processing or not (return value for Update()).

Referenced by btnCancelClick(), btnPauseClick(), FrameClose(), isPaused(), Resume(), and Update().

unsigned long dlgProgress::timeStart [protected]
 

Time when the dialog was created.

Definition at line 107 of file dlgProgress.hpp.

Referenced by Update().

wxWindowDisabler* dlgProgress::winDisabler [protected]
 

Disable all others windows (for wxPD_APP_MODAL case).

Definition at line 65 of file dlgProgress.hpp.

Referenced by ReenableOtherWindows().


The documentation for this class was generated from the following files:
Generated on Sun May 30 13:38:05 2004 for wxChecksums by doxygen 1.3.7