1 /*
2  * Copyright (C) 2002 - David W. Durham
3  *
4  * This file is part of ReZound, an audio editing application.
5  *
6  * ReZound is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published
8  * by the Free Software Foundation; either version 2 of the License,
9  * or (at your option) any later version.
10  *
11  * ReZound is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
19  */
20 
21 #ifndef __CProgressDialog_H__
22 #define __CProgressDialog_H__
23 
24 #include "../../config/common.h"
25 #include "fox_compat.h"
26 
27 #include <string>
28 using namespace std;
29 
30 class CProgressDialog : public FXDialogBox
31 {
32 	FXDECLARE(CProgressDialog);
33 
34 public:
35 	CProgressDialog(FXWindow *owner,const FXString &title,bool showCancelButton);
36 	virtual ~CProgressDialog();
37 
38 	virtual void show(FXuint placement=PLACEMENT_OWNER);
39 	virtual void hide();
40 
41 	//                   0 to 100
42 	void setProgress(int progress,const string timeElapsed,const string timeRemaining);
43 
44 	long onCancelButton(FXObject *sender,FXSelector sel,void *ptr);
45 	long onCloseWindow(FXObject *sender,FXSelector sel,void *ptr);
46 
47 	enum
48 	{
49 		ID_CANCEL_BUTTON=FXDialogBox::ID_LAST,
50 		ID_LAST
51 	};
52 
53 	bool isCancelled;
54 
55 protected:
CProgressDialog()56 	CProgressDialog() {}
57 
58 private:
59 	FXVerticalFrame *vContents;
60 		FXHorizontalFrame *hContents;
61 			FXProgressBar *progressBar;
62 			FXButton *cancelButton;
63 		FXLabel *timeElapsedLabel;
64 		FXLabel *timeRemainingLabel;
65 };
66 
67 #endif
68