vegui. taskbar. class.js

Summary
vegUI element type for VegUITaskBar
A task bar that holds one button for each window spawned.
extends VegUINode
If you set the Taskbar property of the vegUIManager element to point to your taskbar then any windows will have task buttons added automatically when they are built:
constructor
Sets the most common template properties for the taskbar
builds the taskbar
Adds a taskbutton for a window
Checks if a task button exists for a certain window
Reorders taskbuttons, removing any that dont have a window any assigned to them any longer
Removes the taskbutton for a window

Constants

VUI_TASKBAR

vegUI element type for VegUITaskBar

Taskbar Order Types

VUI_TB_HORIZONTALtasks get ordered horizontally
VUI_TB_VERTICALtasks get order vertically

VegUITaskBar

A task bar that holds one button for each window spawned.  Clicking the button will give focus to the window

Summary
extends VegUINode
If you set the Taskbar property of the vegUIManager element to point to your taskbar then any windows will have task buttons added automatically when they are built:
constructor
Sets the most common template properties for the taskbar
builds the taskbar
Adds a taskbutton for a window
Checks if a task button exists for a certain window
Reorders taskbuttons, removing any that dont have a window any assigned to them any longer
Removes the taskbutton for a window

Hierarchy

extends VegUINode

Inherits all properties and methods from VegUINode

VegUINode
|
+--> VegUITaskBar

Dependencies

Automatic adding of windows to taskbar

If you set the Taskbar property of the vegUIManager element to point to your taskbar then any windows will have task buttons added automatically when they are built:

Manager.Taskbar = Manager.get_new(VUI_TASKBAR);
Manager.Taskbar.set(500,20,0,0,VUI_TB_HORIZONTAL,5);
Manager.build_element(Manager.Taskbar);

Child Elements

All of these child elements are accessable by this.[child_name] even though they may not be all direct children of this element

TplButtonVegUIButton, all task buttons will be cloned from this button

Properties

Object Properties

Btnsobject, holds all the buttons in the taskbar
buttonSpaceint, space between task buttons
tbTypeint, taskbar type
btnNumint, button counter
btnOffsetint, offset position

Template Properties

T.buttonSpacebuttonSpace
T.tbTypetbType
T.btnOffsetbtnOffset

Functions

VegUITaskBar

function VegUITaskBar(refName,
Parent,
Manager)

constructor

See Parent

VegUINode::VegUINode

set_taskbar

this.set_taskbar = this.set = function(w,
h,
x,
y,
type,
space)

Sets the most common template properties for the taskbar

Alias

set()

Parameters

int wwidth (pixels)
int hheight (pixels)
int xx position (pixels)
int yy position (pixels)
int typetask bar type Taskbar Order Types
int spacespace between task buttons (pixels)

See Parent

VegUINode::set_node

Example

TaskBar.set(500,20,0,0,VUI_TB_HORIZONTAL,5);

build_taskbar

this.build_taskbar = this.build = function(toNode)

builds the taskbar

private function

You should always use VegUIManager::build_element to build vegui elements

Alias

build()

Parameters

<HTMLNode toNode>if submitted the created html node will be appended to toNode

Returns

int1 on success
nullon failure

taskbutton_add

this.taskbutton_add = function(Win)

Adds a taskbutton for a window

Parameters

VegUIWindow Winthe window element

Returns

VegUIButtonthe created button
nullif there already exists a button for the submitted window
nullif the VUI_NOTASK flag is active on the window

See also

taskbutton_remove, taskbutton_reorder

Example

myWin = Manager.get_new(VUI_WIN);
Manager.build_element(myWin);
TaskBar.taskbutton_add(myWin);

taskbutton_exists

this.taskbutton_exists = function(Win)

Checks if a task button exists for a certain window

Parameters

<VegUIWindow> Winthe window element

Returns

booltrue if taskbutton exists for the submitted window
boolfalse if taskbutton does not exists for the submitted window

Example

// create and build a window
myWin = Manager.get_new(VUI_WIN);
Manager.build_element(myWin);

// add task button to taskbar for window
TaskBar.taskbutton_add(myWin)

// then this will return true:
return TaskBar.taskbutton_exists(myWin);

taskbutton_reorder

this.taskbutton_reorder = function()

Reorders taskbuttons, removing any that dont have a window any assigned to them any longer

taskbutton_remove

this.taskbutton_remove = function(Win)

Removes the taskbutton for a window

Parameters

VegUIWindow Winthe window element

See also

taskbutton_add

Example

// create and build window element
myWin = Manager.get(VUI_WIN);
Manager.build_element(myWin);

// add taskbutton for window
TaskBar.taskbutton_add(myWin);

// remove taskbutton from window
TaskBar.taskbutton_remove(myWin);
A task bar that holds one button for each window spawned.
vegUI element type for VegUITaskBar
function VegUITaskBar(refName,
Parent,
Manager)
constructor
this.set_taskbar = this.set = function(w,
h,
x,
y,
type,
space)
Sets the most common template properties for the taskbar
this.build_taskbar = this.build = function(toNode)
builds the taskbar
this.taskbutton_add = function(Win)
Adds a taskbutton for a window
this.taskbutton_exists = function(Win)
Checks if a task button exists for a certain window
this.taskbutton_reorder = function()
Reorders taskbuttons, removing any that dont have a window any assigned to them any longer
this.taskbutton_remove = function(Win)
Removes the taskbutton for a window
The most basic VegUI Element.
int, space between task buttons
int, taskbar type
int, offset position
function VegUINode(refName,
Parent,
Manager)
this.set = this.set_node = function(nodeType,
w,
h,
x,
y,
pos,
z)
Template Function
this.build_element = function(VegUIObj,
toNode)
builds a VegUIElement.