vegui. checkbox. class.js

Summary
VegUI element type for VegUICheckBox
The checkbox widget
extends VegUINode
These child elements are all accessable over *this.[child_name] even though they may not all be direct children of this element
Constructor
Builds the checkbox
Sets the most common template properties for the checkbox
Toggles checkbox to be checked or unchecked

Constants

VUI_CHECKBOX

VegUI element type for VegUICheckBox

VegUICheckBox

The checkbox widget

Summary
extends VegUINode
These child elements are all accessable over *this.[child_name] even though they may not all be direct children of this element
Constructor
Builds the checkbox
Sets the most common template properties for the checkbox
Toggles checkbox to be checked or unchecked

Hierarchy

extends VegUINode

Inherits all properties and methods from VegUINode

VegUINode
|
|
+--> VegUICheckBox

Child Elements:

These child elements are all accessable over *this.[child_name] even though they may not all be direct children of this element

BtnCheckVUI_BUTTON Button that represents the check box
LabelVUI_NODE Node that holds the text that appears besides the buttton

Properties

Object Properties

isCheckedbool holds the checked status of the checkbox, true if it is checked, false if it is unchecked
labelTxtstring text of the label
cClassstring Css class to use for BtnCheck when checked
ucClassstring Css class to use for BtnCheck when unchecked

Template Properties

T.labelTxtlabelTxt
T.cClasscClass
T.ucClassucClass
T.checkedbool if ture checkbox will be checked by default

Functions

VegUICheckBox

function VegUICheckBox(refName,
Parent,
Manager)

Constructor

Parameters

string refNamename of the object
<VegUIElement Parent>parent element of the object
VegUIElement Managermanager element of the object

See also

VegUINode::VegUINode

build_cb

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

Builds the checkbox

private function

You should always use the VegUIManager::build_element function to build elements.

Alias

build()

Parameters

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

Returns

nullon failure
int1 on success

See also

VegUINode::build_node

set_cb

this.set = this.set_cb = function(x,
y,
w,
h,
label,
checked,
cClass,
ucClass)

Sets the most common template properties for the checkbox

Alias

set()

Parameters

int xx position (pixels)
int yy position (pixels)
int wwidth (pixels)
int hheight (pixels)
string labeltext to be displayed in the label
bool checkedif true the checkbox will be checked by default
string cClassCSS class to use for BtnCheck when checked
string ucClassCSS class to use for BtnCheck when unchecked

See also

VegUINode::set_node

Example

myCheckBox.set(5,5,150,20,'Enable Something!',false,'cb_checked','ch_unchecked');

tgl_check

this.tgl_check = function(b,
noOnChange)

Toggles checkbox to be checked or unchecked

Parameters

bool btrue = checked , false = unchecked
bool noOnChangeif true will prevent VegUINode::onchange from being called

Example

// checkbox will be set to unchecked

myCheckBox.tgl_check(false);

// checkbox will be set to checked

myCheckBox.tgl_check(true);

// set onchange event for the checkbox

myCheckBox.event_add('onchange', function(a) {
alert(a[0].isChecked);
});

// checkbox will be set to checked and the onchange
// event will fire

myCheckBox.tgl_check(true);

// onchange event will not fire

myCheckBox.tgl_check(true, true);
The checkbox widget
VegUI element type for VegUICheckBox
function VegUICheckBox(refName,
Parent,
Manager)
Constructor
this.build = this.build_cb = function(toNode)
Builds the checkbox
this.set = this.set_cb = function(x,
y,
w,
h,
label,
checked,
cClass,
ucClass)
Sets the most common template properties for the checkbox
this.tgl_check = function(b,
noOnChange)
Toggles checkbox to be checked or unchecked
The most basic VegUI Element.
string text of the label
string Css class to use for BtnCheck when checked
string Css class to use for BtnCheck when unchecked
function VegUINode(refName,
Parent,
Manager)
this.build_element = function(VegUIObj,
toNode)
builds a VegUIElement.
this.build = this.build_node = function(toNode,
takeNode)
build a HTML node from the template properties of this element.
this.set = this.set_node = function(nodeType,
w,
h,
x,
y,
pos,
z)
Template Function
varies from element to element