home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IICONCTL_
- #define _IICONCTL_
- /*******************************************************************************
- * FILE NAME: Iiconctl.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * Iiconctl - This class creates and manages an icon control. *
- * *
- * 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/IICONCTL.HPV $
- //
- // Rev 1.8 25 Oct 1992 17:05:30 nunn
- //changed library name to ICLUI
- //
- // Rev 1.7 25 Oct 1992 10:54:46 boezeman
- //Add documentation and converted file to skeleton.hpp format.
-
- Rev 1.6 13 Oct 1992 21:22:16 tsuji
- Correct comments around log directive.
-
- Rev 1.5 13 Oct 1992 20:57:00 tsuji
- Correct log directive, remove IBM Confidential classification.
-
- Rev 1.4 13 Oct 1992 19:05:54 tsuji
- Remove no-op virtual destructor, add Inherited typedef.
- *******************************************************************************/
- #ifndef _ICONTROL_
- #include <icontrol.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IIconControl; /* ic */
- class IPointerHandle;
- class IRectangle;
- class IResourceId;
- class ISize;
- class IWindowHandle;
- #ifndef _IBITFLAG_
- #include <ibitflag.hpp>
- #endif
-
- class IIconControl : public IControl {
- /*******************************************************************************
- * This class creates and operates on an icon control. *
- * EXAMPLE: *
- * <sample code> *
- *******************************************************************************/
- typedef IControl
- Inherited;
-
- public:
- INESTEDBITFLAGCLASSDEF1(Style, IIconControl, IWindow);
- // style class definition
- static const Style
- autosize;
- static const Style&
- defStyle;
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 4 ways to construct instances of this class: |
- | 1. default |
- | 2. From a System Icon |
- | 3. From a Dialog Template |
- | 4. From a Window |
- ------------------------------------------------------------------------------*/
- IIconControl(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- const IResourceId& iconId,
- Style style = defStyle);
-
- IIconControl(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- ISysPointerHandle::Type icon,
- Style style = defStyle);
-
- IIconControl(unsigned long Id,
- const IWindow* parentDialog);
-
- IIconControl(IWindowHandle handle);
-
- /*-------------------------------- STYLES --------------------------------------
- | These function provide means of getting and setting the default style |
- | attributes of instances of this class: |
- | defaultStyle - returns the icon control default style setting |
- | setDefaultStyle - sets the icon control default style |
- ------------------------------------------------------------------------------*/
- static Style
- defaultStyle();
- static void
- setDefaultStyle(Style style);
-
- /*-------------------------------- QUERY/SET HANDLE ----------------------------
- | These operations return and change the icon image in an icon control window. |
- | setIcon - Sets the icon handle of the icon control window |
- | icon - Returns the handle of the currently set icon |
- ------------------------------------------------------------------------------*/
- void
- setIcon(const IResourceId& iconId),
- setIcon(IPointerHandle handle),
- setIcon(ISysPointerHandle::Type icon),
- setIcon(ISysPointerHandle handle);
- IPointerHandle
- icon() const;
- /***********************************************************/
- /* Scaling of icon -- need to handle later? */
- /* Also, repaint buffer does not work with icons -- can */
- /* provide a solution here or in dispatch()? */
- /***********************************************************/
-
- protected:
- /*----------------------------- LAYOUT SIZE ------------------------------------
- | calcMinSize - returns the minimum size that this icon control should be. |
- ------------------------------------------------------------------------------*/
- virtual ISize
- calcMinSize();
-
- static Style
- classDefaultStyle;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- IIconControl(const IIconControl&);
- //IIconControl& operator=(const IIconControl&);
-
- void
- create(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- Style style);
-
- static const Style
- iconStyle,
- systemIconStyle;
-
- IPointerHandle
- iconHandle;
- }; // class IIconControl
-
- INESTEDBITFLAGCLASSFUNCS(Style, IIconControl);
- // global style functions
- #endif /* _IICONCTL_ */