home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
ool.zip
/
OOL
/
source
/
xspinbtn.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1997-03-07
|
3KB
|
113 lines
#include "xspinbtn.h"
/*@ XSpinButton :: XSpinButton(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, const char *string, const char *font)
@group constructors/destructors
@remarks Constructs a XSpinButton
@parameters <t '°' c=2>
°XWindow * owner °the owner of the XSlider
°XRect * rect °the rectangle
°USHORT id °id of the window
°ULONG style °style, valid values are:
<t '°' c=1>
°SP_LEFT
°SP_RIGHT
°SP_CENTER
°SP_NOBORDER
°SP_FAST
°SP_MASTER
°SP_SERVANT
°SP_READONLY
°SP_NUMERIC
°SP_CHAR
°SP_FILLZERO
</t>
(can be or-ed)
°char * font °font to use, e.g. "8.Helv"
</t>
*/
XSpinButton :: XSpinButton(const XWindow * owner, const XRect * rec, const USHORT id, const ULONG style, const char *string, const char *font):XControl(rec, style, owner, string, WC_SPINBUTTON, id, font)
{
}
/*@ XSpinButton::SpinDown(const LONG units)
@group misc
@remarks Spin down window-content
@parameters LONG units units to spin down
*/
void XSpinButton::SpinDown(const LONG units) const
{
WinSendMsg(winhandle, SPBM_SPINDOWN, (MPARAM) units, 0);
}
/*@ XSpinButton::SpinUp(const LONG units)
@group misc
@remarks Spin up window-content
@parameters LONG units units to spin up
*/
void XSpinButton::SpinUp(const LONG units) const
{
WinSendMsg(winhandle, SPBM_SPINUP, (MPARAM) units, 0);
}
/*@ XSpinButton::SetTextLimit(const SHORT limit)
@group misc
@remarks Set maximum textlength
@parameters SHORT limit maximum length
*/
void XSpinButton::SetTextLimit(const SHORT limit) const
{
WinSendMsg(winhandle, SPBM_SPINDOWN, MPFROMSHORT(limit), 0);
}
/*@ XSpinButton::SetMaster(const XWindow * master)
@group misc
@remarks
@parameters XWindow* master
@returns BOOL result
*/
BOOL XSpinButton::SetMaster(const XWindow * master) const
{
return (BOOL) WinSendMsg(winhandle, SPBM_SETMASTER, (MPARAM) master->GetHandle(), 0);
}
/*@ XSpinButton::GetValue(void)
@group set/query values
@remarks Returns the current value of the spinbutton
*/
LONG XSpinButton::GetValue(void)
{
LONG l;
WinSendMsg(winhandle, SPBM_QUERYVALUE, MPFROMP((VOID *) & l), 0);
return l;
}
/*@ XSpinButton::SetLimits(const LONG lowerLimit, const LONG upperLimit)
@group limits
@remarks Set limits of the spinbutton
@parameters LONG lowerLimit the lower limit<BR>
LONG upperLimit the upper limit
*/
void XSpinButton::SetLimits(const LONG lowerLimit, const LONG upperLimit) const
{
WinSendMsg(winhandle, SPBM_SETLIMITS, (MPARAM) upperLimit, (MPARAM) lowerLimit);
}
/*@ XSpinButton::SetValue(const LONG val)
@group set/query values
@remarks Set the value of the spinbutton
@parameters LONG value the new value
*/
void XSpinButton::SetValue(const LONG val) const
{
WinSendMsg(winhandle, SPBM_SETCURRENTVALUE, (MPARAM) val, 0);
}