Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

details_progress_dialog Class Reference

A dialog that shows the progress of channel updates. More...

#include <details_progress_dialog.h>

Inheritance diagram for details_progress_dialog:

wxDialog process_progress_dialog build_progress_dialog List of all members.

Public Methods

  details_progress_dialog (wxWindow *parent, bool automatically_close_when_done=TRUE, const wxString &show_hide_listbox_configuration_key=wxEmptyString, const wxString &log_filename=wxEmptyString, const wxString &log_path=wxEmptyString, long scroll_history=optionDETAILS_PROGRESS_LISTBOX_RECOMMENDED_SCROLL_HISTORY)
  Constructor.

  details_progress_dialog ()
virtual  ~details_progress_dialog ()
  Destructor.

void  set_abort_signal_was_entered (bool abort)
  Send an abort signal to the dialog, that will abort as soon as possible.

bool  get_abort_signal_was_entered ()
  Get whether an abort signal was entered.

void  set_automatically_close_when_done (bool automatically_close_when_done=TRUE)
  Set whether the progress dialog should automatically close when it is finished.

void  all_chores_completed_without_interruption ()
  Report that all the chores completed all the way to their end, without an abort.

wxGauge *  get_total_gauge () const
  Accessor to details_progress_dialog control.

wxStaticText *  get_total_statictext () const
  Accessor to details_progress_dialog control.

wxGauge *  get_subtask_gauge () const
  Accessor to details_progress_dialog contr.

wxStaticText *  get_subtask_statictext () const
  Accessor to details_progress_dialog contr.

wxButton *  get_stop_button () const
  Accessor to details_progress_dialog contr.

wxButton *  get_details_button () const
  Accessor to details_progress_dialog contr.

wxButton *  get_export_button () const
  Accessor to details_progress_dialog contr.

details_progress_listbox get_details_listbox () const
  Accessor to details_progress_dialog contr.

void  set_flickerfree_gauge_and_range (wxGauge &gauge, int value, int range)
  Sets a gauge to the specified value and range, without flicker.


Protected Methods

virtual void  action_to_do_when_dialog_is_ready ()
  Start up the actions watched by the progress dialog. Called from on_paint().

virtual void  action_to_do_before_dialog_finishes_closing ()
  Clean up any actions before the dialog vanishes. Called from on_close().

virtual void  action_to_do_after_dialog_finishes_closing ()
  Clean up any actions after the dialog EndModal()s. Called from on_close().


Detailed Description

A dialog that shows the progress of channel updates.

It has a details_progress_listbox that can record some details (which has a context menu, for clearing, selecting and copying). On the right side of the dialog is 3 buttons for stop/ok, show/hide details and export details.

Class can be used directly or be derived from.

Note:
The listbox in the XRC file _must_ have the grow flags set to expand to fit in all directions, otherwise will impinge on top part when details button cuts off that part of the dialog.
Note:
The wxStaticText labels that get updated are fixed at width of 350, expand to grow, and have wxST_NO_AUTORESIZE style (one or more of these may be unnecessary, but need to not have the newly added text truncate.

Constructor & Destructor Documentation

details_progress_dialog::details_progress_dialog wxWindow *    parent,
bool    automatically_close_when_done = TRUE,
const wxString &    show_hide_listbox_configuration_key = wxEmptyString,
const wxString &    log_filename = wxEmptyString,
const wxString &    log_path = wxEmptyString,
long    scroll_history = optionDETAILS_PROGRESS_LISTBOX_RECOMMENDED_SCROLL_HISTORY
 

Constructor.

Parameters:
parent  The parent window.
automatically_close_when_done  Whether to close when done. This can be overridden later with set_automatically_close_when_done();
show_hide_listbox_configuration_key  Configuration key of active configuration to store show/hide details. wxEmptyString means don't load/save.
log_filename  Filename of the process logfile. A plkrFILE_FRIENDLY_DATETIME_STAMP in the string will replace with a file-friendly datetime string. If using DATETIMESTAMP, recommended to keep the rest of name below 11 characters total if need Macintosh 31-character limit requirement.
log_path  Default path of the logfile in dialog. Default of wxEmptyString means the current directory.
scroll_history  Number of lines to keep in the listbox at one time. After this, newly appended lines will remove the topmost line. Can be a number, or can use one of the options* to get a recommended for OS or an infinite one.

Member Function Documentation

virtual void details_progress_dialog::action_to_do_after_dialog_finishes_closing   [inline, protected, virtual]
 

Clean up any actions after the dialog EndModal()s. Called from on_close().

Needed for MSW to drop in something to terminate program if this is the only window, as otherwise app doesn't seem to quit

Reimplemented in build_progress_dialog, and process_progress_dialog.

void details_progress_dialog::all_chores_completed_without_interruption  
 

Report that all the chores completed all the way to their end, without an abort.

Change 'Stop" button label to OK, change the return value from wxID_CANCEL to wxID_OK, and send off to close_dialog() if m_automatically_close_when_done=TRUE.

void details_progress_dialog::set_abort_signal_was_entered bool    abort
 

Send an abort signal to the dialog, that will abort as soon as possible.

\bool TRUE to send an abort signal.

void details_progress_dialog::set_automatically_close_when_done bool    automatically_close_when_done = TRUE
 

Set whether the progress dialog should automatically close when it is finished.

This is a separate option that can be called anytime, such as during your on_process_generated_an_output_line() if you detected an error, you can prevent the dialog from automatically closing until users presses OK. But if things went okay, then you can leave it as true. The default is to automatically close when done.

Parameters:
automatically_close  TRUE to automatically close when all done.
void details_progress_dialog::set_flickerfree_gauge_and_range wxGauge &    gauge,
int    value,
int    range
 

Sets a gauge to the specified value and range, without flicker.

Parameters:
value  The value the gauge should be set to.
range  The range the gauge should be set to.