home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 October
/
Chip_1997-10_cd.bin
/
tema
/
sybase
/
powerj
/
hpp.z
/
WSCROLLB.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
8KB
|
247 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WScrollBar -- Wrapper for the Windows 95 ScrollBar control.
*
* Events:
*
* Scroll -- When the control is scrolled.
*
*************************************************************************/
#ifndef _WSCROLLB_HPP_INCLUDED
#define _WSCROLLB_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WCONTROL_HPP_INCLUDED
# include "wcontrol.hpp"
#endif
class WScrollBar;
struct WScrollBarEventData : public WEventData {
WScrollDir direction;
WScrollMessage message;
WInt position;
WWindowHandle handle;
};
//
// Scrollbar styles
//
#define WSBSHorizDefault ((WStyle)0x50000000L) // WS_VISIBLE|SBS_HORZ|WS_CHILD
#define WSBSVertDefault ((WStyle)0x50000001L) // WS_VISIBLE|SBS_VERT|WS_CHILD
#define WSBSHorizontal ((WStyle)0x00000000L) // SBS_HORZ
#define WSBSVertical ((WStyle)0x00000001L) // SBS_VERT
#define WSBSAlignTop ((WStyle)0x00000002L) // SBS_TOPALIGN
#define WSBSAlignBottom ((WStyle)0x00000004L) // SBS_BOTTOMALIGN
#define WSBSAlignLeft ((WStyle)0x00000002L) // SBS_LEFTALIGN
#define WSBSAlignRight ((WStyle)0x00000004L) // SBS_RIGHTALIGN
struct WScrollBarFDXDataStruct {
WInt position;
WRange range;
};
class WCMCLASS WScrollBar : public WControl {
WDeclareSubclass( WScrollBar, WControl );
/**********************************************************
* Constructors and Destructors
*********************************************************/
protected:
WScrollBar( WScrollDir dir );
public:
~WScrollBar();
public:
/**********************************************************
* Properties
*********************************************************/
// FDXDataSource
WBool SetFDXDataSource( WInt * fdxDataSource );
WBool SetFDXDataSource( WScrollBarFDXDataStruct * fdxDataSource );
// Direction
WScrollDir GetDirection() const;
// Increment
WLong GetIncrement() const;
WBool SetIncrement( WLong increment );
// Page size
WBool SetPageSize ( const WInt & psize );
WInt GetPageSize () const;
// ScrollPosition
WInt GetScrollPosition() const;
WBool SetScrollPosition( WInt pos );
// ScrollRange
WRange GetScrollRange();
WBool SetScrollRange( const WRange & range, WBool repaint = FALSE );
// Step
WLong GetStep() const;
WBool SetStep( WLong step );
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Event Handlers
*********************************************************/
WBool ScrollEventHandler( WWindow * window,
WScrollBarEventData * event );
/**********************************************************
* Overrides
*********************************************************/
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
virtual WBool ProcessMessage( const WMessage & msg,
WLong & returns );
virtual const WChar * InitializeClass();
virtual WBool FDXIn();
virtual WBool FDXOut();
virtual WBool SetScrollPosition( WScrollDir bar, WInt pos,
WBool redraw=TRUE );
virtual WInt GetScrollPosition( WScrollDir bar );
virtual WBool SetScrollRange( WScrollDir bar, const WRange & range,
WBool redraw=TRUE );
virtual WRange GetScrollRange( WScrollDir bar ) const;
/**********************************************************
* Data members
*********************************************************/
private:
WScrollDir _direction;
WLong _increment;
WLong _step;
WInt * _fdxDataSource;
WScrollBarFDXDataStruct * _fdxDataSourceStruct;
};
/*************************************************************************
*
* WVScrollBar -- Wrapper for the Windows 95 Vertical ScrollBar control.
*
* Events:
*
* Scroll -- When the control is scrolled.
*
*************************************************************************/
class WCMCLASS WVScrollBar : public WScrollBar {
WDeclareSubclass( WVScrollBar, WScrollBar );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WVScrollBar();
~WVScrollBar();
/**********************************************************
* Properties
*********************************************************/
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Data members
*********************************************************/
virtual WStyle GetDefaultStyle() const;
};
/*************************************************************************
*
* WHScrollBar -- Wrapper for the Windows 95 Horizontal ScrollBar control.
*
* Events:
*
* Scroll -- When the control is scrolled.
*
*************************************************************************/
class WCMCLASS WHScrollBar : public WScrollBar {
WDeclareSubclass( WHScrollBar, WScrollBar );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WHScrollBar();
~WHScrollBar();
/**********************************************************
* Properties
*********************************************************/
/**********************************************************
* Methods
*********************************************************/
/**********************************************************
* Data members
*********************************************************/
virtual WStyle GetDefaultStyle() const;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WSCROLLB_HPP_INCLUDED