home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
sybase
/
starbuck
/
hpp.z
/
WUPDOWN.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1996-10-18
|
6KB
|
169 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. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
*/
/*************************************************************************
*
* WUpDown -- Wrapper for the Windows 95 UpDown control.
*
*
* Events:
*
* DeltaPosition --
*
*************************************************************************/
#ifndef _WUPDOWN_HPP_INCLUDED
#define _WUPDOWN_HPP_INCLUDED
#ifndef _WNO_PRAGMA_PUSH
#pragma pack(push,8);
#pragma enum int;
#endif
#ifndef _WTEXTBOX_HPP_INCLUDED
# include "wtextbox.hpp"
#endif
#ifndef _WCONTROL_HPP_INCLUDED
# include "wcontrol.hpp"
#endif
typedef void WCMDEF (WObject::*WUpDownCallback)( WWindow *source,
void *userdata );
//
// UpDown styles
//
#define WUDSDefault ((WStyle)0x50000027L) // WS_VISIBLE|WS_CHILD|UDS_ARROWKEYS|UDS_WRAP|UDS_SETBUDDYINT|UDS_ALIGNRIGHT
#define WUDSWrap ((WStyle)0x00000001L) // UDS_WRAP
#define WUDSSetBuddyInt ((WStyle)0x00000002L) // UDS_SETBUDDYINT
#define WUDSAlignRight ((WStyle)0x00000004L) // UDS_ALIGNRIGHT
#define WUDSAlignLeft ((WStyle)0x00000008L) // UDS_ALIGNLEFT
#define WUDSAutoBuddy ((WStyle)0x00000010L) // UDS_AUTOBUDDY
#define WUDSArrowKeys ((WStyle)0x00000020L) // UDS_ARROWKEYS
#define WUDSHorz ((WStyle)0x00000040L) // UDS_HORZ
#define WUDSNoThousands ((WStyle)0x00000080L) // UDS_NOTHOUSANDS
/* NOTE: The following styles we fake ourselves
* We assume that the style bits from
* 0x8000 to 0x1000 are not taken by any UDS_* values
*/
#define WUDSReadOnly ((WStyle)0x00008000L) // UDS_READONLY
#define WUDSLeftJustify ((WStyle)0x00004000L) // UDS_LEFTJUSTIFY
#define WUDSCenterJustify ((WStyle)0x00002000L) // UDS_CENTERJUSTIFY
#define WUDSRightJustify ((WStyle)0x00001000L) // UDS_RIGHTJUSTIFY
struct WDeltaPositionEventData : public WEventData {
WInt position;
WInt delta;
};
class WCMCLASS WUpDown : public WControl {
WDeclareSubclass( WUpDown, WControl );
public:
/**********************************************************
* Constructors and Destructors
*********************************************************/
WUpDown( WBool autoCreateEdit=FALSE );
~WUpDown();
/**********************************************************
* Properties
*********************************************************/
// Base -- the base (e.g. base 10, base 16) with which the value
// is stored
WBool SetBase( WShort base=10 );
WShort GetBase();
// Buddy -- handle of the window which the updown control is
// attached to
WBool SetBuddy( WWindow * buddy );
WWindow * GetBuddy();
// Increment -- increment by which the value increases each time
WBool SetIncrement( WInt increment );
WInt GetIncrement();
// Range
WBool SetRange( const WRange & range );
WRange GetRange();
// Value
WBool SetValue( WShort value );
WShort GetValue();
/**************************************************************
* Methods
**************************************************************/
// CreateAutoEdit
WTextBox * CreateAutoEdit();
/**************************************************************
* Overrides
**************************************************************/
protected:
virtual WBool ProcessNotify( WUInt id, WNotify code,
WNotifyInfo info, WLong & returns );
public:
virtual const WChar * InitializeClass();
virtual WStyle GetDefaultStyle() const;
virtual WBool CloneWindow( WStyle newStyle, WStyle newExStyle,
void * data=NULL );
virtual WBool MakeWindow( WWindow * parent, WUInt id,
const WChar * className,
const WChar * title, const WRect & r,
WStyle wstyle, WStyle exStyle,
void * data=NULL );
/**************************************************************
* Others
**************************************************************/
WBool LocalMakeWindow( WUInt id, const char *, const char *,
const WRect & r, WStyle style, WStyle,
void * data );
/**************************************************************
* Data members
**************************************************************/
private:
WBool _autoCreateEdit;
WTextBox * _editbox;
WInt _increment;
};
#ifndef _WNO_PRAGMA_PUSH
#pragma enum pop;
#pragma pack(pop);
#endif
#endif // _WUPDOWN_HPP_INCLUDED