1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
/********************************************************************************
* *
* F i l e P r o g r e s s D i a l o g *
* *
*********************************************************************************
* Copyright (C) 2016,2022 by Jeroen van der Zijp. All Rights Reserved. *
*********************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/> *
********************************************************************************/
#ifndef FXFILEPROGRESSDIALOG_H
#define FXFILEPROGRESSDIALOG_H
#ifndef FXDIALOGBOX_H
#include "FXDialogBox.h"
#endif
namespace FX {
class FXHorizontalSeparator;
class FXProgressBar;
class FXLabel;
class FXIcon;
/**
* File Progress Dialog.
*/
class FXAPI FXFileProgressDialog : public FXDialogBox {
FXDECLARE(FXFileProgressDialog)
protected:
FXProgressBar *progress; // Progress bar
FXLabel *activitylabel; // Label describing ongoing activity
FXLabel *originlabel; // Original file name
FXLabel *targetlabel; // Target file name
FXLabel *byteslabel; // Bytes copied thus far
FXLabel *fileslabel; // Files copied thus far
FXLabel *originfile; // Origin file name
FXLabel *targetfile; // Target file name
FXLabel *numbytes; // Number of bytes
FXLabel *numfiles; // Number of files
FXbool cancelled; // Cancelled button was pressed
protected:
FXFileProgressDialog();
private:
FXFileProgressDialog(const FXFileProgressDialog&);
FXFileProgressDialog &operator=(const FXFileProgressDialog&);
public:
long onCmdCancel(FXObject*,FXSelector,void*);
public:
/// Construct input dialog box with given caption, icon, and prompt text
FXFileProgressDialog(FXWindow* owner,const FXString& caption,const FXString& label,FXIcon* ico=nullptr,FXuint opts=DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
/// Change the amount of progress
void setProgress(FXuint value);
/// Get current progress
FXuint getProgress() const;
/// Set total amount of progress
void setTotal(FXuint value);
/// Return total amount of progrss
FXuint getTotal() const;
/// Increment progress by given amount
void increment(FXuint value);
/// Change activity description
void setActivityText(const FXString& text);
/// Change activity icon
void setActivityIcon(FXIcon* ico);
/// Change origin filename
void setOriginFile(const FXString& fn);
/// Change target filename
void setTargetFile(const FXString& fn);
/// Change number of bytes
void setNumBytes(FXlong num);
/// Change number of files
void setNumFiles(FXlong num);
/// Access cancelled flag
void setCancelled(FXbool flg);
/// Check if operation is cancelled
FXbool isCancelled() const;
/// Destroy
virtual ~FXFileProgressDialog();
};
}
#endif
|