vegui. window. class.jsSummary | | | | | | | | | the minimum z-level of windows | | the z level space between windows | | Bitmask flags that can be set on the flags property of the VegUIWindow widget | | A dragable, resizeable window widget with a header component | | | | | | | | These flags are turned on by default for this element | | These elements are all directly accessable by this.[child_name] even though they may not be direct childs of this element. | | | | | | | | | | | | | | | | Clones a window, calls clone_node() and also clones window specific event handlers | | | | This method is called when the mouse is moved while drag mode for this window is on. | | Maximizes the window, moving it to the position this.maxX,maxY and resizing it to this.maxW, this.maxH | | Minimizes the window, hiding it from the user but never destroying it | | Resizes the WinShadow element in relation to the mouse cursor coordinates | | This makes the WinShadow element visible and molds it to fit the window’s proportions and position | | Sets the most common template properties of the window | | Sets the title of the window | | Similar to <VegUI::set_focus_node> but also has the option to bring the window to the foreground and z-sort the other windows | | Unhides the window and gives focus to it | | Toggles drag mode on or off, when the window is in drag mode the WinShadow element is visible and moves with the mouse cursor | | Toggles resize mode on or off. | | | | | | when window is moved to the background | | when window is brought to the front | | | | |
WINSHAD_CLASSThe css class to use for VegUIManager.WinShadow
VUI_WIN_Zthe minimum z-level of windows
VUI_WIN_Z_SPACEthe z level space between windows
FlagsBitmask flags that can be set on the flags property of the VegUIWindow widget | VUI_KILL_ON_CLOSE | Window is destroyed when the close() method is called | | VUI_NORESIZE_W | Window’s width can not be resized | | VUI_NORESIZE_H | Window’s height can not be resized | | VUI_NORESIZE | Window can not be resized | | VUI_NOMOVE_X | Window cannot be moved along the x axis | | VUI_NOMOVE_Y | Window cannot be moved along the y axis | | VUI_NOMOVE | Window cannot be moved | | VUI_MOMAXIMIZE | Window cannot be maximized | | VUI_NOMINIMIZE | Window cannot be minimized | | VUI_NOTASK | Window will not be added to taskbar if there is one |
VegUIWindowA dragable, resizeable window widget with a header component Summary | | | | | | | These flags are turned on by default for this element | | These elements are all directly accessable by this.[child_name] even though they may not be direct childs of this element. | | | | | | | | | | | | | | | | Clones a window, calls clone_node() and also clones window specific event handlers | | | | This method is called when the mouse is moved while drag mode for this window is on. | | Maximizes the window, moving it to the position this.maxX,maxY and resizing it to this.maxW, this.maxH | | Minimizes the window, hiding it from the user but never destroying it | | Resizes the WinShadow element in relation to the mouse cursor coordinates | | This makes the WinShadow element visible and molds it to fit the window’s proportions and position | | Sets the most common template properties of the window | | Sets the title of the window | | Similar to <VegUI::set_focus_node> but also has the option to bring the window to the foreground and z-sort the other windows | | Unhides the window and gives focus to it | | Toggles drag mode on or off, when the window is in drag mode the WinShadow element is visible and moves with the mouse cursor | | Toggles resize mode on or off. | | | | | | when window is moved to the background | | when window is brought to the front | | | | |
Hierarchyextends VegUINode Inherits all properties and methods from VegUINode VegUINode | +--> VegUIWindow
Child ElementsThese elements are all directly accessable by this.[child_name] even though they may not be direct childs of this element. | Skin | VegUINode, Skin node | | Ui | VegUINode, UI node, add any childs that need interaction to this. | | Header | VegUIButton, Header node (Child of Ui) | | Caption | VegUINode, holds window caption (Child of Header) | | RC_R | VegUIButton, resize capture right (Child of Ui) | | RC_B | VegUIButton, resize capture bottom (Child of Ui) | | RC_RB | VegUIButton, resize capture right-bottom (Child of Ui) | | BtnClose | VegUIButton, closes the window (Child of Ui) | | BtnMaximize | VegUIButton, maximizes the window (Child of Ui) | | BtnMinimize | VegUIButton, minimizes the window (Child of Ui) |
Object Properties| minW | int, minimum width (pixels) | | maxW | int, maximum width (pixels) | | minH | int, minimum height (pixels) | | maxH | int, maximum height (pixels) | | maxX | int, x position of the window when maximized | | maxY | int, y position of the window when maximized | | bMaximized | bool, set to true if the window is currently maximized | | origW | int, original width of window (set by maximize) | | origH | int, original height of window (set by maximize) | | origX | int, original x position of window (set by maximize) | | origY | int, original y position of window (set by minimize) | | pushZ | int, push z index (pixels) | | title | string, read-only, current window title | | WinShadow | VegUINode, link to WinShadow in the window’s manager | | winIdx | int, read-only, index of the window |
build_win| this.build = this.build_win = function( | toNode | ) |
|
Builds the window private function You should always use VegUIManager::build_element to build vegui elements Aliasbuild() Parameters| <HTMLNode toNode> | if submitted the created HTML node will be appedned to toNode |
Returns| int | 1 on success | | null | on failure |
See ParentVegUINode::build_node
clone_win| this.clone = this.clone_win = function( | Template | ) |
|
Clones a window, calls clone_node() and also clones window specific event handlers private function Aliasclone() Parameters| VegUIWindow Template | the template window to clone from |
ReturnsSee ParentVegUINode::clone_node
closeCloses the window. If the VUI_KILL_ON_CLOSE flag is set it will also destroy the window. Will trigger onclose event ExamplemyWin.close();
myWin.flags |= VUI_KILL_ON_CLOSE myWin.close();
dragThis method is called when the mouse is moved while drag mode for this window is on. It moves the WinShadow element to a new position private function See alsotgl_drag
maximize| this.maximize = function() |
Maximizes the window, moving it to the position this.maxX,maxY and resizing it to this.maxW, this.maxH If window is maximized when this method is called it will be restored to its original proportions and position See Alsominimize, close
minimize| this.minimize = function() |
Minimizes the window, hiding it from the user but never destroying it
mresize| this.mresize = function( | dir | ) |
|
Resizes the WinShadow element in relation to the mouse cursor coordinates This function is called when the user clicks on one of the resize panels on the borders of the window private function Paramters| string dir | resize direction, makes sure the window can only be resized in the given direction (‘e-resize’, ‘s-resize’, ‘se-resize’) |
See alsotgl_resize
put_shadow| this.put_shadow = function() |
This makes the WinShadow element visible and molds it to fit the window’s proportions and position private function
set_win| this.set = this.set_win = function( | title, | | w, | | h, | | x, | | y | ) |
|
Sets the most common template properties of the window Aliasset() Parameters| string title | title of the window | | int w | width (pixels) | | int h | height (pixels) | | int x | x position (pixels) | | int y | y position (pixels) |
See ParentVegUINode::set_node ExamplemyWin.set('Some Window!', 500, 300, 50, 50);
set_caption| this.set_caption = function( | txt | ) |
|
Sets the title of the window Paramters| string txt | new title for the window |
ExamplemyWin.set_caption('Another title for my window');
set_focus_win| this.set_focus = this.set_focus_win = function( | focusType, | | bringToFront | ) |
|
Similar to <VegUI::set_focus_node> but also has the option to bring the window to the foreground and z-sort the other windows Aliasset_focus() Parameters| int focusType | Focus types | | bool bringToFron | if true the window is brough to the foreground |
See ParentVegUINode::set_focus_node
showUnhides the window and gives focus to it
tgl_drag| this.tgl_drag = function( | b | ) |
|
Toggles drag mode on or off, when the window is in drag mode the WinShadow element is visible and moves with the mouse cursor Parameters| bool b | true (on), false (off) |
See alsodrag
tgl_resize| this.tgl_resize = function( | b | ) |
|
Toggles resize mode on or off. When resize mode is on the WinShadow element resizes in relation to mouse cursor movements Parameters| bool b | true (on) , false (off) |
See alsomresize
ontobackwhen window is moved to the background
ontofrontwhen window is brought to the front
|