# 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 char *title, u32 flags, u32 windowFlags, FontBase *font=NULL)
virtual void | setBorderless (bool isBorderless)
virtual const u8 | getBorderSize () const
virtual const u8 | getTitleHeight () const
virtual void | getClientRect (Rect &rect) const
virtual bool | click (s16 x, s16 y)
virtual bool | focus ()
virtual bool | blur ()
virtual bool | resize (u16 width, u16 height)
virtual void | handleClickEvent (const GadgetEventArgs &e)
virtual void | handleDragEvent (const GadgetEventArgs &e)
virtual void | handleReleaseEvent (const GadgetEventArgs &e)
virtual void | handleReleaseOutsideEvent (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 | createBorder ()
virtual | ~AmigaWindow ()
| AmigaWindow (const AmigaWindow &amigaWindow)
## Protected Attributes
AmigaWindowFlags | _windowFlags
WindowBorderTop * | _windowBorderTop
WindowBorderSide * | _windowBorderLeft
WindowBorderSide * | _windowBorderRight
WindowBorderBottom * | _windowBorderBottom
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

AmigaWindow::AmigaWindow | ( | s16 | x,
|  | s16 | y,
|  | u16 | width,
|  | u16 | height,
|  | const char * | title,
|  | u32 | flags,
|  | u32 | windowFlags,
|  | FontBase * | font = `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.
  | font | The font to use for the window.

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

bool AmigaWindow::blur | ( |  | ) | `[virtual]`

Remove focus from the gadget.

Returns:
  True if the gadget lost focus correctly.

Reimplemented from WoopsiUI::Gadget.

bool AmigaWindow::click | ( | s16 | x,
|  | s16 | y |
| ) |  |  | `[virtual]`

Click this gadget at the supplied co-ordinates.

Parameters:

  | x | X co-ordinate of the click.
  | y | Y co-ordinate of the click.

Returns:
  True if the click was successful.

Reimplemented from WoopsiUI::Gadget.

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

Create the window's border.

bool AmigaWindow::focus | ( |  | ) | `[virtual]`

Give the gadget focus.

Returns:
  True if the gadget received focus correctly.

Reimplemented from WoopsiUI::Gadget.

const u8 AmigaWindow::getBorderSize | ( |  | ) | const`[virtual]`

Gets the size of the left, right and bottom borders.

Returns:
  The size of the borders.

void AmigaWindow::getClientRect | ( | Rect & | rect | ) | const`[virtual]`

Insert the properties of the space within this gadget that is available for children into the rect passed in as a parameter. All co-ordinates are relative to this gadget.

Parameters:

  | rect | Reference to a rect to populate with data.

Reimplemented from WoopsiUI::Gadget.

const u8 AmigaWindow::getTitleHeight | ( |  | ) | const`[virtual]`

Gets the height of the title bar.

Returns:
  The height of the title bar.

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

Handle events fired by decoration gadgets.

Parameters:

  | e | Event arguments to process.

Reimplemented from WoopsiUI::GadgetEventHandler.

Reimplemented in WoopsiUI::WoopsiKeyboard.

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

Handle events fired by decoration gadgets.

Parameters:

  | e | Event arguments to process.

Reimplemented from WoopsiUI::GadgetEventHandler.

void 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::Requester, and WoopsiUI::WoopsiKeyboard.

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

Handle events fired by decoration gadgets.

Parameters:

  | e | Event arguments to process.

Reimplemented from WoopsiUI::GadgetEventHandler.

Reimplemented in WoopsiUI::WoopsiKeyboard.

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.

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

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

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

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

bool AmigaWindow::resize | ( | u16 | width,
|  | u16 | height |
| ) |  |  | `[virtual]`

Resize the gadget to the new dimensions.

Parameters:

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

Returns:
  True if the resize was successful.

Reimplemented from WoopsiUI::Gadget.

Reimplemented in WoopsiUI::Requester.

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

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

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

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

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

## Member Data Documentation

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

Pointer to the close button

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

Pointer to the depth button

WindowBorderBottom* WoopsiUI::AmigaWindow::_windowBorderBottom`[protected]`

Pointer to the bottom border

WindowBorderSide* WoopsiUI::AmigaWindow::_windowBorderLeft`[protected]`

Pointer to the left border

WindowBorderSide* WoopsiUI::AmigaWindow::_windowBorderRight`[protected]`

Pointer to the right border

WindowBorderTop* WoopsiUI::AmigaWindow::_windowBorderTop`[protected]`

Pointer to the top border

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

AmigaWindow-specific flags

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

- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/amigawindow.h
- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/amigawindow.cpp

All Classes Functions Variables Enumerations Enumerator