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

dlgResultsProgress Class Reference

Template for progress dialogs which display textual informations. More...

#include <dlgResProg.hpp>

Inheritance diagram for dlgResultsProgress:

Inheritance graph
[legend]
List of all members.

Public Types

enum  State { running = 1, paused, canceled, finished }
 States of the dialog. More...


Public Member Functions

void addResultLine (const wxString &text, const unsigned int indentation=0, const wxColour &colour=*wxBLACK)
 Adds a line to the results.

virtual bool canContinue () const
 Says if the process can continue.

void createControls ()
 Creates and initializes the controls of the dialog.

 dlgResultsProgress (wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const wxString &name=wxT("ResultsProgressDialog"))
 Creates a new dialog.

 dlgResultsProgress ()
 Creates a new dialog.

void Finished ()
 Says to the dialog that the process is finished.

State getState () const
 Gets the dialog state.

void removeLastResultLine ()
 Remove the last inserted result line.

void replaceLastResultLine (const wxString &text, const unsigned int indentation=0, const wxColour &colour=*wxBLACK)
 Replace the last inserted result line.

virtual bool Show (bool show=true)
 Hides or shows the dialog.

virtual ~dlgResultsProgress ()
 The class descructor.


Protected Types

enum  { TXT_RESULTS = wxID_HIGHEST + 1, BTN_PAUSE }
 Controls IDs. 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 others windows.

void refreshDialog ()
 Refreshes the dialog.

void setState (State newState)
 Sets the dialog state.

virtual void Update ()
 Virtual function hiding supression.


Static Protected Member Functions

wxColour getColour (PreferencesKeys pk)
 Gets a colour from the preferences.


Protected Attributes

wxButton * btnCancel
 Cancel and close button.

wxButton * btnPause
 Pause button.

wxBoxSizer * infoSizer
 Sizer where informatives controls should be added.

long lastInsertedPos
 Last inserted position.

long lastInsertedWidth
 Last inserted width.

State state
 Dialog state.

wxTextCtrl * txtResults
 Text control used to display results.

wxWindowDisabler * winDisabler
 Disable all others windows.


Detailed Description

Template for progress dialogs which display textual informations.

To use it, follow these steps:

Definition at line 54 of file dlgResProg.hpp.


Member Enumeration Documentation

anonymous enum [protected]
 

Controls IDs.

Definition at line 93 of file dlgResProg.hpp.

enum dlgResultsProgress::State
 

States of the dialog.

Definition at line 111 of file dlgResProg.hpp.

Referenced by getState().


Constructor & Destructor Documentation

dlgResultsProgress::dlgResultsProgress  ) 
 

Creates a new dialog.

Definition at line 57 of file dlgResProg.cpp.

dlgResultsProgress::dlgResultsProgress wxWindow *  parent,
wxWindowID  id,
const wxString &  title,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxDEFAULT_DIALOG_STYLE,
const wxString &  name = wxT("ResultsProgressDialog")
 

Creates a new dialog.

Parameters:
parent Parent of the dialog.
id An identifier for the dialog. A value of -1 is taken to mean a default.
title The title of the dialog.
pos The dialog position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
size The dialog size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform.
style The window style. See wxDialog's documentation.
name Used to associate a name with the window, allowing the application user to set Motif resource values for individual dialog boxes.

Definition at line 83 of file dlgResProg.cpp.

References createControls(), lastInsertedPos, lastInsertedWidth, setState(), and winDisabler.

dlgResultsProgress::~dlgResultsProgress  )  [virtual]
 

The class descructor.

Definition at line 153 of file dlgResProg.cpp.

References reenableOtherWindows().


Member Function Documentation

void dlgResultsProgress::addResultLine const wxString &  text,
const unsigned int  indentation = 0,
const wxColour &  colour = *wxBLACK
 

Adds a line to the results.

Parameters:
text Line of text to add.
indentation Indentation of the text.
colour Colour of the text.

Definition at line 343 of file dlgResProg.cpp.

References addResultLine(), lastInsertedPos, lastInsertedWidth, and txtResults.

Referenced by addResultLine(), dlgBatchCreation::batchCreation(), dlgMultiCheck::checkChecksumsFiles(), and dlgBatchCreation::saveChecksumsInFiles().

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

Processes button Cancel.

Parameters:
event The event's parameters

Reimplemented in dlgBatchCreation, and dlgMultiCheck.

Definition at line 184 of file dlgResProg.cpp.

References btnCancel, btnCancelClick(), btnPause, getState(), and setState().

Referenced by btnCancelClick().

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

Processes button Pause.

Parameters:
event The event's parameters

Definition at line 211 of file dlgResProg.cpp.

References btnPause, btnPauseClick(), getState(), and setState().

Referenced by btnPauseClick().

bool dlgResultsProgress::canContinue  )  const [virtual]
 

Says if the process can continue.

If the state of the dialog is canceled or finished the checking can't continue.

Returns:
true if the state of the dialog is running or paused, false otherwise.

Definition at line 435 of file dlgResProg.cpp.

References getState().

Referenced by dlgBatchCreation::batchCreation(), and dlgMultiCheck::checkChecksumsFiles().

void dlgResultsProgress::createControls  ) 
 

Creates and initializes the controls of the dialog.

Reimplemented in dlgBatchCreation, and dlgMultiCheck.

Definition at line 112 of file dlgResProg.cpp.

References btnCancel, btnPause, CONTROL_SPACE, infoSizer, and txtResults.

Referenced by dlgResultsProgress().

void dlgResultsProgress::Finished  ) 
 

Says to the dialog that the process is finished.

Sets the state to "finished" and change the caption of the Cancel button to "Close".

Definition at line 271 of file dlgResProg.cpp.

References btnCancel, btnPause, and setState().

Referenced by dlgBatchCreation::batchCreation(), and dlgMultiCheck::checkChecksumsFiles().

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

Event handler to respond to system close events.

Parameters:
event event parameters.

Definition at line 237 of file dlgResProg.cpp.

References FrameClose(), getState(), and setState().

Referenced by FrameClose().

wxColour dlgResultsProgress::getColour PreferencesKeys  pk  )  [static, protected]
 

Gets a colour from the preferences.

Parameters:
pk Preference key from which the colour is get.
Returns:
A colour from the preferences.

Definition at line 460 of file dlgResProg.cpp.

References AppPrefs::get(), getColour(), longTowxColour(), and AppPrefs::readLong().

Referenced by getColour().

dlgResultsProgress::State dlgResultsProgress::getState  )  const
 

Gets the dialog state.

Returns:
The dialog state.

Definition at line 291 of file dlgResProg.cpp.

References state, and State.

Referenced by dlgBatchCreation::batchCreation(), btnCancelClick(), dlgMultiCheck::btnCancelClick(), dlgBatchCreation::btnCancelClick(), btnPauseClick(), canContinue(), dlgMultiCheck::checkChecksumsFiles(), FrameClose(), dlgMultiCheck::ChecksumProgress::update(), and dlgBatchCreation::ChecksumProgress::update().

void dlgResultsProgress::reenableOtherWindows  )  [protected]
 

Reenables the others windows.

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

Definition at line 254 of file dlgResProg.cpp.

References winDisabler.

Referenced by Show(), and ~dlgResultsProgress().

void dlgResultsProgress::refreshDialog  )  [protected]
 

Refreshes the dialog.

Should be called on each update of a control on the dialog.

Definition at line 324 of file dlgResProg.cpp.

Referenced by dlgMultiCheck::updateCurrentCheckedFile(), dlgBatchCreation::updateCurrentProcessedFile(), dlgMultiCheck::updateFilesInChecksumsFiles(), dlgMultiCheck::updateTotalChecksumsFiles(), and dlgBatchCreation::updateTotalFiles().

void dlgResultsProgress::removeLastResultLine  ) 
 

Remove the last inserted result line.

Definition at line 405 of file dlgResProg.cpp.

References lastInsertedPos, lastInsertedWidth, and txtResults.

Referenced by dlgMultiCheck::checkChecksumsFiles(), and dlgMultiCheck::checkFile().

void dlgResultsProgress::replaceLastResultLine const wxString &  text,
const unsigned int  indentation = 0,
const wxColour &  colour = *wxBLACK
 

Replace the last inserted result line.

Parameters:
text Line of text to add.
indentation Indentation of the text.
colour Colour of the text.

Definition at line 374 of file dlgResProg.cpp.

References lastInsertedPos, lastInsertedWidth, replaceLastResultLine(), and txtResults.

Referenced by dlgMultiCheck::checkChecksumsFiles(), dlgMultiCheck::checkFile(), and replaceLastResultLine().

void dlgResultsProgress::setState State  newState  )  [protected]
 

Sets the dialog state.

Parameters:
newState The new dialog state.

Definition at line 303 of file dlgResProg.cpp.

References setState(), and state.

Referenced by btnCancelClick(), btnPauseClick(), dlgResultsProgress(), Finished(), FrameClose(), and setState().

bool dlgResultsProgress::Show bool  show = true  )  [virtual]
 

Hides or shows the dialog.

Parameters:
show If TRUE, the dialog box is shown and brought to the front; otherwise the box is hidden.

Definition at line 166 of file dlgResProg.cpp.

References reenableOtherWindows(), and Show().

Referenced by Show().

virtual void dlgResultsProgress::Update  )  [inline, protected, virtual]
 

Virtual function hiding supression.

Definition at line 156 of file dlgResProg.hpp.


Member Data Documentation

wxButton* dlgResultsProgress::btnCancel [protected]
 

Cancel and close button.

Definition at line 78 of file dlgResProg.hpp.

Referenced by btnCancelClick(), createControls(), and Finished().

wxButton* dlgResultsProgress::btnPause [protected]
 

Pause button.

Definition at line 79 of file dlgResProg.hpp.

Referenced by btnCancelClick(), btnPauseClick(), createControls(), and Finished().

wxBoxSizer* dlgResultsProgress::infoSizer [protected]
 

Sizer where informatives controls should be added.

Definition at line 81 of file dlgResProg.hpp.

Referenced by createControls().

long dlgResultsProgress::lastInsertedPos [protected]
 

Last inserted position.

Definition at line 141 of file dlgResProg.hpp.

Referenced by addResultLine(), dlgResultsProgress(), removeLastResultLine(), and replaceLastResultLine().

long dlgResultsProgress::lastInsertedWidth [protected]
 

Last inserted width.

Definition at line 142 of file dlgResProg.hpp.

Referenced by addResultLine(), dlgResultsProgress(), removeLastResultLine(), and replaceLastResultLine().

State dlgResultsProgress::state [protected]
 

Dialog state.

Definition at line 120 of file dlgResProg.hpp.

Referenced by getState(), and setState().

wxTextCtrl* dlgResultsProgress::txtResults [protected]
 

Text control used to display results.

Definition at line 80 of file dlgResProg.hpp.

Referenced by addResultLine(), createControls(), removeLastResultLine(), and replaceLastResultLine().

wxWindowDisabler* dlgResultsProgress::winDisabler [protected]
 

Disable all others windows.

Definition at line 77 of file dlgResProg.hpp.

Referenced by dlgResultsProgress(), and 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