home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ICHECKBX_
- #define _ICHECKBX_
- /*******************************************************************************
- * FILE NAME: Icheckbx.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * Icheckbx - This class creates and manages the check box 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/ICHECKBX.HPV $
- //
- // Rev 1.6 25 Oct 1992 17:05:10 nunn
- //changed library name to ICLUI
- //
- // Rev 1.5 25 Oct 1992 10:49:32 boezeman
- //Added documentation and converted file to skeleton.hpp format.
-
- Rev 1.4 13 Oct 1992 21:21:56 tsuji
- Correct comments around log directive.
-
- Rev 1.3 13 Oct 1992 20:56:36 tsuji
- Correct log directive, remove IBM Confidential classification.
-
- Rev 1.2 13 Oct 1992 19:05:36 tsuji
- Remove no-op virtual destructor, add Inherited typedef.
- *******************************************************************************/
- #ifndef _ISETBUT_
- #include <isetbut.hpp>
- #endif
-
- // Forward declarations for other classes:
- class ICheckBox; /* chkbx */
- class IRectangle;
- class ISize;
- class IWindowHandle;
- #ifndef _IBITFLAG_
- #include <ibitflag.hpp>
- #endif
- class ICheckBox : public ISettingButton {
- /*******************************************************************************
- * This class creates and operates on a checkbox. *
- * *
- * To use this class, create an instance of this class as follows: *
- * ICheckBox chkbxChoice(ID_CHOICE, this, IRectangle(10,10,30,12)); *
- * chkbxChoice.setText("Hot and Spicy"); *
- * User action or invoking an operation on the check box *
- * will cause an IControlEvent. *
- * Use the id() and notifyCode() operations in IControlEvent to process the *
- * event(e.g. a notification code of BN_CLICKED or BN_DBLCLICKED). *
- * *
- * *
- * EXAMPLE: *
- * <sample code> *
- *******************************************************************************/
- typedef ISettingButton
- Inherited;
- public:
- INESTEDBITFLAGCLASSDEF3(Style, ICheckBox, IWindow,
- IControl, IButton);
- // style class definition
- static const Style
- autoSelect;
- static const Style&
- defStyle;
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 3 ways to construct instances of this class: |
- | 1. default |
- | 2. From a Dialog Template |
- | 3. From a Window |
- ------------------------------------------------------------------------------*/
- ICheckBox(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- Style style = defStyle);
-
- ICheckBox(unsigned long Id,
- const IWindow* parentDialog);
-
- ICheckBox(IWindowHandle handle);
-
- /*-------------------------------- STYLES --------------------------------------
- | These function provide means of getting and setting the default style |
- | attributes of instances of this class: |
- | defaultStyle - returns the check box control default style setting |
- | setDefaultStyle - sets the check box control default style |
- ------------------------------------------------------------------------------*/
- static Style
- defaultStyle();
- static void
- setDefaultStyle(Style style);
-
- /*-------------------------------- OVERLOADED AUTOSELECT------------------------
- | These operations are overloaded since the actual style setting is different. |
- | enableAutoSelect - sets/removes the check box control to/from the |
- | autoselect style |
- | disableAutoSelect - removes the autoselect style from the check box control |
- | isAutoSelect - returns true is the check box control has the |
- | autoselect style set else it returns false |
- ------------------------------------------------------------------------------*/
- virtual void
- enableAutoSelect(),
- disableAutoSelect();
- virtual Boolean
- isAutoSelect() const;
- protected:
- /*----------------------------- LAYOUT SIZE ------------------------------------
- | calcMinSize - returns the minimum size that this check box control should be.|
- ------------------------------------------------------------------------------*/
- virtual ISize
- calcMinSize();
-
- static Style
- classDefaultStyle;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- ICheckBox(const ICheckBox&);
- //ICheckBox& operator=(const ICheckBox&);
-
- static const Style
- checkBox;
- }; // class ICheckBox
-
- INESTEDBITFLAGCLASSFUNCS(Style, ICheckBox);
- // global style functions
- #endif /* _ICHECKBX_ */