home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ISTATTXT_
- #define _ISTATTXT_
- /*******************************************************************************
- * FILE NAME: istattxt.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * Istattxt - This class creates and manages the static text 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/ISTATTXT.HPV $
- //
- // Rev 1.7 25 Oct 1992 17:06:16 nunn
- //changed library name to ICLUI
- //
- // Rev 1.6 25 Oct 1992 10:57:58 boezeman
- //Add documentation and converted file to skeleton.hpp format.
-
- Rev 1.5 13 Oct 1992 21:22:38 tsuji
- Correct comments around log directive.
-
- Rev 1.4 13 Oct 1992 20:57:56 tsuji
- Correct log directive, remove IBM Confidential classification.
-
- Rev 1.3 13 Oct 1992 19:06:20 tsuji
- Remove no-op virtual destructor, add Inherited typedef.
- *******************************************************************************/
- #ifndef _ITEXTCTL_
- #include <itextctl.hpp>
- #endif
- // Forward declarations for other classes:
- class IStaticText; /* sttxt */
- class IRectangle;
- class ISize;
- class IWindowHandle;
- #ifndef _IBITFLAG_
- #include <ibitflag.hpp>
- #endif
-
- class IStaticText : public ITextControl {
- /*******************************************************************************
- * This class creates and manages the static text control window. *
- * *
- * To use this class, create an instance of this class as follows: *
- * IStaticText sttxtText(ID_TEXT,this,IRectangle(10,10,30,12)); *
- * sttxtText.setText("It is a wonderful day"); *
- * *
- * To change the style of the static text control after it has been created, *
- * use functions such as: *
- * setAlignment(IStaticText::centerCenter). *
- * *
- * Valid styles for a static text control are: *
- * IStaticText::autosize, *
- * IStaticText::left, *
- * IStaticText::center, *
- * IStaticText::right, *
- * IStaticText::top, *
- * IStaticText::vertCenter, *
- * IStaticText::bottom, *
- * IStaticText::wordBreak, *
- * IStaticText::defStyle, and any of the *
- * IWindow styles. *
- * *
- * EXAMPLE: *
- * <sample code> *
- *******************************************************************************/
- typedef ITextControl
- Inherited;
- public:
- INESTEDBITFLAGCLASSDEF1(Style, IStaticText, IWindow);
- // style class definition
- static const Style
- autosize,
- left,
- center,
- right,
- top,
- vertCenter,
- bottom,
- wordBreak;
- 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 |
- ------------------------------------------------------------------------------*/
- IStaticText(unsigned long Id,
- const IWindow* parent,
- const IWindow* owner,
- const IRectangle& initial,
- Style style = defStyle);
-
- IStaticText(unsigned long Id,
- const IWindow* parentDialog);
-
- IStaticText(IWindowHandle handle);
-
- /*-------------------------------- STYLES --------------------------------------
- | These function provide means of getting and setting the default style |
- | attributes of instances of this class: |
- | defaultStyle - returns the static text control default style setting |
- | setDefaultStyle - sets the static text control default style |
- ------------------------------------------------------------------------------*/
- static Style
- defaultStyle();
- static void
- setDefaultStyle(Style style);
-
- /*-------------------------------- ALIGNMENT OPERATION -------------------------
- | setAlignment - sets the alignment of the static text. |
- ------------------------------------------------------------------------------*/
- enum Alignment { topLeft, topLeftWrapped, topCenter,
- topRight, centerLeft, centerCenter,
- centerRight, bottomLeft,
- bottomCenter, bottomRight };
- void
- setAlignment(Alignment alignment);
-
- protected:
- /*----------------------------- LAYOUT SIZE ------------------------------------
- | calcMinSize - returns the minimum size that this static text control should be|
- ------------------------------------------------------------------------------*/
- virtual ISize
- calcMinSize();
-
- static Style
- classDefaultStyle;
-
- private:
- /*--------------------------------- PRIVATE ----------------------------------*/
- IStaticText(const IStaticText&);
- //IStaticText& operator=(const IStaticText&);
-
- static const Style
- staticText,
- allAlignments;
- }; // class IStaticText
-
- INESTEDBITFLAGCLASSFUNCS(Style, IStaticText);
- // global style functions
- #endif // _ISTATTXT_