# WoopsiUI::AmigaWindow Class Reference

`#include <amigawindow.h>`

Inheritance diagram for WoopsiUI::AmigaWindow:

List of all members.

## Classes
struct | AmigaWindowFlags
## Public Types
enum | AmigaWindowFlagType { AMIGA_WINDOW_SHOW_CLOSE = 0x0001, AMIGA_WINDOW_SHOW_DEPTH = 0x0002 }
## Public Member Functions
| AmigaWindow (s16 x, s16 y, u16 width, u16 height, const WoopsiString &title, u32 flags, u32 windowFlags, GadgetStyle *style=NULL)
virtual void | setBorderless (bool isBorderless)
virtual void | handleReleaseEvent (const GadgetEventArgs &e)
virtual void | showCloseButton ()
virtual void | showDepthButton ()
virtual void | hideCloseButton ()
virtual void | hideDepthButton ()
virtual const bool | hasCloseButton () const
virtual const bool | hasDepthButton () const
## Protected Member Functions
virtual void | drawBorder (GraphicsPort *port)
virtual void | onResize (u16 width, u16 height)
virtual void | onFocus ()
virtual void | onBlur ()
virtual void | onClick (s16 x, s16 y)
virtual void | createBorder ()
virtual void | redrawBorder ()
virtual | ~AmigaWindow ()
| AmigaWindow (const AmigaWindow &amigaWindow)
## Protected Attributes
AmigaWindowFlags | _windowFlags
WindowBorderButton * | _closeButton
WindowBorderButton * | _depthButton

## Detailed Description

Class providing a window that mimics the appearance of the windows from Amiga Workbench 3.x. It has a title bar and borders around the edge of the window, along with a depth button and (optional) close button.

## Member Enumeration Documentation

enum WoopsiUI::AmigaWindow::AmigaWindowFlagType

Enum listing flags that can be set in the constructor's "windowFlags" parameter.

Enumerator:

  AMIGA_WINDOW_SHOW_CLOSE | Window shows close button
  AMIGA_WINDOW_SHOW_DEPTH | Window shows depth button

## Constructor & Destructor Documentation

WoopsiUI::AmigaWindow::AmigaWindow | ( | s16 | x,
|  | s16 | y,
|  | u16 | width,
|  | u16 | height,
|  | const WoopsiString & | title,
|  | u32 | flags,
|  | u32 | windowFlags,
|  | GadgetStyle * | style = `NULL` |
| ) |  |  |

Constructor.

Parameters:

  | x | The x co-ordinate of the window, relative to its parent.
  | y | The y co-ordinate of the window, relative to its parent.
  | width | The width of the window.
  | height | The height of the window.
  | title | The text that should appear in the title bar.
  | flags | Standard flags. Setting GADGET_BORDERLESS hides the Amiga borders.
  | windowFlags | Window-specfic flags from the WindowFlagType enum.
  | style | The style that the gadget should use. If this is not specified, the gadget will use the values stored in the global defaultGadgetStyle object. The gadget will copy the properties of the style into its own internal style object.

virtual WoopsiUI::AmigaWindow::~AmigaWindow | ( |  | ) | `[inline, protected, virtual]`

Destructor.

WoopsiUI::AmigaWindow::AmigaWindow | ( | const AmigaWindow & | amigaWindow | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

virtual void WoopsiUI::AmigaWindow::createBorder | ( |  | ) | `[protected, virtual]`

Create the window's border.

virtual void WoopsiUI::AmigaWindow::drawBorder | ( | GraphicsPort * | port | ) | `[protected, virtual]`

Draw the area of this gadget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters:

  | port | The GraphicsPort to draw to.

See also:
  redraw()

Reimplemented from WoopsiUI::Window.

virtual void WoopsiUI::AmigaWindow::handleReleaseEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Handle events fired by decoration gadgets.

Parameters:

  | e | Event arguments to process.

Reimplemented from WoopsiUI::GadgetEventHandler.

Reimplemented in WoopsiUI::Alert, WoopsiUI::ColourPicker, WoopsiUI::FileRequester, and WoopsiUI::Requester.

virtual const bool WoopsiUI::AmigaWindow::hasCloseButton | ( |  | ) | const`[inline, virtual]`

Does the window have a close button?

Returns:
  True if the window has a close button.

virtual const bool WoopsiUI::AmigaWindow::hasDepthButton | ( |  | ) | const`[inline, virtual]`

Does the window have a depth button?

Returns:
  True if the window has a depth button.

virtual void WoopsiUI::AmigaWindow::hideCloseButton | ( |  | ) | `[virtual]`

Hides the close button if it is visible. Has no effect if the window is borderless.

virtual void WoopsiUI::AmigaWindow::hideDepthButton | ( |  | ) | `[virtual]`

Hides the depth button if it is hidden. Has no effect if the window is borderless.

virtual void WoopsiUI::AmigaWindow::onBlur | ( |  | ) | `[protected, virtual]`

Redraws the borders.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::AmigaWindow::onClick | ( | s16 | x,
|  | s16 | y |
| ) |  |  | `[protected, virtual]`

Called when the gadget is clicked. Override this when creating new gadgets if the gadget should exhibit additional behaviour when it is clicked.

Parameters:

  | x | The x co-ordinate of the click.
  | y | The y co-ordinate of the click.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::AmigaWindow::onFocus | ( |  | ) | `[protected, virtual]`

Raises the window to the top of the stack and redraws its borders.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::AmigaWindow::onResize | ( | u16 | width,
|  | u16 | height |
| ) |  |  | `[protected, virtual]`

Resize the gadget to the new dimensions.

Parameters:

  | width | The new width.
  | height | The new height.

Reimplemented from WoopsiUI::Gadget.

Reimplemented in WoopsiUI::Alert, WoopsiUI::ColourPicker, WoopsiUI::FileRequester, and WoopsiUI::Requester.

virtual void WoopsiUI::AmigaWindow::redrawBorder | ( |  | ) | `[protected, virtual]`

Redraw the borders.

virtual void WoopsiUI::AmigaWindow::setBorderless | ( | bool | isBorderless | ) | `[virtual]`

Show or hide the Amiga borders.

Parameters:

  | isBorderless | True to enable borders, false to disable them.

Reimplemented from WoopsiUI::Gadget.

virtual void WoopsiUI::AmigaWindow::showCloseButton | ( |  | ) | `[virtual]`

Shows the close button if it is hidden. Has no effect if the window is borderless.

virtual void WoopsiUI::AmigaWindow::showDepthButton | ( |  | ) | `[virtual]`

Shows the depth button if it is hidden. Has no effect if the window is borderless.

## Member Data Documentation

WindowBorderButton* WoopsiUI::AmigaWindow::_closeButton`[protected]`

Pointer to the close button

WindowBorderButton* WoopsiUI::AmigaWindow::_depthButton`[protected]`

Pointer to the depth button

AmigaWindowFlags WoopsiUI::AmigaWindow::_windowFlags`[protected]`

AmigaWindow-specific flags

The documentation for this class was generated from the following file:

- amigawindow.h