Woopsi 1.0 GUI Framework for Nintendo DS Homebrew

- Main Page
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes

# WoopsiUI::Screen Class Reference

`#include <screen.h>`

Inheritance diagram for WoopsiUI::Screen:

List of all members.

## Public Member Functions
| Screen (const WoopsiString &title, u32 flags, GadgetStyle *style=NULL)
virtual const WoopsiString & | getTitle () const
virtual bool | swapGadgetDepth (Gadget *gadget)
virtual void | flipToTopScreen ()
virtual void | flipToBottomScreen ()
virtual bool | flipScreens ()
void | setTitle (const WoopsiString &title)
virtual const u8 | getPhysicalScreenNumber () const
## Protected Member Functions
virtual void | drawBorder (GraphicsPort *port)
virtual void | onDrag (s16 x, s16 y, s16 vX, s16 vY)
virtual void | onFocus ()
virtual | ~Screen ()
| Screen (const Screen &screen)
## Protected Attributes
u8 | _titleHeight
WoopsiString | _title

## Detailed Description

Class representing a basic, empty screen. All gadgets, except for the Woopsi object itself, must ultimately have a screen at the top of their hierarchies (below Woopsi). Screen gadgets can only be children of the Woopsi object.

## Constructor & Destructor Documentation

WoopsiUI::Screen::Screen | ( | const WoopsiString & | title,
|  | u32 | flags,
|  | GadgetStyle * | style = `NULL`
| ) |  |

Constructor.

Parameters:

  title | The title of the screen; not displayed by default.
  flags | Bitmask specifying some set-up values for the screen.
  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::Screen::~Screen | ( |  | ) | `[inline, protected, virtual]`

Destructor.

WoopsiUI::Screen::Screen | ( | const Screen & | screen | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

virtual void WoopsiUI::Screen::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::Gadget.

Reimplemented in WoopsiUI::AmigaScreen.

virtual bool WoopsiUI::Screen::flipScreens | ( |  | ) | `[virtual]`

Flip the screen from the current physical display to the other.

virtual void WoopsiUI::Screen::flipToBottomScreen | ( |  | ) | `[virtual]`

Flip the screen from the top physical display to the bottom display.

virtual void WoopsiUI::Screen::flipToTopScreen | ( |  | ) | `[virtual]`

Flip the screen from the bottom physical display to the top display.

virtual const u8 WoopsiUI::Screen::getPhysicalScreenNumber | ( |  | ) | const`[inline, virtual]`

Get the number of the screen that this gadget is currently displayed on.

Returns:
  0 for the touch screen, 1 for the top screen.

Reimplemented from WoopsiUI::Gadget.

virtual const WoopsiString& WoopsiUI::Screen::getTitle | ( |  | ) | const`[inline, virtual]`

Get the screen's title.

Returns:
  The screen's title.

virtual void WoopsiUI::Screen::onDrag | ( | s16 | x,
|  | s16 | y,
|  | s16 | vX,
|  | s16 | vY
| ) |  | `[protected, virtual]`

Moves the screen vertically to follow the stylus.

Parameters:

  x | The x co-ordinate of the stylus.
  y | The y co-ordinate of the stylus.
  vX | The horizontal distance of the drag.
  vY | The vertical distance of the drag.

Reimplemented from WoopsiUI::Gadget.

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

Raises the screen to the top of the screen stack.

Reimplemented from WoopsiUI::Gadget.

void WoopsiUI::Screen::setTitle | ( | const WoopsiString & | title | ) |

Set the title of the screen.

Parameters:

  title | The new title.

virtual bool WoopsiUI::Screen::swapGadgetDepth | ( | Gadget * | gadget | ) | `[virtual]`

Swaps the depth of the supplied child gadget. The child gadget is assumed to be a window, and although this is not a requirement, it does mean that child gadgets are depth-swapped as windows would be expected to. If the gadget is not at the top of the z-order of the gadgets is collides with, it is raised above those gadgets. If it is at the top of the z-order of the gadgets it collides with, it is dropped down to the bottom of that z-order.

Parameters:

  gadget | A pointer to the child gadget that needs to swap depths.

Returns:
  True if the swap was successful.

Reimplemented from WoopsiUI::Gadget.

## Member Data Documentation

WoopsiString WoopsiUI::Screen::_title`[protected]`

Title of the screen

u8 WoopsiUI::Screen::_titleHeight`[protected]`

Height of the title bar

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

- screen.h