home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WPROGBAR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
5KB
|
159 lines
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (C) 1994, by WATCOM International Inc. All rights %
% reserved. No part of this software may be reproduced or %
% used in any form or by any means - graphic, electronic or %
% mechanical, including photocopying, recording, taping or %
% information storage and retrieval systems - except with the %
% written permission of WATCOM International Inc. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WProgressBar -- Wrapper for the Windows 95 Progress Bar control.
*
* Events:
*
*************************************************************************/
#ifndef _WPROGRESSBAR_HPP_INCLUDED
#define _WPROGRESSBAR_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCONTROL_HPP_INCLUDED
# include "wcontrol.hpp"
#endif
#ifndef _WSTRING_HPP_INCLUDED
# include "wstring.hpp"
#endif
//
// ProgressBar styles
//
#define WPROGBSDefault ((WStyle)0x50000000L) // WS_CHILD|WS_VISIBLE
#define WPROGBSNoText WPROGBSDefault
struct WProgressBarFDXDataStruct {
WUShort position;
WRange range;
};
enum WProgressBarStyle {
WProgressBarStyleNormal,
WProgressBarStylePercent,
WProgressBarStylePosition,
WProgressBarStyleCaption
};
class WCMCLASS WProgressBar : public WControl {
WDeclareSubclass( WProgressBar, WControl );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WProgressBar();
~WProgressBar();
/**********************************************************
* Properties
*********************************************************/
// BarStyle
//
// The type of bar to paint.
WProgressBarStyle GetBarStyle() const;
WBool SetBarStyle( WProgressBarStyle style );
// FDXDataSource
WBool SetFDXDataSource( WUShort * fdxDataSource );
WBool SetFDXDataSource( WProgressBarFDXDataStruct * fdxDataSource );
// Maximum
WBool SetMaximum( WUShort maximum );
WUShort GetMaximum();
// Minimum
WBool SetMinimum( WUShort minimum );
WUShort GetMinimum();
// Position
WBool SetPosition( WUShort position );
WUShort GetPosition();
// Range
WBool SetRange( const WRange & range );
WRange GetRange() const;
// Step
WBool SetStep( WUShort step );
WUShort GetStep();
/**********************************************************
* Methods
*********************************************************/
// Increment
WUShort Increment( WUShort inc=0 );
/**********************************************************
* Overrides and handlers
*********************************************************/
virtual const WChar * InitializeClass();
virtual WStyle GetDefaultStyle() const;
virtual WBool ProcessNotify( WUInt id, WNotify code,
WNotifyInfo info, WLong & returns );
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
virtual WBool FDXIn();
virtual WBool FDXOut();
WBool PaintHandler( WProgressBar *, WPaintEventData * );
virtual WBool ProcessMessage( const WMessage & msg,
WLong & returns );
/**********************************************************
* Data members
*********************************************************/
private:
WUShort _currPos;
WUShort _step;
WUShort _minRange;
WUShort _maxRange;
WUShort * _fdxDataSource;
WProgressBarFDXDataStruct * _fdxDataSourceStruct;
WProgressBarStyle _barStyle;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WPROGRESSBAR_HPP_INCLUDED