1 /*=========================================================================
3 Program: WXDialog - wxWidgets X-platform GUI Front-End for CMake
4 Module: $RCSfile: progressdlg.h,v $
6 Date: $Date: 2005-06-30 19:54:14 $
7 Version: $Revision: 1.1 $
11 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
12 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
14 This software is distributed WITHOUT ANY WARRANTY; without even
15 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 PURPOSE. See the above copyright notices for more information.
18 =========================================================================*/
20 #ifndef _PROGRESSDLG_H_
21 #define _PROGRESSDLG_H_
23 #if defined(__GNUG__) && !defined(__APPLE__)
24 #pragma interface "progressdlg.cpp"
35 * Forward declarations
38 ////@begin forward declarations
39 ////@end forward declarations
45 ////@begin control identifiers
46 #define ID_PROGRESSDLG 10000
47 #define SYMBOL_CMPROGRESSDIALOG_STYLE wxRAISED_BORDER
48 #define SYMBOL_CMPROGRESSDIALOG_TITLE _("Progress Dialog")
49 #define SYMBOL_CMPROGRESSDIALOG_IDNAME ID_PROGRESSDLG
50 #define SYMBOL_CMPROGRESSDIALOG_SIZE wxSize(400, 300)
51 #define SYMBOL_CMPROGRESSDIALOG_POSITION wxDefaultPosition
52 #define ID_CMAKE_PROGRESS 10001
53 #define ID_CMAKE_BUTTON 10002
54 ////@end control identifiers
61 #define wxCLOSE_BOX 0x1000
63 #ifndef wxFIXED_MINSIZE
64 #define wxFIXED_MINSIZE 0
68 * CMProgressDialog class declaration
71 class CMProgressDialog
: public wxDialog
73 DECLARE_DYNAMIC_CLASS( CMProgressDialog
)
79 CMProgressDialog( wxWindow
* parent
, wxWindowID id
= SYMBOL_CMPROGRESSDIALOG_IDNAME
, const wxString
& caption
= SYMBOL_CMPROGRESSDIALOG_TITLE
, const wxPoint
& pos
= SYMBOL_CMPROGRESSDIALOG_POSITION
, const wxSize
& size
= SYMBOL_CMPROGRESSDIALOG_SIZE
, long style
= SYMBOL_CMPROGRESSDIALOG_STYLE
);
82 bool Create( wxWindow
* parent
, wxWindowID id
= SYMBOL_CMPROGRESSDIALOG_IDNAME
, const wxString
& caption
= SYMBOL_CMPROGRESSDIALOG_TITLE
, const wxPoint
& pos
= SYMBOL_CMPROGRESSDIALOG_POSITION
, const wxSize
& size
= SYMBOL_CMPROGRESSDIALOG_SIZE
, long style
= SYMBOL_CMPROGRESSDIALOG_STYLE
);
84 /// Creates the controls and sizers
85 void CreateControls();
87 void SetProgress(float progress
) {
88 m_progress
->SetValue((int)(progress
* 100));
91 ////@begin CMProgressDialog event handler declarations
93 /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CMAKE_BUTTON
94 void OnCmakeCancelClick( wxCommandEvent
& event
);
96 ////@end CMProgressDialog event handler declarations
98 ////@begin CMProgressDialog member function declarations
100 /// Retrieves bitmap resources
101 wxBitmap
GetBitmapResource( const wxString
& name
);
103 /// Retrieves icon resources
104 wxIcon
GetIconResource( const wxString
& name
);
105 ////@end CMProgressDialog member function declarations
107 /// Should we show tooltips?
108 static bool ShowToolTips();
110 bool CancelPressed() const {
111 return m_cancelPressed
;
114 void CancelAcknowledged() {
118 bool IsCancelling() const {
123 m_cancelling
= false;
124 m_cancelPressed
= false;
127 ////@begin CMProgressDialog member variables
128 wxStaticText
* m_textMessage
;
130 ////@end CMProgressDialog member variables
133 bool m_cancelPressed
;