home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ITITLE.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
9KB
|
167 lines
#ifndef _ITITLE_
#define _ITITLE_
/**************************************************************/
/* FILE NAME: ititle.hpp */
/* */
/* DESCRIPTION: */
/* Declaration of the class: */
/* ITitle - manages the window title text */
/* */
/* COPYRIGHT: */
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corporation 1992, 1993 */
/* US Government Users Restricted Rights - Use duplication */
/* or disclosure restricted by GSA ADP Schedule Contract */
/* with IBM Corp. */
/* */
/* */
/**************************************************************/
#ifndef _ITEXTCTL_
#include <itextctl.hpp>
#endif
#ifndef _IRESLIB_
#include <ireslib.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
/*----------------------------------------------------------------------------*/
/* Turn off warning for compiler generated copy/assignment */
/*----------------------------------------------------------------------------*/
#pragma info(nocpy)
// Forward declarations for other classes
class IResourceId;
class IString;
class IColor;
class ITitle : public ITextControl {
typedef ITextControl
Inherited;
/**********************************************************************
* The ITitle class consists of three components: *
* o Object text *
* o View text *
* o View number. *
* *
* The object text is required, while the other two are optional. The *
* object text and view text are separated by a hyphen (-). The view *
* text and view number are separated by a colon (:). *
* *
* Example: *
* *
* OS/2 System - Icon View:2 *
* *
* NOTE: Due to a Presentation Manager limitation, the length of any *
* title cannot exceed 60 characters. If you try to set the *
* title text to a length greater than 60, the text will be *
* truncated. *
**********************************************************************/
public:
/*------------------ Constructors/Destructor --------------------------
| You can construct instances of this class in the following ways: |
| - From char* |
| - From IResourceIds of STRINGTABLE items. |
---------------------------------------------------------------------*/
ITitle ( IWindow* owner,
const char* objectName = 0,
const char* viewName = 0,
unsigned long viewNumber = 0);
ITitle ( IWindow* owner,
const IResourceId& objectNameResId,
const IResourceId& viewNameResId = 0,
unsigned long viewNum = 0);
/*---------------------- Accessors ------------------------------------
| The following functions provide access to the title's components: |
| objectText - Returns the object text. |
| setObjectText - Sets the object text. |
| viewText - Returns the view text. |
| setViewText - Sets the view text. |
| viewNum - Returns the view number. |
| setViewNum - Sets the view number. |
| setTitleText - Sets all three components (object text, view |
| text, and view number) at once. |
---------------------------------------------------------------------*/
IString
objectText ( ) const,
viewText ( ) const;
ITitle
&setObjectText ( const char* objectName ),
&setObjectText ( const IResourceId &objectNameResId ),
&setViewText ( const char* viewName ),
&setViewText ( const IResourceId &viewNameResId ),
&setViewNum ( unsigned long viewNum ),
&setTitleText ( const char* objectName,
const char* viewName = 0,
unsigned long viewNum = 0 ),
&setTitleText ( const IResourceId &objectNameResId,
const IResourceId &viewNameResId = 0,
unsigned long viewNum = 0 );
unsigned long
viewNum() const;
/*---------------------- ColorArea Enumeration ---------------------------------
| ColorArea - Enumeration that is used to replace the color for a particular |
| area of the title bar. The valid values are: |
| activeFill - Sets the color for the area not |
| occupied by text when the window is |
| active. |
| inactiveFill - Sets the color for the area not |
| occupied by text when the window is |
| inactive. |
| activeTextForeground - Sets the color of the title text |
| foreground when the window is active. |
| inactiveTextForeground - Sets the color of the title text |
| foreground when the window is |
| inactive. |
| activeTextBackground - Sets the color of the title text |
| background when the window is |
| active. |
| inactiveTextBackground - Sets the color of the title text |
| background when the window is |
| inactive. |
| border - Sets the color of the title bar |
| border. |
------------------------------------------------------------------------------*/
enum ColorArea {
activeFill,
inactiveFill,
activeTextForeground,
inactiveTextForeground,
activeTextBackground,
inactiveTextBackground,
border };
/*-------------------------- Set and Query Color ------------------------------
| The following functions provide a means to set and query the title color: |
| setColor - Changes the color of the specific title bar area. |
| color - Returns the color of the specific title bar area. |
------------------------------------------------------------------------------*/
ITitle
&setColor ( ColorArea value,
const IColor& color );
IColor
color ( ColorArea value ) const;
/*----------------------- PRIVATE -----------------------------------*/
private:
ITitle(const ITitle& tleCopy) {}
IWindow
*pwinClOwner;
};
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing and warning messages. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#pragma info(restore)
#endif /* ifndef _ITITLE_ */