home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IBMPCTL_
- #define _IBMPCTL_
- /*******************************************************************************
- * FILE NAME: Ibmpctl.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * Ibmpctl - This class creates and manages a bitmap 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/IBMPCTL.HPV $
- //
- // Rev 1.9 25 Oct 1992 17:05:02 nunn
- //changed library name to ICLUI
- //
- // Rev 1.8 25 Oct 1992 10:50:58 boezeman
- //Add documentation and converted file to skeleton.hpp format
-
- Rev 1.7 13 Oct 1992 21:12:36 tsuji
- Correct comments around log directive.
-
- Rev 1.6 13 Oct 1992 20:56:22 tsuji
- Correct log directive, remove IBM Confidential classification.
-
- Rev 1.5 13 Oct 1992 19:05:10 tsuji
- Remove no-op virtual destructor, add Inherited typedef.
- *******************************************************************************/
- #ifndef _ICONTROL_
- #include <icontrol.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IBitmapControl; /* bc */
- class IBitmapHandle;
- class IRectangle;
- class IResourceId;
- class ISize;
- class IWindowHandle;
- #ifndef _IBITFLAG_
- #include <ibitflag.hpp>
- #endif
-
- class IBitmapControl : public IControl {
- /*******************************************************************************
- * This class creates and manages a bitmap control. *
- * *
- * To use this class, create an instance of this class as follows: *
- * IBitmapControl bcBitmap(ID_BITMAP, this, IRectangle(10,10,20,20)), *
- * ID_BITMAP_RES, IResourceMgr()); *
- * The size of the control window is the size of the bitmap image. *
- * *
- * EXAMPLE: *
- * <sample code> *
- *******************************************************************************/
- /*The next release will provide an option to scale the image. */
- typedef IControl
- Inherited;
- public:
- INESTEDBITFLAGCLASSDEF1(Style, IBitmapControl, IWindow);
- // style class definition
- static const Style
- autosize,
- initSize;
- static const Style&
- defStyle;
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 4 ways to construct instances of this class: |
- | 1. default |
- | 2. From a System Bitmap |
- | 3. From a Dialog Template |
- | 4. From a Window |
- ------------------------------------------------------------------------------*/
- IBitmapControl(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- const IResourceId& bmpId,
- Style style = defStyle);
-
- IBitmapControl(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- ISysBitmapHandle::Type bmp,
- Style style = defStyle);
-
- IBitmapControl(unsigned long Id,
- const IWindow* parentDialog);
-
- IBitmapControl(IWindowHandle handle);
-
- /*-------------------------------- STYLES --------------------------------------
- | These function provide means of getting and setting the default style |
- | attributes of instances of this class: |
- | defaultStyle - Returns the three state control default style setting |
- | setDefaultStyle - Sets the three state control default style |
- ------------------------------------------------------------------------------*/
- static Style
- defaultStyle();
- static void
- setDefaultStyle(Style style);
-
- /*-------------------------------- QUERY/SET HANDLE ----------------------------
- | setBitmap - Changes a static bitmap control window. |
- | bitmap - Returns the handle to the static bitmap. |
- ------------------------------------------------------------------------------*/
- void
- setBitmap(const IResourceId& bmpId),
- setBitmap(IBitmapHandle handle),
- setBitmap(ISysBitmapHandle::Type bmp),
- setBitmap(ISysBitmapHandle handle);
- IBitmapHandle
- bitmap() const;
- /***********************************************************/
- /* Scaling of bitmap -- need to handle later. */
- /* Also, repaint buffer does not work with bitmaps -- can */
- /* provide a solution here or in dispatch()? */
- /***********************************************************/
-
- protected:
- /*----------------------------- LAYOUT SIZE ------------------------------------
- | calcMinSize - Returns the minimum size that this bitmap control should be. |
- ------------------------------------------------------------------------------*/
- virtual ISize
- calcMinSize();
-
- static Style
- classDefaultStyle;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- IBitmapControl(const IBitmapControl&);
- //IBitmapControl& operator=(const IBitmapControl);
-
- void
- create(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- Style style);
-
- static const Style
- bitmapStyle;
-
- IBitmapHandle
- bmpHandle;
- Boolean
- bSizeTo;
- }; // class IBitmapControl
-
- INESTEDBITFLAGCLASSFUNCS(Style, IBitmapControl);
- // global style functions
- #endif /* _IBMPCTL_ */