### 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.

~ICustomButtonDrawEvent

      public:
      virtual ~ICustomButtonDrawEvent()

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

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.

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.

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

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

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:

  - The button's size, if you created the ICustomButtonDrawEvent using the constructor that did not accepted a size.
  - The size indicated on the ICustomButtonDrawEvent constructor, if you used the constructor that accepted a size.

  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

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

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

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

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

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

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

  -     virtual ~IControlEvent()

  -     virtual unsigned long controlId() const

  -     IControlEvent(const IControlEvent& event)

  -     IControlEvent(const IEvent& event)

  IEvent

  -     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

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  - None

#### Inherited Protected Data

  - None