home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ISPINBUTTON_
- #define _ISPINBUTTON_
- /*******************************************************************************
- * FILE NAME: ispinbt.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * Ispinbt - This class creates and manages the spin button control window.*
- * *
- * COPYRIGHT: *
- * Licensed Materials - Property of IBM *
- * (C) Copyright IBM Corporation 1992, 1993 *
- * All Rights Reserved *
- * US Government Users Restricted Rights - Use, duplication, or disclosure *
- * restricted by GSA ADP Schedule Contract with IBM Corp. *
- * *
- * $Log: R:/IBMCLASS/IBASECTL/VCS/ISPINBT.HPV $
- //
- // Rev 1.4 25 Oct 1992 17:06:12 nunn
- //changed library name to ICLUI
- //
- // Rev 1.3 25 Oct 1992 10:57:40 boezeman
- //Add documentation and converted file to skeleton.hpp format.
-
-
- Rev 1.2 18 Sep 1992 20:55:52 Martin D Vo
- Convert to 930 driver
-
- Rev 1.1 28 Oct 1991 19:02:08 Tim Hertz
- Initial Development
- *******************************************************************************/
- #ifndef _ICONTROL_
- #include "icontrol.hpp"
- #endif
-
- // Forward declarations for other classes:
- class ISpinButton; /* spb */
- class IRectangle;
-
- class ISpinButton : public IControl {
- /*******************************************************************************
- * This class creates and manages the spin button control window. *
- * *
- * To use this class, create an instance of this class as follows: *
- * ISpinButton* pSpinBtn = new ISpinButton(id, *
- * pMyAppWin, *
- * IRectangle( *
- * IPoint(10,100), *
- * ISize(200,20)); *
- * pSpinBtn->setLimits(0,59); *
- * ... *
- * ULONG Number = pSpinBtn->value(); *
- * *
- * EXAMPLE: *
- * <sample code> *
- *******************************************************************************/
- typedef IControl
- Inherited;
- public :
- INESTEDBITFLAGCLASSDEF2(Style, ISpinButton, IWindow, IControl);
-
- static const Style
- master,
- slave,
- allChar,
- leftAlign,
- centerAlign,
- rightAlign,
- defaultStyle;
-
-
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 3 ways to construct instances of this class: |
- | 1. default |
- | 2. From a Dialog Template |
- | 3. From a Window |
- ------------------------------------------------------------------------------*/
- ISpinButton (unsigned long id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- Style style = defaultStyle);
-
- ISpinButton (unsigned long id,
- const IWindow* parentDialog);
-
- ISpinButton (IWindowHandle handle);
-
- /*------------------------ GENERAL OPERATIONS ----------------------------------
- | setMaster - This call sets the master. |
- | setTextLimit - Set the number of characters allowed in the spin button. |
- | spinDown - Spin the button down the specified number of times. |
- | spinUp - Spin the button up the specified number of times. |
- ------------------------------------------------------------------------------*/
- void
- setMaster(const ISpinButton* spnb),
- setTextLimit(unsigned long limit),
- spinDown(unsigned long numToSpin = 1),
- spinUp(unsigned long numToSpin = 1);
-
- /*------------------------ NUMERICAL SPIN BUTTON OPERATIONS --------------------
- | setLimits - Set the limits of the spin button and change the entry if |
- | it is outside the new limits. |
- | overrideLimits- Set the limits of the spin button and do not change the entry|
- | if it is outside the new limits. |
- | upperLimit - Get the upper limit of the spin button range. |
- | lowerLimit - Get the lower limit of the spin button range. |
- | value - Get the value in the spin button entry field. |
- | setValue - Set the value in the spin button entry field. |
- ------------------------------------------------------------------------------*/
- void
- setLimits(long lowLimit, long highLimit),
- overrideLimits(long lowLimit, long highLimit),
- setValue(long value);
- long
- upperLimit() const,
- lowerLimit() const,
- value() const;
-
- /*------------------------ ALPHANUMERICAL SPIN BUTTON OPERATIONS ---------------
- | text - Returns the text in the spin button. |
- | it is outside the new limits. |
- | setIndex - Sets the spin button to the indexed item of the array. The items |
- | are zero-based |
- | setArray - Set an array of character strings as items in the spin button |
- ------------------------------------------------------------------------------*/
- enum Attribute { validate, noUpdate, always };
- IString
- text(Attribute attribute ) const;
- void
- setIndex(unsigned long index),
- setArray(char** array, unsigned long count);
-
- };
-
- INESTEDBITFLAGCLASSFUNCS( Style, ISpinButton);
-
- #endif