The IPaintEvent class represents a paint event, which requires a window or control to update its appearance on the screen. An object of IPaintHandler creates and passes this event to its virtual function IPaintHandler::paintWindow for processing. You should make all window updates using the presentation space handle supplied by the IPaintEvent object.
Objects of the IPaintEvent class represent a Motif expose event.
When drawing, this class uses the presentation space (that is, graphic context) of the IWindow object for which this paint event was created. If you do not make all window updates using the presentation space handle supplied by the IPaintEvent object, you will not get the same colors and fonts as other sections of code painting in this window.
Constructors & DestructorYou can construct and destruct objects of this class.
![]() |
public:
virtual ~IPaintEvent()
| IAccessError | The clipping region could not be returned to its original state. |
| IAccessError | The clipping region could not be destroyed properly. |
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IPaintEvent(const IEvent& event)
Constructs an IPaintEvent object from the specified event. IPaintHandler::dispatchHandlerEvent constructs objects of this class from an object of the class IEvent and passes the resulting object to the function IPaintHandler::paintWindow.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
PaintingUse painting members to update a window's appearance on the screen.
![]() |
Clears the specified portion of the window, filling it with the specified color.
This function paints with the presentation space handle returned by IPaintEvent::presSpaceHandle.
public:
IPaintEvent& clearBackground( const IColor& background = IColor ( IColor::kDesktopBgnd ) )
Use this function to clear the invalid (also known as "exposed") rectangle specified in the underlying system event. This is the rectangle that should normally be cleared and redrawn.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
public:
IPaintEvent& clearBackground( const IRectangle& fillRectangle, const IColor& background = IColor ( IColor::kDesktopBgnd ) )
Use this function to clear all or a portion of a window.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IPaintEvent& drawText( const char* text, const IPoint& atPoint, const IColor& textColor = IColor ( IColor::kWindowStaticText ) )
Draws the specified text, beginning at the specified point, using the specified color for the text.
The point identifies the position of the lower left corner of the text. The point is assumed to be in native coordinates; that is, assuming 0,0 is at the upper left of the screen for Windows and Motif system, or at the lower left for OS/2 systems.
This function paints with the presentation space handle returned by IPaintEvent::presSpaceHandle.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
virtual IPresSpaceHandle presSpaceHandle()
Returns the handle of the presentation space to use for any drawing. This function returns the value set by IPaintEvent::setGraphicContext or IPaintEvent::setGrafPort. If you have called neither function, it returns the handle obtained by calling IWindow::presSpace.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IRectangle rect() const
Returns the screen rectangle for the invalidated part of the window, as specified in the underlying system event. The rectangle is in native coordinates, for use with native operating system APIs. If you need the rectangle in application coordinates, use ICoordinateSystem::convertToApplication.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IPaintEvent& setGrafPort( IGrafPort& context, bool setClipRegion = true )
Sets the graphic context used by this event for drawing. The context used is the one related to the specified IGrafPort.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
IPaintEvent& setGraphicContext( const IPresSpaceHandle& handle, bool setClipRegion = true )
Sets the graphic context used by this event for drawing.
| Windows | OS/2 | AIX |
| Yes | Yes | Ignored |
This function has no effect on X-Motif.
virtual ~IEvent()
IWindowHandle controlHandle() const
virtual IWindow* controlWindow() const
IEvent& decrementOwnerLevels()
virtual IWindow* dispatchingWindow() const
unsigned long eventId() const
IWindowHandle handle() const
IEvent(const IEvent& event)
IEvent( const IWindowHandle& handle, unsigned long eventId, const IEventParameter1& parameter1, const IEventParameter2& parameter2 )
IEvent( IWindow* window, unsigned long eventId, const IEventParameter1& parameter1, const IEventParameter2& parameter2 )
IEvent& operator =(const IEvent& event)
IEventParameter1 parameter1() const
IEventParameter2 parameter2() const
bool passToOwner() const
IEventResult result() const
IEvent& setControlHandle(const IWindowHandle& handle)
IEvent& setDispatchingHandle(const IWindowHandle& handle)
IEvent& setDispatchingWindow(IWindow* window)
IEvent& setHandle(const IWindowHandle& handle)
IEvent& setNumberOfLevels(int levels = - 1)
IEvent& setPassToOwner(bool passOn = true)
IEvent& setResult(bool eventResult)
IEvent& setResult(const IEventResult& eventResult)
virtual IWindow* window() const