home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ICONTROL.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
7KB
|
144 lines
#ifndef _ICONTROL_
#define _ICONTROL_
/*******************************************************************************
* FILE NAME: icontrol.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IControl - This is the abstract base class for all control *
* view windows. *
* *
* 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. *
* *
*******************************************************************************/
#ifndef _IWINDOW_
#include <iwindow.hpp>
#endif
#ifndef _IBITFLAG_
#include <ibitflag.hpp>
#endif
#ifndef _IPOINT_
#include <ipoint.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
// Forward declarations for other classes:
class IFont;
class IControl : public IWindow {
typedef IWindow
Inherited;
/*******************************************************************************
* The IControl class is the abstract base class for control *
* view windows. *
*******************************************************************************/
public:
/*---------------------- Style --------------------------------------------
The IControl::Style nested class provides static members that define the
set of valid control styles. These styles can be used in conjunction with
the styles defined by the nested class IWindow::Style. For example, you
could define an instance of the IControl::Style class and initialize it
like:
IControl::Style
style = IControl::group | IWindow::visible;
An object of this type is provided when the control is created. A
customizable default is used if no styles are specified. Once the object
is constructed, IControl and IWindow member functions can be used to set
or query the object's style.
The declaration of the IControl::Style nested class is generated by the
INESTEDBITFLAGCLASSDEF1 macro.
The valid control styles are:
group - Identifies the control as being the first in a group. No other
controls in the group can have this style. Controls in the
group must be siblings that are constructed following the first
control. The group can be cursored through and when the last
control in the group is reached, the cursor returns to the
first control in the group.
tabStop - Identifies the control as one to which the user can tab.
-------------------------------------------------------------------------*/
INESTEDBITFLAGCLASSDEF1(Style, IControl, IWindow);
static const Style
group,
tabStop;
/*------------------------ Constructors ----------------------------------------
| Instances of this class cannot be created. |
------------------------------------------------------------------------------*/
IControl();
virtual
~IControl() = 0;
/*-------------------------------- Style Operations ----------------------------
| The following functions are used in style operations: |
| enableGroup - Sets the group style of a control. This makes the |
| control first in a cursorable group of controls. |
| disableGroup - Removes the group style from a control. This removes |
| a control from a group of controls. |
| isGroup - Returns true if the control has the group style set; |
| otherwise, false is returned. |
| enableTabStop - Sets the tabstop style of a control. This identifies |
| the control as one that can be tabbed to. |
| disableTabStop - Removes the tabstop style from a control. This |
| prevents this control from being tabbed to. |
| isTabStop - Returns true if the control has the tabstop style set; |
| otherwise, false is returned. |
------------------------------------------------------------------------------*/
IControl
&enableGroup ( Boolean enable = true ),
&disableGroup ( );
Boolean
isGroup ( ) const;
IControl
&enableTabStop ( Boolean enable = true ),
&disableTabStop ( );
virtual Boolean
isTabStop ( ) const;
/*----------------------------- Font -------------------------------------------
| The following function is used to assigns fonts: |
| setFont - Assigns a new font to be used by the control. |
------------------------------------------------------------------------------*/
virtual IControl
&setFont (const IFont& fm );
protected:
/*------------------------------ Implementation --------------------------------
| The following function may be used to calculate the minimum size for the |
| control: |
| characterSize - Calculates and returns the average character width and |
| maximum character height for the currently set font. |
------------------------------------------------------------------------------*/
ISize
characterSize ( );
private:
/*--------------------------------- Private ----------------------------------*/
IControl ( const IControl& );
IControl
&operator= ( const IControl& );
ISize
sizClChar;
}; // class IControl
INESTEDBITFLAGCLASSFUNCS(Style, IControl); // global style functions
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _ICONTROL_ */