home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ISWP.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
8KB
|
169 lines
#ifndef _ISWP_
#define _ISWP_
/*******************************************************************************
* FILE NAME: iswp.hpp *
* *
* DESCRIPTION: *
* This file contains the declaration(s) of the class(es): *
* ISWP - Wrapper for PM SWP (set window position) structure. *
* ISWPArray - Array of ISWP stuctures. *
* *
* 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 _IHANDLE_
#include <ihandle.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class IPoint;
class ISize;
class ISWP : public IBase {
typedef IBase
Inherited;
/*******************************************************************************
* The ISWP class is a wrapper for the Presentation Manager Toolkit window *
* position structure. This class provides member functions to access and set *
* the various elements of this structure. *
* *
* The structure contains the following elements: *
* flags - A set of window size/move flags. The flags are defined by the *
* Toolkit SWP_* constants. *
* position - A window position represented by an IPoint. *
* size - A window size represented by an ISize. *
* behind - The window handle that identifies the window behind which to *
* place the window associated with this structure. *
* hwnd - The window handle of the window associated with this structure. *
* *
* This class provides member functions to get and set the position and size. *
* It provides accessors to get the hwnd as an IWindowHandle and to return *
* the flags as an unsigned long. *
*******************************************************************************/
public:
/*-------------------------------- Accessors -----------------------------------
| The following functions are used to get and set the accessible attributes |
| of instances of this class: |
| windowHandle - Returns the handle of the associated window. |
| position - Returns the window position stored in this object. |
| setPosition - Sets the window position. |
| size - Returns the window size stored in this object. |
| setSize - Sets the window size. |
| flags - Returns the flags stored in this object. |
------------------------------------------------------------------------------*/
IWindowHandle
windowHandle ( ) const;
IPoint
position ( ) const;
ISWP
&setPosition ( const IPoint &aPoint );
ISize
size ( ) const;
ISWP
&setSize ( const ISize &aSize );
unsigned long
&flags ( );
/*----------------------------------- Data -------------------------------------
| The data members must exactly match the layout of the Presentation Manager |
| SWP structure. |
| fl - Flags. |
| cy - Width. |
| cx - Height. |
| x - The X-coordinate position. |
| y - The Y-coordinate position. |
| behind - Handle for the "behind" window. |
| hwnd - Handle for this window. |
| ulReserved1 - Reserved. |
| ulReserved2 - Reserved. |
------------------------------------------------------------------------------*/
unsigned long
fl;
long
cy,
cx,
y,
x;
IWindowHandle
behind,
hwnd;
unsigned long
ulReserved1,
ulReserved2;
};
class ISWPArray : public IBase {
typedef IBase
Inherited;
/*******************************************************************************
* The ISWPArray class serves as a wrapper for an array of Presentation *
* Manager Toolkit SWP structures. This class treats those structures as ISWP *
* objects. *
* *
* It provides functions to access a given element of the array and to locate *
* the element that corresponds to a given window ID. *
*******************************************************************************/
public:
/*------------------------------- Constructor ----------------------------------
| You can construct an object of this class from a pointer to an ISWP object |
| (presumed to be the first element of the array) and a dimension (the number |
| of elements of the array). Typically, the ISWP* argument is created by |
| casting a Presentation Manager PSWP pointer. |
------------------------------------------------------------------------------*/
ISWPArray ( ISWP *array, unsigned dimension );
/*-------------------------------- Accessors -----------------------------------
| These functions provide a means of getting the accessible attributes of |
| instances of this class: |
| size - Returns the dimension of the array. |
| operator [] - Returns a reference to the nth element of the array. |
| indexOf - Returns a reference to the element that corresponds to a |
| window with the argument window ID value. |
------------------------------------------------------------------------------*/
unsigned
size ( ) const;
ISWP
&operator [] ( unsigned index );
unsigned
indexOf ( unsigned long id ) const;
private: /*------------------------ PRIVATE ----------------------------------*/
ISWP
*p;
unsigned
dim;
};
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
/*--------------------------------- INLINES ----------------------------------*/
#ifndef I_NO_INLINES
#include <iswp.inl>
#endif
#endif // _ISWP_