home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % 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. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WSlider -- Wrapper for the Windows 95 Slider control.
- *
- *
- * Events:
- *
- * Scroll -- When the control has been scrolled.
- *
- *************************************************************************/
-
- #ifndef _WSLIDER_HPP_INCLUDED
- #define _WSLIDER_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WCONTROL_HPP_INCLUDED
- # include "wcontrol.hpp"
- #endif
- #ifndef _WSCROLLB_HPP_INCLUDED
- # include "wscrollb.hpp"
- #endif
-
- class WSlider;
-
- struct WSliderEventData : public WScrollBarEventData {
- };
-
- //
- // Slider styles
- //
-
- #define WTBSDefault ((WStyle)0x50000001L) // TBS_HORZ|TBS_BOTTOM|TBS_AUTOTICKS|WS_VISIBLE|WS_CHILD
- #define WTBSHorizontal ((WStyle)0x00000000L) // TBS_HORZ
- #define WTBSRight ((WStyle)0x00000000L) // TBS_RIGHT
- #define WTBSBottom ((WStyle)0x00000000L) // TBS_BOTTOM
- #define WTBSAutoTicks ((WStyle)0x00000001L) // TBS_AUTOTICKS
- #define WTBSVertical ((WStyle)0x00000002L) // TBS_VERT
- #define WTBSLeft ((WStyle)0x00000004L) // TBS_LEFT
- #define WTBSTop ((WStyle)0x00000004L) // TBS_TOP
- #define WTBSBoth ((WStyle)0x00000008L) // TBS_BOTH
- #define WTBSNoTicks ((WStyle)0x00000010L) // TBS_NOTICKS
- #define WTBSEnableSelRange ((WStyle)0x00000020L) // TBS_ENABLESELRANGE
- #define WTBSFixedLength ((WStyle)0x00000040L) // TBS_FIXEDLENGTH
- #define WTBSNoThumb ((WStyle)0x00000080L) // TBS_NOTHUMB
-
- struct WSliderFDXDataStruct {
- WLong position;
- WRange range;
- };
-
- class WCMCLASS WSlider : public WControl {
- WDeclareSubclass( WSlider, WControl );
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- WSlider();
-
- ~WSlider();
-
- /**********************************************************
- * Properties
- *********************************************************/
-
- // ChannelRectangle
-
- WRect GetChannelRectangle();
-
- // FDXDataSource
-
- WBool SetFDXDataSource( WLong * fdxDataSource );
- WBool SetFDXDataSource( WSliderFDXDataStruct * fdxDataSource );
-
- // LineSize
-
- WBool SetLineSize( WLong size=1 );
- WLong GetLineSize();
-
- // NumTicks
-
- WLong GetNumTicks();
-
- // PageSize
-
- WBool SetPageSize( WLong size );
- WLong GetPageSize();
-
- // Position
-
- WBool SetPosition( WLong pos );
- WLong GetPosition();
-
- // Range
-
- WBool SetRange( const WRange & range, WBool redraw=TRUE );
- WRange GetRange();
-
- // SelectedRange
-
- WBool SetSelectedRange( const WRange & range, WBool redraw=TRUE );
- WRange GetSelectedRange();
-
- // ThumbRectangle
-
- WRect GetThumbRectangle();
-
- // TickFrequency
-
- WLong GetTickFrequency() const;
- WBool SetTickFrequency( WLong frequency=1 );
-
- /**********************************************************
- * Methods
- *********************************************************/
-
- // Add Tick
- WBool AddTick( WLong pos );
-
- // ClearSelectedRange
-
- WBool ClearSelectedRange( WBool redraw=TRUE );
-
- // DeleteAllTicks
-
- WBool DeleteAllTicks( WBool redraw=TRUE );
-
- /**********************************************************
- * Item Properties
- *********************************************************/
-
- // TickPosition
-
- WLong GetTickPosition( WShort tickIndex );
- WLong GetTick ( WShort tickIndex );
-
- /**************************************************************
- * Overrides
- **************************************************************/
-
- protected:
-
- virtual WBool MakeWindow( WWindow * parent, WUInt id,
- const WChar * className,
- const WChar * title, const WRect & r,
- WStyle wstyle, WStyle exStyle,
- void * data=NULL );
-
- public:
-
- virtual const WChar * InitializeClass();
-
- virtual WStyle GetDefaultStyle() const;
-
- virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
- void * data=NULL );
-
- virtual WBool ProcessMessage( const WMessage & msg,
- WLong & returns );
-
- virtual WBool FDXIn();
-
- virtual WBool FDXOut();
-
- /**************************************************************
- * Data members
- **************************************************************/
-
- private:
- WLong * _fdxDataSource;
- WSliderFDXDataStruct * _fdxDataSourceStruct;
- WLong _tickFrequency;
- };
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WSLIDER_HPP_INCLUDED
-