home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ILBDIHDR.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
7KB
|
125 lines
#ifndef _ILBDIHDR_
#define _ILBDIHDR_
/*******************************************************************************
* FILE NAME: ilbdihdr.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IListBoxDrawItemHandler - The list-box draw item event handler class *
* *
* 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 _IHANDLER_
#include <ihandler.hpp>
#endif
#ifndef _IBITFLAG_
#include <ibitflag.hpp>
#endif
#ifndef _ILBDIEVT_
#include <ilbdievt.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
class IListBoxDrawItemHandler : public IHandler {
typedef IHandler Inherited;
/*******************************************************************************
* The IListBoxDrawItemHandler class is used to process the list box draw item *
* event. *
* *
* The list box must be created with IListBox::drawItem style. *
*******************************************************************************/
public:
/*------------------------ Constructor -----------------------------------------
| The only way to construct instances of this class is by using the default |
| constructor. |
------------------------------------------------------------------------------*/
IListBoxDrawItemHandler();
virtual ~IListBoxDrawItemHandler();
protected:
/*-------------------------------- DrawFlag ------------------------------------
| This flag is set in the overridden draw function to indicate the actions |
| that were taken. |
| |
| DrawFlag - Nested class that provides static members that define the set |
| of valid actions taken within a draw function. An instance of |
| a DrawFlag is passed as the second argument to an overridden |
| IListBoxItemHandler::draw function. The overridden function |
| sets the drewSelected flag to indicate whether it drew the |
| selection indication. |
| |
| The declaration of the IListBoxItemHandler::DrawFlag nested |
| class is generated by the INESTEDBITFLAGCLASSDEF0 macro. |
| |
| The valid list box draw flags are: |
| |
| drewSelected - The highlighting of the list item was drawn. |
------------------------------------------------------------------------------*/
INESTEDBITFLAGCLASSDEF0(DrawFlag, IListBoxDrawItemHandler);
static const DrawFlag
drewSelected;
/*------------------------- Override Functions ---------------------------------
| dispatchHandlerEvent - Dispatches command functions for this handler. |
------------------------------------------------------------------------------*/
virtual Boolean
dispatchHandlerEvent(IEvent& evt);
/*------------------------- Event Handling Function ---------------------------|
| These event handling functions are dispatched by this handler: |
| setHeight - Override this function to set the height of the list box |
| item. All items in a list box have the same height. The |
| height must be greater than or equal to the height of the |
| current font. Set the height argument to the desired height |
| for the item. |
| draw - Override this function to draw the list item. By default, |
| the system will invert the bits to indicate list item |
| selection. Unless the system default method is |
| unacceptable, you should not have to draw the list item. If |
| you draw the list item yourself, set the DrawFlag before |
| returning from the draw function. This will prevent the |
| system from drawing the list item. The |
| IListBoxDrawItemEvent class provides the isSelected function |
| to query whether the list item is selected. |
| highlight - Override this function if you want to draw the highlight |
| that indicates a list item has been selected. You should do |
| this only if the system default of inverting the bits for a |
| selected item is unacceptable. |
| unhighlight - Override this function if you want to remove the highlight |
| to indicate a list item has been de-selected. You should do |
| this only if the system default method is unacceptable. |
------------------------------------------------------------------------------*/
virtual Boolean
setHeight(short& height);
virtual Boolean
draw(IListBoxDrawItemEvent& evt, DrawFlag& flag);
virtual Boolean
highlight(IListBoxDrawItemEvent& evt);
virtual Boolean
unhighlight(IListBoxDrawItemEvent& evt);
};
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#endif /* _ILBDIHDR_ */