vegui. cbox. class.js

Summary
Bitmask flags that can be set on the flags property of the VegUIContentBox widget
vegUI element type for VegUIContentBox
A scrollable frame to display content in.
extends VegUINode
These flags are turned on for this element by default
These elements are all accessable over this.[child_name] even though they may not all be direct children of this element
builds the content box
Fills the Content child of the content box with an existing HTML node
Fills the content child of the content box with the contents of a html file
Handles key input on the element, this private function is called whenever a key is hit on the keyboard while the element is focused.
Set the most common template properties for this element
Updates bounding box of the content child

Constants

Flags

Bitmask flags that can be set on the flags property of the VegUIContentBox widget

These flags need to be set before the element is built

VUI_HIDE_SCROLLXhide the x axis scrollbar
VUI_HIDE_SCROLLYhide the y axis scrollbar
VUI_HIDE_SCROLLShide both scrollbars

VUI_CBOX

vegUI element type for VegUIContentBox

VegUIContentBox

A scrollable frame to display content in.

Summary
extends VegUINode
These flags are turned on for this element by default
These elements are all accessable over this.[child_name] even though they may not all be direct children of this element
builds the content box
Fills the Content child of the content box with an existing HTML node
Fills the content child of the content box with the contents of a html file
Handles key input on the element, this private function is called whenever a key is hit on the keyboard while the element is focused.
Set the most common template properties for this element
Updates bounding box of the content child

Hierarchy

extends VegUINode

Inherits all properties and methods from VegUINode

VegUINode
|
+--> VegUIContentBox

Flags

These flags are turned on for this element by default

VUI_HMOUSE_WHEEL | VUI_HMOUSE_OVER | VUI_HMOUSE_OUT

Child Elements

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

CHolderVegUINode, Content holder node, the frame
ContentVegUINode, Content node
ScrollXVegUIScrollbar, X Axis Scroll
ScrollYVegUIScrollbar, Y Axis Scroll

Functions

build_cbox

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

builds the content box

private function

Elements should always be build using the vegui manager

VegUIManager::build_element, VegUIManager::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 Parent

VegUINode::build_node

fill

this.fill = function(Node)

Fills the Content child of the content box with an existing HTML node

Parameters

HTMLNode NodeNode that should be displayed by the content box

Code example

myCBox.fill(document.getElementById('stuff'));

See also

fill_remote

Example

// fill content box with existing node

myCBox.fill(document.getElementById('some_element'));

// fill content box with new node

myCBox.fill(htmlnode('div'));

fill_remote

this.fill_remote = function(path,
ondone)

Fills the content child of the content box with the contents of a html file

Requires

filevegui.bridge.class.js
actionVegUIManager::init_bridge needs to have been called on the manager element

Parameters

string pathpath of file to load.
<function ondone>function to execute when done

Note

The file needs to be on the same server as the page where the content box is located on is.  The file’s contents will be added as innerHTML to the Content node so using HTML tags in the file is encouraged

See also

fill

Example

// fills the content box with the contents of file.html, note
// that it will be rendered correctly

myCBox.fill_remote('file.html');

// same as above, the function submitted will be executed once
// the content box has been filled

myCBox.fill_remote('file.html', function() { alert('done'); });

handle_key_cbox

this.handle_key = this.handle_key_cbox = function()

Handles key input on the element, this private function is called whenever a key is hit on the keyboard while the element is focused.

private function

Alias

<handle_key>

set_cbox

this.set = this.set_cbox = function(w,
h,
x,
y)

Set the most common template properties for this element

Alias

set()

Parameters

int wwidth (pixels)
int hheight (pixels)
int xx position (pixels)
int yy position (pixels)

See Parent

VegUINode::set_node

Example

myCBox.set(500,500,5,5);

update_bbox

this.update_bbox = function()

Updates bounding box of the content child

This function actually gets called automatically when the VegUINode::resize method is called on it.

A scrollable frame to display content in.
vegUI element type for VegUIContentBox
this.build = this.build_cbox = function(toNode)
builds the content box
this.fill = function(Node)
Fills the Content child of the content box with an existing HTML node
this.fill_remote = function(path,
ondone)
Fills the content child of the content box with the contents of a html file
this.handle_key = this.handle_key_cbox = function()
Handles key input on the element, this private function is called whenever a key is hit on the keyboard while the element is focused.
this.set = this.set_cbox = function(w,
h,
x,
y)
Set the most common template properties for this element
this.update_bbox = function()
Updates bounding box of the content child
The most basic VegUI Element.
enable event handling for VUI_MOUSE_WHEEL
enable event handling for VUI_MOUSE_OVER
enable event handling for VUI_MOUSE_OUT
extends VegUINode
this.build_element = function(VegUIObj,
toNode)
builds a VegUIElement.
this.build_elements = function()
builds multiple vegUI elements, if the last argument submitted to the function is a HTML node then the element’s will be built as children of that node
this.build = this.build_node = function(toNode,
takeNode)
build a HTML node from the template properties of this element.
this.init_bridge = function()
initializes common VegUIBridge object that can be accessed by all spawned VegUIElements by accessing it over their Manager property
this.set = this.set_node = function(nodeType,
w,
h,
x,
y,
pos,
z)
Template Function
this.resize = function(w,
h,
noAlign)
resizes the HTML node controlled by this element