progress.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:4k
- /*
- * progress.h
- *
- * Progress bar control for GUI classes.
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: progress.h,v $
- * Revision 1.4 1999/03/09 08:01:47 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.3 1999/02/16 08:08:28 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.2 1998/09/23 06:19:45 robertj
- * Added open source copyright license.
- *
- * Revision 1.1 1995/08/12 22:49:49 robertj
- * Initial revision
- *
- */
- #ifndef _PPROGRESS_H
- #define _PPROGRESS_H
- #ifdef __GNUC__
- #pragma interface
- #endif
- /**A bar graph progress meter control.
- */
- class PProgressMeter : public PControl
- {
- PCLASSINFO(PProgressMeter, PControl);
- public:
- /**@name Construction */
- //@{
- /**Create meter bar.
- This class implements a horizontal bar graph display suitable for showing
- the progress of some lengthy task. The values corresponding to the
- minimum and maximum positions can be set, and the percentage complete can
- be displayed as an option
- */
- PProgressMeter(
- PInteractor * parent, /// parent interactor
- unsigned min = 0, /// minimum value
- unsigned max = 100, /// maximum value
- BOOL showPercent = FALSE /// if TRUE, percentage complete will be shown
- );
- /** Create control from interactor layout with the specified control ID. */
- PProgressMeter(
- PInteractorLayout * parent, /// Interactor into which the box is placed.
- PRESOURCE_ID ctlID, /// Identifier for the control in the layout.
- const PNotifier & notify, /// Function to call when changes state.
- void * valuePtr /// Unused value pointer for static control.
- );
- //@}
- /**@name Construction */
- //@{
- /**Set the position of the meter. The value will be clamped to the minimum
- and maximum ranges set for the meter. If the update parameter is set to
- TRUE, the meter display will be updated via the ref{PInteractor::Update()}
- function.
- */
- void SetValue(
- unsigned value, /// new value vfor the meter
- BOOL update = TRUE /// If TRUE, update the display with the new value
- );
- /**Get the current meter value.
- @return current meter value.
- */
- unsigned GetValue() const;
- /**Set the minimum meter value.
- */
- void SetMin(
- unsigned value // New value for minimum position.
- );
-
- /**Get the current minimum meter value.
- @return minimum value.
- */
- unsigned GetMin() const;
-
- /**Set the maximum meter value.
- */
- void SetMax(
- unsigned value // New value for maximum position.
- );
-
- /**Get the current maximum meter value.
- @return maximum value.
- */
- unsigned GetMax() const;
- //@}
- protected:
- /**@name Overrides from class PInteractor */
- //@{
- /**Redraw the meter using the current value.
- */
- void OnRedraw(
- PCanvas & canvas
- );
- //@}
- /// current minimum value
- unsigned minimum;
- /// current maximum value
- unsigned maximum;
- /// current value
- unsigned value;
- /// if TRUE, display the percentage complete
- BOOL showPercent;
- };
- #endif
- // End Of File ///////////////////////////////////////////////////////////////