ICustomButtonDrawEvent

The ICustomButtonDrawEvent class provides information about a custom button event for ICustomButtonDrawHandler event handling functions.


ICustomButtonDrawEvent - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class. You cannot assign ICustomButtonDrawEvent objects because the assignment operator is a private function.


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

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
ICustomButtonDrawEvent


Overload 1
public:
ICustomButtonDrawEvent( const IEvent& event, const ISize& size, const bool trueColor = false )

Creates an ICustomButtonDrawEvent from the specified IEvent, dimensions and color indicator. Use this constructor if you want to create a memory image of the button. When you use this constructor, the graphic port returned by grafPort is a memory graphic port. Drawing to this graphic port will not result in drawing directly to the screen. The drawing will be to an image in memory. After you have completed drawing of the button, you can use IGImage::captureImage to capture the image. You can then draw the captured image to the screen.

Drawing to memory in this way is useful to prevent multiple screen updates when your button drawing consists of a large number of draw operations.

size should contain the dimensions of the area to draw. Use the window size if you wish to draw the entire button.

trueColor indicates whether the memory image should be created as a true color image. If trueColor is true, the memory image is created as a 24-bit true color image. If trueColor is false, the memory image is created as an 8-bit 256 color image. The 256 color image has better performance than the true color image. It should also suffice for most drawing. trueColor defaults to false, indicating a 256 color image.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
ICustomButtonDrawEvent(const ICustomButtonDrawEvent& event)

Creates a copy of the specified ICustomButtonDrawEvent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 3
public:
ICustomButtonDrawEvent(const IEvent& event)

Creates an ICustomButtonDrawEvent from the specified IEvent.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Custom Button

Use these members to query information about the custom button.


[view class]
customButton
public:
virtual ICustomButton* customButton() const

Returns a pointer to the ICustomButton object that is to be drawn.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Drawing

Use these members to query or modify the event-drawing information.


[view class]
buttonState
public:
ButtonState buttonState() const

Returns the state that describes how the button is to be drawn.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
drawDown
public:
bool drawDown() const

Returns true if the button is to be drawn in the down state. This is the case if the button state is down or latched. buttonState will indicate the actual state.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
drawingArea
public:
IRectangle drawingArea() const

Returns the current drawing area rectangle to be used when drawing the button. When ICustomButtonDrawEvent is created, drawing area is a rectangle created from one of the following:

You can change this drawing area by calling setDrawingArea. As you draw different parts the button, you can set the drawing area to exclude the portion already drawn. For example, ICustomButtonDrawHandler::drawBorder draws the button's border, then reduces the drawing area so that ICustomButtonDrawHandler::drawBackground draws the area inside the button border.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
drawLatched
public:
bool drawLatched() const

Returns true if the button is to be drawn in the latched state.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
drawUp
public:
bool drawUp() const

Returns true if the button is to be drawn in the up state.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
grafPort
public:
IGrafPort& grafPort() const

Returns a graphic port to be used when drawing the button.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isButtonEnabled
public:
bool isButtonEnabled() const

Returns true if the button is to be drawn in the enabled state.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
setDrawingArea
public:
virtual ICustomButtonDrawEvent& setDrawingArea( const IRectangle& rectangle )

Sets the current drawing area rectangle to be used when drawing the button.

You can query this drawing area by calling drawingArea. As you draw different parts the button, you can set the drawing area to exclude the portion already drawn. For example, ICustomButtonDrawHandler::drawBorder draws the button's border, then reduces the drawing area so that ICustomButtonDrawHandler::drawBackground draws the area inside the button border.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


ICustomButtonDrawEvent - Enumerations


[view class]
ButtonState
enum ButtonState { buttonUp, 
                   buttonDown, 
                   buttonLatched }

Enumeration used to describe the state to be used to draw the button:

buttonUp
The button is to be drawn in the up state.
buttonDown
The button is to be drawn in the down state.
buttonLatched
The button is to be drawn in the latched state.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


ICustomButtonDrawEvent - Inherited Member Functions and Data

Inherited Public Functions

IControlEvent
IEvent

Inherited Public Data

Inherited Protected Functions

Inherited Protected Data