home *** CD-ROM | disk | FTP | other *** search
- #ifndef _IPAINEVT_
- #define _IPAINEVT_
- /*******************************************************************************
- * FILE NAME: ipainevt.hpp *
- * *
- * DESCRIPTION: *
- * Declaration of the class(es): *
- * IPaintEvent - Represents a window repaint event. *
- * *
- * *
- * 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. *
- * *
- *$Log: S:/ibmclass/ibaseapp/vcs/ipainevt.hpv $ *
- //
- // Rev 1.22 26 Oct 1992 00:35:34 tsuji
- // Format/document in the style of the standard header file.
- *******************************************************************************/
- #ifndef _IEVENT_
- #include <ievent.hpp>
- #endif
-
- // Forward declarations for other classes:
- class IPaintEvent; /* pntevt */
- class IPresSpaceHandle;
- #ifndef _ICOLOR_
- #include <icolor.hpp>
- #endif
- #ifndef _IRECT_
- #include <irect.hpp>
- #endif
-
- class IPaintEvent : public IEvent {
- /*******************************************************************************
- * This class represents a paint event, which requires a window or control to *
- * update its appearance on the screen. This event object is created by an *
- * IPaintHandler object and passed to its virtual paintWindow() function for *
- * processing. All window updates should be done using the presentation space *
- * handle supplied by the IPaintEvent object. *
- *******************************************************************************/
- typedef IEvent Inherited;
- public:
- /*------------------------ CONSTRUCTORS/DESTRUCTORS ----------------------------
- | There are 2 ways to construct instances of this class: |
- | 1. construct from an IEvent |
- | 2. construct from another IPaintEvent |
- ------------------------------------------------------------------------------*/
- IPaintEvent ( IEvent& evt );
- IPaintEvent ( IPaintEvent& evt );
- ~IPaintEvent ( );
-
- /*--------------------------------- ACCESSORS ----------------------------------
- | These functions return information related to the paint event. |
- | defaultBgndColor - returns the background color of the desktop window |
- | defaultTextColor - returns the color of window static text used by the |
- | system |
- | presSpaceHandle - returns the handle of the presentation space to use for |
- | any drawing |
- | rect - returns the screen rectangle that needs updating |
- | exposedRect - returns a rectangle that is interpreted as being |
- | equivalent to the rectangle returned by rect() for |
- | drawing functions provided by this class (for example, |
- | you can pass it to the clearBackground() function) |
- ------------------------------------------------------------------------------*/
- static const IGUIColor
- defaultBgndColor ( ),
- defaultTextColor ( );
- const IPresSpaceHandle&
- presSpaceHandle ( ) const;
- const IRectangle&
- rect ( ) const;
- static const IRectangle
- exposedRect ( );
-
- /*---------------------------- PAINTING FUNCTIONS ------------------------------
- | These functions can be used to update a window's appearance on the screen. |
- | clearBackground - clears the specified rectangle, filling it with the |
- | specified color |
- | drawText - draws the specified text, beginning at the specified |
- | point, using the specified color for the text |
- ------------------------------------------------------------------------------*/
- void
- clearBackground ( const IRectangle& fillRect = exposedRect( ),
- const IColor& bgndColor = defaultBgndColor( ) ),
- drawText ( const char* text,
- const IPoint& atPos,
- const IColor& textColor = defaultTextColor( ) );
-
- private:
- IPresSpaceHandle
- hpsCl;
- IRectangle
- rectCl;
- };
-
- inline const IPresSpaceHandle& IPaintEvent::presSpaceHandle() const
- /**************************************************************/
- /* Return the presentation space handle of the exposing window*/
- /**************************************************************/
- { return hpsCl; }
-
- inline const IRectangle& IPaintEvent::rect() const
- /**************************************************************/
- /* Return the rectangle of the exposing window. */
- /**************************************************************/
- { return rectCl; }
- #endif /* IPAINEVT */