The ICustomButtonDrawEvent class provides information about a custom button event for ICustomButtonDrawHandler event handling functions.
You can construct and destruct objects of this class. You cannot assign ICustomButtonDrawEvent objects because the assignment operator is a private function.
![]() |
public:
virtual ~ICustomButtonDrawEvent()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
ICustomButtonDrawEvent(const ICustomButtonDrawEvent& event)
Creates a copy of the specified ICustomButtonDrawEvent.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
ICustomButtonDrawEvent(const IEvent& event)
Creates an ICustomButtonDrawEvent from the specified IEvent.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to query information about the custom button.
![]() |
public:
virtual ICustomButton* customButton() const
Returns a pointer to the ICustomButton object that is to be drawn.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to query or modify the event-drawing information.
![]() |
public:
ButtonState buttonState() const
Returns the state that describes how the button is to be drawn.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool drawLatched() const
Returns true if the button is to be drawn in the latched state.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool drawUp() const
Returns true if the button is to be drawn in the up state.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IGrafPort& grafPort() const
Returns a graphic port to be used when drawing the button.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool isButtonEnabled() const
Returns true if the button is to be drawn in the enabled state.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
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.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
enum ButtonState { buttonUp, buttonDown, buttonLatched }
Enumeration used to describe the state to be used to draw the button:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~IControlEvent()
virtual unsigned long controlId() const
IControlEvent(const IControlEvent& event)
IControlEvent(const IEvent& event)
virtual ~IEvent()
IWindowHandle controlHandle() const
virtual IWindow* controlWindow() const
IEvent& decrementOwnerLevels()
virtual IWindow* dispatchingWindow() const
unsigned long eventId() const
IWindowHandle handle() const
IEvent( const IWindowHandle& handle, unsigned long eventId, const IEventParameter1& parameter1, const IEventParameter2& parameter2 )
IEvent(const IEvent& event)
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