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

details_progress_dialog.h

Go to the documentation of this file.
      00001 //----------------------------------------------------------------------------------------
      00011 // RCS-ID:      $Id: details_progress_dialog.h,v 1.3 2003/02/13 02:40:38 robertoconnor Exp $
      00012 //----------------------------------------------------------------------------------------
      00013 
      00014 //----------------------------------------------------------------------------------------
      00015 // Begin single inclusion of this .h file condition
      00016 //----------------------------------------------------------------------------------------
      00017 
      00018 #ifndef _DETAILS_PROGRESS_DIALOG_H_
      00019 #define _DETAILS_PROGRESS_DIALOG_H_
      00020 
      00021 //----------------------------------------------------------------------------------------
      00022 // GCC interface
      00023 //----------------------------------------------------------------------------------------
      00024 
      00025 #if defined(__GNUG__) && ! defined(__APPLE__)
      00026     #pragma interface "details_progress_dialog.h"
      00027 #endif
      00028 
      00029 //----------------------------------------------------------------------------------------
      00030 // Shared defines
      00031 //----------------------------------------------------------------------------------------
      00032 
      00033 #include "plucker_defines.h"
      00034 
      00035 //----------------------------------------------------------------------------------------
      00036 // Begin feature removal condition
      00037 //----------------------------------------------------------------------------------------
      00038 
      00039 #if ( setupUSE_ENHANCED_PROGRESS_DIALOG )
      00040 
      00041 //----------------------------------------------------------------------------------------
      00042 // Headers
      00043 //----------------------------------------------------------------------------------------
      00044 
      00045 #include "wx/dialog.h"
      00046 #include "wx/process.h"
      00047 #include "wx/gauge.h"
      00048 #include "details_progress_listbox.h"
      00049 
      00050 //----------------------------------------------------------------------------------------
      00051 // Class definition: details_progress_dialog
      00052 //----------------------------------------------------------------------------------------
      00053 
      00055 
      00070 class details_progress_dialog : public wxDialog
00071 {
00072 
00073     DECLARE_DYNAMIC_CLASS( details_progress_dialog )
00074 
00075 public: 
00076  
00078 
00094     details_progress_dialog( wxWindow* parent,
00095              bool automatically_close_when_done = TRUE,
00096              const wxString& show_hide_listbox_configuration_key = wxEmptyString, 
00097              const wxString& log_filename = wxEmptyString,
00098              const wxString& log_path = wxEmptyString,
00099              long scroll_history = optionDETAILS_PROGRESS_LISTBOX_RECOMMENDED_SCROLL_HISTORY
00100            );
00101     
00102     // Dummy construtor for RTTI macros
00103     details_progress_dialog() {}
00104                      
00106     virtual ~details_progress_dialog();        
00107    
00109 
00112     void set_abort_signal_was_entered( bool abort );
00113     
00115     bool get_abort_signal_was_entered();
00116     
00118 
00126     void set_automatically_close_when_done( bool automatically_close_when_done = TRUE );
00127     
00129 
00134     void all_chores_completed_without_interruption();   
00135     
00136     //---Accessors to manipulating the progress controls-----------------------------------------                                   
00137     
00139     wxGauge*          get_total_gauge() const { return m_total_gauge; }
00140     
00142     wxStaticText*     get_total_statictext() const { return m_total_statictext; }
00143     
00145     wxGauge*          get_subtask_gauge() const { return m_subtask_gauge; }
00146     
00148     wxStaticText*     get_subtask_statictext() const { return m_subtask_statictext; }
00149     
00151     wxButton*         get_stop_button() const { return m_stop_button; }
00152     
00154     wxButton*         get_details_button() const { return m_details_button; }
00155     
00157     wxButton*         get_export_button() const { return m_export_button; }
00158     
00160     details_progress_listbox* get_details_listbox() const{ return m_details_progress_listbox; }
00161     
00163 
00167     void set_flickerfree_gauge_and_range( wxGauge& gauge, int value,
00168                                           int range 
00169                                         );   
00170 
00171 protected:
00172 
00174     virtual void action_to_do_when_dialog_is_ready() {}
00175     
00177     virtual void action_to_do_before_dialog_finishes_closing() {}
00178 
00180 
00184     virtual void action_to_do_after_dialog_finishes_closing() {}
00185 
00186 private:
00187 
00188     //-----HManipulating the listbox-----------------------------------------------------
00189     
00191     void show_listbox();
00192     
00194     void move_dialog_to_make_fully_visible_with_shown_listbox();
00195     
00197     void hide_listbox();
00198 
00200 
00203     void update_dialog_size_after_hide_or_show_listbox( int desired_dialog_height );
00204     
00206     void on_details_button( wxCommandEvent &event ); 
00207     
00209     void on_export_button( wxCommandEvent &event ); 
00210 
00212 
00219     void on_init_dialog( wxInitDialogEvent &event ); 
00220 
00222 
00227     bool m_is_initial_init_event;
00228 
00230     int  m_dialog_height_with_listbox;
00231     
00233     int m_dialog_height_without_listbox;
00234     
00236     bool m_details_progress_listbox_is_shown;  
00237    
00239     wxString m_show_hide_listbox_configuration_key;
00240     
00241     //---Managing starting/stopping of the action with open/close of dialog----------------
00242   
00244     void on_paint_dialog( wxPaintEvent& event );
00245     
00247     
00248     void on_stop_button( wxCommandEvent &event );
00249    
00251     //void close_dialog();
00252     void OnCloseWindow( wxCloseEvent& event );
00253 
00255 
00260     bool m_abort_signal_was_entered;
00261 
00263 
00266     bool m_is_initial_paint_event;
00267    
00269     bool m_automatically_close_when_done;
00270    
00272 
00277     int m_dialog_return_value;
00278            
00279     //-----Control pointers-----------------------------------------------------------       
00280     
00281     wxGauge*        m_total_gauge;
00282     wxStaticText*   m_total_statictext;
00283     wxGauge*        m_subtask_gauge;
00284     wxStaticText*   m_subtask_statictext;
00285     wxButton*       m_stop_button;
00286     wxButton*       m_details_button;
00287     wxButton*       m_export_button; 
00288     
00290 
00293     details_progress_listbox* m_details_progress_listbox;
00294     
00295     //-----wxWindows event table macro-------------------------------------------------       
00296                
00297     DECLARE_EVENT_TABLE()
00298     
00299 };
00300 
00301 //----------------------------------------------------------------------------------------
00302 // End feature removal condition
00303 //----------------------------------------------------------------------------------------
00304 
00305 #endif  // setupUSE_ENHANCED_PROGRESS_DIALOG
00306 
00307 //----------------------------------------------------------------------------------------
00308 // End single inclusion of this .h file condition
00309 //----------------------------------------------------------------------------------------
00310 
00311 #endif  // _DETAILS_PROGRESS_DIALOG_H_