IPaintEvent

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.

AIX Considerations

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.


IPaintEvent - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IPaintEvent
public:
virtual ~IPaintEvent()

Exception

IAccessError The clipping region could not be returned to its original state.
IAccessError The clipping region could not be destroyed properly.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IPaintEvent
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Painting

Use painting members to update a window's appearance on the screen.


[view class]
clearBackground

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.


Overload 1
public:
IPaintEvent& clearBackground( const IColor& background = IColor ( IColor::kDesktopBgnd ) )
background
The background color to paint the window.

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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IPaintEvent& clearBackground( const IRectangle& fillRectangle, const IColor& background = IColor ( IColor::kDesktopBgnd ) )
fillRectangle
The screen rectangle of the portion of the window to clear. The rectangle 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.
background
The background color to paint the fillRectangle portion of the window.

Use this function to clear all or a portion of a window.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
drawText
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
presSpaceHandle
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
rect
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setGrafPort
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.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setGraphicContext
public:
IPaintEvent& setGraphicContext( const IPresSpaceHandle& handle, bool setClipRegion = true )

Sets the graphic context used by this event for drawing.

Supported Platforms

Windows OS/2 AIX
Yes Yes Ignored

AIX Considerations

This function has no effect on X-Motif.


IPaintEvent - Inherited Member Functions and Data

Inherited Public Functions

IEvent

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data