home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
IFRAMEXT.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
10KB
|
219 lines
#ifndef _IFRAMEXT_
#define _IFRAMEXT_
/*******************************************************************************
* FILE NAME: iframext.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* IFrameExtension - Frame "extension" stucture *
* IFrameExtensions - Wrapper for a sequence of IFrameExtension objects *
* *
* 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 _IBASE_
#include <ibase.hpp>
#endif
#ifndef _IFRAME_
#include <iframe.hpp>
#endif
#ifndef _IRECT_
#include <irect.hpp>
#endif
class ISWP;
class IPresSpaceHandle;
#pragma info(none)
#include <iseq.h>
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class IFrameExtension : public IBase {
typedef IBase
Inherited;
/*******************************************************************************
* The IFrameExtension class's instances are maintained by IFrameWindows to *
* record information about each frame extension. *
* *
* The extensions and setExtensions functions of the IFrameWindow class deal *
* with collections of such frame extensions. Each collection is actually an *
* instance of class IFrameExtensions, which is essentially just a synonym for *
* ISequence<IFrameExtension*>. *
* *
* Frame extensions have the following attributes: *
* type - There are two basic types: extensions that have a fixed width *
* or height, and those whose width or height is a fraction of the *
* frame control they occupy (see the location attribute below). *
* size - This size is either a specific width or height (for fixed-size *
* extensions) or a fraction (for relative-sized extensions). *
* location - This attribute specifies the portion of the frame the *
* extension occupies. IFrameWindow::Location enumerates the *
* possible values. *
* control - This attribute is a pointer to the control window that *
* occupies the extension. *
*******************************************************************************/
public:
/*------------------------- Constructors ---------------------------------------
| The constructors for this class accept the same set of arguments as |
| IFrameWindow::addExtension. |
------------------------------------------------------------------------------*/
IFrameExtension ( IWindow *window,
IFrameWindow::Location location,
unsigned long widthOrHeight,
IFrameWindow::SeparatorType separator );
IFrameExtension ( IWindow *window,
IFrameWindow::Location location,
double percentage,
IFrameWindow::SeparatorType separator );
/*-------------------------------- Accessors -----------------------------------
|The following functions provide means of getting and setting |
|the accessible attributes of instances of this class: |
| Type - Enumeration of possible extension "types". Values are: |
| fixed - Extension has a fixed width or height. |
| relative - Extension has a relative width or height, |
| based on how much of the frame control it |
| occupies. |
| type - Returns the extension type. |
| location - Returns the frame extension location. |
| separatorWidth - Returns the width of the separator line between this |
| extension and the control to which it is attached (or the |
| extension to which it is adjacent). |
| setSize - Resets the size of the extension. |
| relativeSize - Returns the relative width or height as a percentage |
| (0.0 if the extension is of type fixed). |
| fixedSize - Returns the fixed width or height in window coordinates |
| (0 if the extension is of type relative). |
| control - Pointer to the IControl window that occupies this |
| extension. |
| attachedToId - Returns the ID of the frame control to which this |
| extension is attached. |
------------------------------------------------------------------------------*/
enum Type
{
fixed,
relative
};
Type
type ( ) const;
IFrameWindow::Location
location ( ) const;
virtual IFrameExtension
&setSize ( int widthOrHeight ),
&setSize ( double widthOrHeight );
virtual unsigned
separatorWidth ( ) const;
virtual double
relativeSize ( ) const;
virtual unsigned long
fixedSize ( ) const;
IWindow
*control ( ) const;
virtual unsigned long
attachedToId ( ) const;
/*----------------------------- Extension Sizing -------------------------------
| The following functions are used to size extensions: |
| attachTo - Returns the SWP structure, which contains information |
| about how the frame extension should be sized when it is |
| attached to the control. The position of the control is |
| indicated by the SWP argument. The SWP structure is |
| updated to account for the space occupied by this |
| extension. |
| sizeTo - Calculates and returns the size this extension would have |
| when it is attached to a control of the argument size. |
| totalRectFor - Calculates and returns a rectangle from a base rectangle |
| plus the frame extension's size and position. |
| baseRectFor - Calculates and returns a rectangle from a total rectangle |
| (that is, a client rectangle with a frame extension) minus |
| the frame extension's size and position. |
------------------------------------------------------------------------------*/
virtual ISWP
attachTo ( ISWP &baseSWP );
virtual ISize
sizeTo ( const ISize &baseSize ) const;
virtual IRectangle
totalRectFor( const IRectangle& baseRect ) const,
baseRectFor( const IRectangle& totalRect ) const;
/*--------------------------------- Drawing ------------------------------------
| This function provides support to aid in drawing frame extensions: |
| drawSeparator - Draws the separator line between an extension and the |
| adjacent control (or extension) to which it is attached. |
------------------------------------------------------------------------------*/
virtual void
drawSeparator ( const IPresSpaceHandle &psh ) const;
protected:
private: /*------------------------ PRIVATE ----------------------------------*/
union
{
double
extRelativeSize;
unsigned long
extFixedSize;
};
Type
extType;
IFrameWindow::Location
extLocation;
IFrameWindow::SeparatorType
extSeparator;
IPoint
extPosition;
ISize
extSize;
IWindow
*extControl;
}; // class IFrameExtension
class IFrameExtensions : public ISequence< IFrameExtension* > {
/*******************************************************************************
* The IFrameExtensions class is a set that was created using the IBM *
* Collection Class Library. The IFrameExtensions class is a wrapper for a *
* sequence of IFrameExtension objects. It is used to add a level of *
* indirection in the IFrameWindow interface. *
*******************************************************************************/
public:
IFrameExtensions ( );
~IFrameExtensions ( );
}; // class IFrameExtensions
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#ifndef I_NO_INLINES
#include <iframext.inl>
#endif
#pragma info(restore)
#endif // _IFRAMEXT_