UI

Table of Contents

Represents a position (x,y)

Introduction

Points are used throughout UI to represent co-ordinates on a screen, control, or area.

Class synopsis

UI\Point
final class UI\Point {
/* Properties */
public $x ;
public $y ;
/* Constructor */
public __construct ( float $x , float $y )
/* Methods */
public static UI\Point at ( float $point )
public static UI\Point at ( UI\Size $size )
public float getX ( void )
public float getY ( void )
public setX ( float $point )
public setY ( float $point )
}

Properties

x

Holds the X co-ordinate, can be read/written directly

y

Holds the Y co-ordinate, can be read/written directly

Represents dimenstions (width, height)

Introduction

Sizes are used throughout UI to represent the size of a screen, control, or area.

Class synopsis

UI\Size
final class UI\Size {
/* Properties */
public $width ;
public $height ;
/* Constructor */
public __construct ( float $width , float $height )
/* Methods */
public float getHeight ( void )
public float getWidth ( void )
public static UI\Size of ( float $size )
public static UI\Size of ( UI\Point $point )
public setHeight ( float $size )
public setWidth ( float $size )
}

Properties

width

Holds the width, can be read/written directly

height

Holds the height, can be read/written directly

Window

Introduction

Represents a UI Window

Class synopsis

UI\Window
class UI\Window extends UI\Control {
/* Properties */
protected $controls ;
/* Constructor */
public __construct ( string $title , Size $size [, boolean $menu = false ] )
/* Methods */
public add ( UI\Control $control )
public error ( string $title , string $msg )
public UI\Size getSize ( void )
public string getTitle ( void )
public bool hasBorders ( void )
public bool hasMargin ( void )
public bool isFullScreen ( void )
public msg ( string $title , string $msg )
protected int onClosing ( void )
public string open ( void )
public string save ( void )
public setBorders ( boolean $borders )
public setFullScreen ( boolean $full )
public setMargin ( boolean $margin )
public setSize ( UI\Size $size )
public setTitle ( string $title )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Properties

controls

Contains controls, should not be manipulated directly

Control

Introduction

This is the closed base class for all UI Controls.

Class synopsis

UI\Control
final class UI\Control {
/* Methods */
public destroy ( void )
public disable ( void )
public enable ( void )
public UI\Control getParent ( void )
public int getTopLevel ( void )
public hide ( void )
public bool isEnabled ( void )
public bool isVisible ( void )
public setParent ( UI\Control $parent )
public show ( void )
}

Menu

Introduction

Menus must be constructed before the first Window, and can be shown on any Window

Class synopsis

UI\Menu
class UI\Menu {
/* Constructor */
public __construct ( string $name )
/* Methods */
public UI\MenuItem append ( string $name [, string $type = UI\MenuItem::class ] )
public UI\MenuItem appendAbout ([ string $type = UI\MenuItem::class ] )
public UI\MenuItem appendCheck ( string $name [, string $type = UI\MenuItem::class ] )
public UI\MenuItem appendPreferences ([ string $type = UI\MenuItem::class ] )
public UI\MenuItem appendQuit ([ string $type = UI\MenuItem::class ] )
public appendSeparator ( void )
}

Menu Item

Introduction

Menu Items should only be created by the Menu

Class synopsis

UI\MenuItem
class UI\MenuItem {
/* Methods */
public disable ( void )
public enable ( void )
public bool isChecked ( void )
protected onClick ( void )
public setChecked ( boolean $checked )
}

Area

Introduction

An Area represents a canvas which can be used to draw, and respond to mouse and key events.

Class synopsis

UI\Area
class UI\Area extends UI\Control {
/* Constants */
const integer UI\Area::Ctrl ;
const integer UI\Area::Alt ;
const integer UI\Area::Shift ;
const integer UI\Area::Super ;
const integer UI\Area::Down ;
const integer UI\Area::Up ;
/* Methods */
protected onDraw ( UI\Draw\Pen $pen , UI\Size $areaSize , UI\Point $clipPoint , UI\Size $clipSize )
protected onKey ( string $key , integer $ext , integer $flags )
protected onMouse ( UI\Point $areaPoint , UI\Size $areaSize , integer $flags )
public redraw ( void )
public scrollTo ( UI\Point $point , UI\Size $size )
public setSize ( UI\Size $size )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Predefined Constants

UI\Area::Ctrl

Shall be set in the modifiers passed to key and mouse events when the CTRL key is active

UI\Area::Alt

Shall be set in the modifiers passed to key and mouse events when the ALT key is active

UI\Area::Shift

Shall be set in the modifiers passed to key and mouse events when the SHIFT key is active

UI\Area::Super

UI\Area::Down

Shall be set in the modifiers passed to key and mouse events

UI\Area::Up

Shall be set in the modifiers passed to key and mouse events

Execution Scheduler

Introduction

This facility schedules repetitive execution of a callback, useful for animations and other such activities.

Class synopsis

UI\Executor
abstract class UI\Executor {
/* Constructor */
public __construct ( void )
public __construct ( integer $microseconds )
public __construct ( integer $seconds , integer $microseconds )
/* Methods */
public void kill ( void )
abstract protected void onExecute ( void )
public bool setInterval ( integer $microseconds )
public bool setInterval ( integer $seconds , integer $microseconds )
}

Tab Control

Introduction

A Tab can contain many pages of Controls, each with a title, each selectable by the user.

Class synopsis

UI\Controls\Tab
class UI\Controls\Tab extends UI\Control {
/* Properties */
protected $controls ;
/* Methods */
public integer append ( string $name , UI\Control $control )
public boolean delete ( integer $index )
public bool hasMargin ( integer $page )
public insertAt ( string $name , integer $page , UI\Control $control )
public integer pages ( void )
public setMargin ( integer $page , boolean $margin )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Properties

controls

Contains controls, should not be manipulated directly

Check Control

Introduction

A Check is a labelled checkable box

Class synopsis

UI\Controls\Check
class UI\Controls\Check extends UI\Control {
/* Constructor */
public __construct ( string $text )
/* Methods */
public string getText ( void )
public bool isChecked ( void )
protected onToggle ( void )
public setChecked ( boolean $checked )
public setText ( string $text )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Button Control

Introduction

Represents a labelled clickable button

Class synopsis

UI\Controls\Button
class UI\Controls\Button extends UI\Control {
/* Constructor */
public __construct ( string $text )
/* Methods */
public string getText ( void )
protected onClick ( void )
public setText ( string $text )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

ColorButton Control

Introduction

A Color Button is a button which displays a color picker when clicked

Class synopsis

UI\Controls\ColorButton
class UI\Controls\ColorButton extends UI\Control {
/* Methods */
public UI\Color getColor ( void )
protected onChange ( void )
public setColor ( UI\Draw\Color $color )
public setColor ( integer $color )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Label Control

Introduction

A Label is a single line of text, meant to identify, for the user, some element of the interface.

Class synopsis

UI\Controls\Label
class UI\Controls\Label extends UI\Control {
/* Constructor */
public __construct ( string $text )
/* Methods */
public string getText ( void )
public setText ( string $text )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Entry Control

Introduction

An Entry is a text entry control, suitable for entering plain text, passwords, or search terms.

Class synopsis

UI\Controls\Entry
class UI\Controls\Entry extends UI\Control {
/* Constants */
const integer UI\Controls\Entry::Normal ;
const integer UI\Controls\Entry::Password ;
const integer UI\Controls\Entry::Search ;
/* Constructor */
public __construct ([ integer $type = UI\Controls\Entry::Normal ] )
/* Methods */
public string getText ( void )
public bool isReadOnly ( void )
protected onChange ( void )
public setReadOnly ( boolean $readOnly )
public setText ( string $text )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Predefined Constants

UI\Controls\Entry::Normal

A normal single line entry

UI\Controls\Entry::Password

A password entry

UI\Controls\Entry::Search

A search entry

MultilineEntry Control

Introduction

A Multiline Entry is a text entry control able to hold multiple lines of text, with or without wrapping.

Class synopsis

UI\Controls\MultilineEntry
class UI\Controls\MultilineEntry extends UI\Control {
/* Constants */
const integer UI\Controls\MultilineEntry::Wrap ;
const integer UI\Controls\MultilineEntry::NoWrap ;
/* Constructor */
public __construct ([ integer $type ] )
/* Methods */
public append ( string $text )
public string getText ( void )
public bool isReadOnly ( void )
protected onChange ( void )
public setReadOnly ( boolean $readOnly )
public setText ( string $text )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Predefined Constants

UI\Controls\MultilineEntry::Wrap

Allow lines to wrap

UI\Controls\MultilineEntry::NoWrap

Do not allow lines to wrap

Spin Control

Introduction

A Spin box is a text box with an up-down control which changes the integer value in the box, within a defined range

Class synopsis

UI\Controls\Spin
class UI\Controls\Spin extends UI\Control {
/* Constructor */
public __construct ( integer $min , integer $max )
/* Methods */
public int getValue ( void )
protected onChange ( void )
public setValue ( integer $value )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Slider Control

Introduction

A Slider is a control which represents a range, and a current value in the range. The sliding element of the control (sometimes called the "thumb") reflects the value, and can be adjusted within the range.

Class synopsis

UI\Controls\Slider
class UI\Controls\Slider extends UI\Control {
/* Constructor */
public __construct ( integer $min , integer $max )
/* Methods */
public integer getValue ( void )
protected onChange ( void )
public setValue ( integer $value )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Progress Control

Introduction

A Progress control is a familiar Progress bar: It represents progress as a percentage, with a possible range of 0 to 100 (inclusive).

Class synopsis

UI\Controls\Progress
class UI\Controls\Progress extends UI\Control {
/* Methods */
public int getValue ( void )
public setValue ( integer $value )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Control Separator

Introduction

A Separator represents a control separator, it has no other function.

Class synopsis

UI\Controls\Separator
class UI\Controls\Separator extends UI\Control {
/* Constants */
const integer UI\Controls\Separator::Horizontal ;
const integer UI\Controls\Separator::Vertical ;
/* Constructor */
public __construct ([ integer $type = UI\Controls\Separator::Horizontal ] )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Predefined Constants

UI\Controls\Separator::Horizontal

A Horizontal Separator

UI\Controls\Separator::Vertical

A Vertical Separator

Combo Control

Introduction

A Combo control represents a list of options, like the familiar select HTML element.

Class synopsis

UI\Controls\Combo
class UI\Controls\Combo extends UI\Control {
/* Methods */
public append ( string $text )
public integer getSelected ( void )
protected onSelected ( void )
public setSelected ( integer $index )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

EdiableCombo Control

Introduction

An Editable Combo is a Combo which allows the user to enter custom options

Class synopsis

UI\Controls\EditableCombo
class UI\Controls\EditableCombo extends UI\Control {
/* Methods */
public append ( string $text )
public string getText ( void )
protected onChange ( void )
public setText ( string $text )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Radio Control

Introduction

A Radio is similar to the radio input type familiar from HTML

Class synopsis

UI\Controls\Radio
class UI\Controls\Radio extends UI\Control {
/* Methods */
public append ( string $text )
public integer getSelected ( void )
protected onSelected ( void )
public setSelected ( integer $index )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Picker Control

Introduction

A Picker represents a button which when clicked presents a native Date/Time/DateTime Picker interface to the user.

Class synopsis

UI\Controls\Picker
class UI\Controls\Picker extends UI\Control {
/* Constants */
const integer UI\Controls\Picker::Date ;
const integer UI\Controls\Picker::Time ;
const integer UI\Controls\Picker::DateTime ;
/* Constructor */
public __construct ([ integer $type = UI\Controls\Picker::Date ] )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Predefined Constants

UI\Controls\Picker::Date

A Date Picker

UI\Controls\Picker::Time

A Time Picker

UI\Controls\Picker::DateTime

A Date and Time Picker

Control Form (Arrangement)

Introduction

A Form is a control which allows the arrangement of other controls into a familiar layout (the form).

Class synopsis

UI\Controls\Form
class UI\Controls\Form extends UI\Control {
/* Properties */
protected $controls ;
/* Methods */
public integer append ( string $label , UI\Control $control [, boolean $stretchy = false ] )
public boolean delete ( integer $index )
public bool isPadded ( void )
public setPadded ( boolean $padded )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Properties

controls

Contains controls, should not be manipulated directly

Control Grid (Arrangement)

Introduction

A Grid is a control which is allows the arrangement of children into a grid

Class synopsis

UI\Controls\Grid
class UI\Controls\Grid extends UI\Control {
/* Constants */
const integer UI\Controls\Grid::Fill ;
const integer UI\Controls\Grid::Start ;
const integer UI\Controls\Grid::Center ;
const integer UI\Controls\Grid::End ;
const integer UI\Controls\Grid::Leading ;
const integer UI\Controls\Grid::Top ;
const integer UI\Controls\Grid::Trailing ;
const integer UI\Controls\Grid::Bottom ;
/* Properties */
protected $controls ;
/* Methods */
public append ( UI\Control $control , integer $left , integer $top , integer $xspan , integer $yspan , boolean $hexpand , integer $halign , boolean $vexpand , integer $valign )
public bool isPadded ( void )
public setPadded ( boolean $padding )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Predefined Constants

UI\Controls\Grid::Fill

UI\Controls\Grid::Start

UI\Controls\Grid::Center

UI\Controls\Grid::End

UI\Controls\Grid::Leading

UI\Controls\Grid::Top

UI\Controls\Grid::Trailing

UI\Controls\Grid::Bottom

Properties

controls

Contains controls, should not be manipulated directly

Control Group (Arrangement)

Introduction

A Group is a titled container for child controls

Class synopsis

UI\Controls\Group
class UI\Controls\Group extends UI\Control {
/* Properties */
protected $controls ;
/* Constructor */
public __construct ( string $title )
/* Methods */
public append ( UI\Control $control )
public string getTitle ( void )
public bool hasMargin ( void )
public setMargin ( boolean $margin )
public setTitle ( string $title )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Properties

controls

Contains controls, should not be manipulated directly

Control Box (Arrangement)

Introduction

A Box allows the arrangement of other controls

Class synopsis

UI\Controls\Box
class UI\Controls\Box extends UI\Control {
/* Constants */
const integer UI\Controls\Box::Vertical ;
const integer UI\Controls\Box::Horizontal ;
/* Properties */
protected $controls ;
/* Constructor */
public __construct ([ integer $orientation = UI\Controls\Box::Horizontal ] )
/* Methods */
public integer append ( Control $control [, boolean $stretchy = false ] )
public boolean delete ( integer $index )
public integer getOrientation ( void )
public bool isPadded ( void )
public setPadded ( boolean $padded )
/* Inherited methods */
public UI\Control::destroy ( void )
public UI\Control::disable ( void )
public UI\Control::enable ( void )
public UI\Control UI\Control::getParent ( void )
public int UI\Control::getTopLevel ( void )
public UI\Control::hide ( void )
public bool UI\Control::isEnabled ( void )
public bool UI\Control::isVisible ( void )
public UI\Control::setParent ( UI\Control $parent )
public UI\Control::show ( void )
}

Properties

controls

Contains controls, should not be manipulated directly

Predefined Constants

UI\Controls\Box::Vertical

UI\Controls\Box::Horizontal

Draw Pen

Introduction

The Pen is passed to the Area Draw event handler, it is used for clipping, filling, stroking, and writing to Draw Paths.

Class synopsis

UI\Draw\Pen
final class UI\Draw\Pen {
/* Methods */
public clip ( UI\Draw\Path $path )
public fill ( UI\Draw\Path $path , UI\Draw\Brush $with )
public fill ( UI\Draw\Path $path , UI\Draw\Color $with )
public fill ( UI\Draw\Path $path , integer $with )
public restore ( void )
public save ( void )
public stroke ( UI\Draw\Path $path , UI\Draw\Brush $with , UI\Draw\Stroke $stroke )
public stroke ( UI\Draw\Path $path , UI\Draw\Color $with , UI\Draw\Stroke $stroke )
public stroke ( UI\Draw\Path $path , integer $with , UI\Draw\Stroke $stroke )
public transform ( UI\Draw\Matrix $matrix )
public write ( UI\Point $point , UI\Draw\Text\Layout $layout )
}

Draw Path

Introduction

A Draw Path guides a Draw Pen, telling the Pen where to draw on an Area.

Class synopsis

UI\Draw\Path
class UI\Draw\Path {
/* Constants */
const integer UI\Draw\Path::Winding ;
const integer UI\Draw\Path::Alternate ;
/* Constructor */
public __construct ([ integer $mode = UI\Draw\Path::Winding ] )
/* Methods */
public addRectangle ( UI\Point $point , UI\Size $size )
public arcTo ( UI\Point $point , float $radius , float $angle , float $sweep , float $negative )
public bezierTo ( UI\Point $point , float $radius , float $angle , float $sweep , float $negative )
public closeFigure ( void )
public end ( void )
public lineTo ( UI\Point $point , float $radius , float $angle , float $sweep , float $negative )
public newFigure ( UI\Point $point )
public newFigureWithArc ( UI\Point $point , float $radius , float $angle , float $sweep , float $negative )
}

Predefined Constants

UI\Draw\Path::Winding

This is the default draw path mode

UI\Draw\Path::Alternate

This is the alternate draw path mode

Draw Matrix

Introduction

Class synopsis

UI\Draw\Matrix
class UI\Draw\Matrix {
/* Methods */
public invert ( void )
public bool isInvertible ( void )
public UI\Draw\Matrix multiply ( UI\Draw\Matrix $matrix )
public rotate ( UI\Point $point , float $amount )
public scale ( UI\Point $center , UI\Point $point )
public skew ( UI\Point $point , UI\Point $amount )
public translate ( UI\Point $point )
}

Color Representation

Introduction

Represents RGBA colours, individual channels are accessible via public properties.

Class synopsis

UI\Draw\Color
class UI\Draw\Color {
/* Constants */
const integer UI\Draw\Color::Red ;
const integer UI\Draw\Color::Green ;
const integer UI\Draw\Color::Blue ;
const integer UI\Draw\Color::Alpha ;
/* Properties */
public $r ;
public $g ;
public $b ;
public $a ;
/* Constructor */
public __construct ([ UI\Draw\Color $color ] )
public __construct ([ integer $color ] )
/* Methods */
public float getChannel ( integer $channel )
public void setChannel ( integer $channel , float $value )
}

Properties

r

Provides access to the red channel

g

Provides access to the green channel

b

Provides access to the blue channel

a

Provides access to the alpha channel

Predefined Constants

UI\Draw\Color::Red

Identifies the red channel

UI\Draw\Color::Green

Identifies the green channel

UI\Draw\Color::Blue

Identifies the blue channel

UI\Draw\Color::Alpha

Identifies the alpha channel

Draw Stroke

Introduction

Holds the configuration for the Pen to perform a stroke

Class synopsis

UI\Draw\Stroke
class UI\Draw\Stroke {
/* Constructor */
public __construct ([ integer $cap = UI\Draw\Line\Cap::Flat [, integer $join = UI\Draw\Line\Join::Miter [, float $thickness = 1 [, float $miterLimit = 10 ]]]] )
/* Methods */
public integer getCap ( void )
public integer getJoin ( void )
public float getMiterLimit ( void )
public float getThickness ( void )
public setCap ( integer $cap )
public setJoin ( integer $join )
public setMiterLimit ( float $limit )
public setThickness ( float $thickness )
}

Brushes

Introduction

Represents a solid color brush

Class synopsis

UI\Draw\Brush
class UI\Draw\Brush {
/* Constructor */
public __construct ( UI\Draw\Color $color )
public __construct ( integer $color )
/* Methods */
public UI\Draw\Color getColor ( void )
public void setColor ( UI\Draw\Color $color )
public void setColor ( integer $color )
}

Gradient Brushes

Introduction

Abstract for gradient brushes

Class synopsis

UI\Draw\Brush\Gradient
abstract class UI\Draw\Brush\Gradient extends UI\Draw\Brush {
/* Methods */
public integer addStop ( float $position , UI\Draw\Color $color )
public integer addStop ( float $position , integer $color )
public integer delStop ( integer $index )
public boolean setStop ( integer $index , float $position , UI\Draw\Color $color )
public boolean setStop ( integer $index , float $position , integer $color )
/* Inherited methods */
public UI\Draw\Color UI\Draw\Brush::getColor ( void )
public void UI\Draw\Brush::setColor ( UI\Draw\Color $color )
public void UI\Draw\Brush::setColor ( integer $color )
}

Linear Gradient

Introduction

Class synopsis

UI\Draw\Brush\LinearGradient
class UI\Draw\Brush\LinearGradient extends UI\Draw\Brush\Gradient {
/* Constructor */
public __construct ( UI\Point $start , UI\Point $end )
/* Inherited methods */
public integer UI\Draw\Brush\Gradient::addStop ( float $position , UI\Draw\Color $color )
public integer UI\Draw\Brush\Gradient::addStop ( float $position , integer $color )
public integer UI\Draw\Brush\Gradient::delStop ( integer $index )
public boolean UI\Draw\Brush\Gradient::setStop ( integer $index , float $position , UI\Draw\Color $color )
public boolean UI\Draw\Brush\Gradient::setStop ( integer $index , float $position , integer $color )
}

Radial Gradient

Introduction

Class synopsis

UI\Draw\Brush\RadialGradient
class UI\Draw\Brush\RadialGradient extends UI\Draw\Brush\Gradient {
/* Constructor */
public __construct ( UI\Point $start , UI\Point $outer , float $radius )
/* Inherited methods */
public integer UI\Draw\Brush\Gradient::addStop ( float $position , UI\Draw\Color $color )
public integer UI\Draw\Brush\Gradient::addStop ( float $position , integer $color )
public integer UI\Draw\Brush\Gradient::delStop ( integer $index )
public boolean UI\Draw\Brush\Gradient::setStop ( integer $index , float $position , UI\Draw\Color $color )
public boolean UI\Draw\Brush\Gradient::setStop ( integer $index , float $position , integer $color )
}

Represents Text Layout

Introduction

A Text Layout represents the layout of text which will be drawn by the Pen

Class synopsis

UI\Draw\Text\Layout
class UI\Draw\Text\Layout {
/* Constructor */
public __construct ( string $text , UI\Draw\Text\Font $font , float $width )
/* Methods */
public setColor ( UI\Draw\Color $color [, integer $start = 0 [, integer $end ]] )
public setColor ( integer $color [, integer $start = 0 [, integer $end ]] )
public setWidth ( float $width )
}

Represents a Font

Introduction

Loads a described font

Class synopsis

UI\Draw\Text\Font
class UI\Draw\Text\Font {
/* Constructor */
public __construct ( UI\Draw\Text\Font\Descriptor $descriptor )
/* Methods */
public float getAscent ( void )
public float getDescent ( void )
public float getLeading ( void )
public float getUnderlinePosition ( void )
public float getUnderlineThickness ( void )
}

Font Descriptor

Introduction

Describes a font

Class synopsis

UI\Draw\Text\Font\Descriptor
class UI\Draw\Text\Font\Descriptor {
/* Constructor */
public __construct ( string $family , float $size [, integer $weight = UI\Draw\Text\Font\Weight::Normal [, integer $italic = UI\Draw\Text\Font\Italic::Normal [, integer $stretch = UI\Draw\Text\Font\Stretch::Normal ]]] )
/* Methods */
public string getFamily ( void )
public int getItalic ( void )
public float getSize ( void )
public int getStretch ( void )
public int getWeight ( void )
}

Font Weight Settings

Introduction

Class synopsis

UI\Draw\Text\Font\Weight
final class UI\Draw\Text\Font\Weight {
/* Constants */
const integer UI\Draw\Text\Font\Weight::Thin ;
const integer UI\Draw\Text\Font\Weight::UltraLight ;
const integer UI\Draw\Text\Font\Weight::Light ;
const integer UI\Draw\Text\Font\Weight::Book ;
const integer UI\Draw\Text\Font\Weight::Normal ;
const integer UI\Draw\Text\Font\Weight::Medium ;
const integer UI\Draw\Text\Font\Weight::SemiBold ;
const integer UI\Draw\Text\Font\Weight::Bold ;
const integer UI\Draw\Text\Font\Weight::UltraBold ;
const integer UI\Draw\Text\Font\Weight::Heavy ;
const integer UI\Draw\Text\Font\Weight::UltraHeavy ;
}

Italic Font Settings

Introduction

Class synopsis

UI\Draw\Text\Font\Italic
final class UI\Draw\Text\Font\Italic {
/* Constants */
const integer UI\Draw\Text\Font\Italic::Normal = 0 ;
const integer UI\Draw\Text\Font\Italic::Oblique = 1 ;
const integer UI\Draw\Text\Font\Italic::Italic = 2 ;
}

Font Stretch Settings

Introduction

Class synopsis

UI\Draw\Text\Font\Stretch
final class UI\Draw\Text\Font\Stretch {
/* Constants */
const integer UI\Draw\Text\Font\Stretch::UltraCondensed = 0 ;
const integer UI\Draw\Text\Font\Stretch::ExtraCondensed = 1 ;
const integer UI\Draw\Text\Font\Stretch::Condensed = 2 ;
const integer UI\Draw\Text\Font\Stretch::SemiCondensed = 3 ;
const integer UI\Draw\Text\Font\Stretch::Normal = 4 ;
const integer UI\Draw\Text\Font\Stretch::SemiExpanded = 5 ;
const integer UI\Draw\Text\Font\Stretch::Expanded = 6 ;
const integer UI\Draw\Text\Font\Stretch::ExtraExpanded = 7 ;
const integer UI\Draw\Text\Font\Stretch::UltraExpanded = 8 ;
}

Line Cap Settings

Introduction

Class synopsis

UI\Draw\Line\Cap
final class UI\Draw\Line\Cap {
/* Constants */
const integer UI\Draw\Line\Cap::Flat ;
const integer UI\Draw\Line\Cap::Round ;
const integer UI\Draw\Line\Cap::Square ;
}

Line Join Settings

Introduction

Class synopsis

UI\Draw\Line\Join
final class UI\Draw\Line\Join {
/* Constants */
const integer UI\Draw\Line\Join::Miter ;
const integer UI\Draw\Line\Join::Round ;
const integer UI\Draw\Line\Join::Bevel ;
}

Key Identifiers

Introduction

Class synopsis

UI\Key
final class UI\Key {
/* Constants */
const integer UI\Key::Escape ;
const integer UI\Key::Insert ;
const integer UI\Key::Delete ;
const integer UI\Key::Home ;
const integer UI\Key::End ;
const integer UI\Key::PageUp ;
const integer UI\Key::PageDown ;
const integer UI\Key::Up ;
const integer UI\Key::Down ;
const integer UI\Key::Left ;
const integer UI\Key::Right ;
const integer UI\Key::F1 ;
const integer UI\Key::F2 ;
const integer UI\Key::F3 ;
const integer UI\Key::F4 ;
const integer UI\Key::F5 ;
const integer UI\Key::F6 ;
const integer UI\Key::F7 ;
const integer UI\Key::F8 ;
const integer UI\Key::F9 ;
const integer UI\Key::F10 ;
const integer UI\Key::F11 ;
const integer UI\Key::F12 ;
const integer UI\Key::N0 ;
const integer UI\Key::N1 ;
const integer UI\Key::N2 ;
const integer UI\Key::N3 ;
const integer UI\Key::N4 ;
const integer UI\Key::N5 ;
const integer UI\Key::N6 ;
const integer UI\Key::N7 ;
const integer UI\Key::N8 ;
const integer UI\Key::N9 ;
const integer UI\Key::NDot ;
const integer UI\Key::NEnter ;
const integer UI\Key::NAdd ;
const integer UI\Key::NSubtract ;
const integer UI\Key::NMultiply ;
const integer UI\Key::NDivide ;
}

InvalidArgumentException

Introduction

Class synopsis

UI\Exception\InvalidArgumentException
class UI\Exception\InvalidArgumentException extends InvalidArgumentException implements Throwable {
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Throwable Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
}

RuntimeException

Introduction

Class synopsis

UI\Exception\RuntimeException
class UI\Exception\RuntimeException extends RuntimeException implements Throwable {
/* Inherited properties */
protected string $message ;
protected int $code ;
protected string $file ;
protected int $line ;
/* Inherited methods */
final public string Exception::getMessage ( void )
final public Throwable Exception::getPrevious ( void )
final public mixed Exception::getCode ( void )
final public string Exception::getFile ( void )
final public int Exception::getLine ( void )
final public array Exception::getTrace ( void )
final public string Exception::getTraceAsString ( void )
public string Exception::__toString ( void )
final private void Exception::__clone ( void )
}