Widget
The widget is most basic of all it is mostly used for layout purpose but it is also the parent class of all others widgets that use almost the same functions.
How to Initialize any Widgets?
To add a widget call AddWidget function from GUIs members that own this function.
Class Details
Functions:
Initialization & Main Functions
Name |
Arguments |
Return |
Description |
Init |
|
VOID |
This function Initialized every part of the viewer (if DoNotBuildDOM is not false): HMTL, CSS, Data, Events, etc... It will be generated in the defined ID and all HTML IDs used for this will start by the RegistryName defined in arguments. |
Launch |
|
VOID |
Launch all systems required by the this and will call all children launch. |
Setters Functions
Name |
Arguments |
Return |
Description |
AddLayout |
|
Add add a Layout to this widgets. Note: By using layout avoid to resize widgets children. |
|
AddWidget |
|
Will add a selected children widgets in itself and return it. Note: The children will always they're IDs starting by the parent name, so time it's not in the same family you can add an identical name. |
|
Destroy |
|
None |
Remove the widget from the DOM. |
Clear |
|
None |
Clear all widget data. |
Design functions
Positions and general design:
Name |
Arguments |
Return |
Description |
Visible |
|
This |
Will fade this widget, if no fade speed is set it will be instant. |
SetSizePosition |
|
This |
Set the size and the position of this widget based on the parent widget. |
GetPosition |
|
@CSS String |
Get the position at specific location (top, left, ...). |
GetSize |
|
Class:
|
Return the actual size of the widget. |
SetPadding |
|
This |
Add a padding to the widget. |
SetMargin |
|
This |
Add a margin to the widget. |
AddVerticalOverflow |
|
This |
Set the Vertical overflow of the widget. |
AddHorizontalOverflow |
|
This |
Set the Horizontal overflow of the widget. |
SetRotation |
|
This |
Use the CSS "transform" property to rotate the widget. |
Style:
Name |
Arguments |
Return |
Description |
SetBackgroundColor |
|
This |
Change the background color. |
SetBackgroundImage |
|
VOID |
Set a background image. |
SetBGImageRepeat |
|
This |
Set the background repeat properties, "no-repeat" is set when if null |
SetBGImageSizeAndPosition |
|
This |
Change setting for the background image. |
SetOpacity |
|
None |
Change widget opacity. |
Contour:
Name |
Arguments |
Return |
Description |
SetBorder |
|
This |
Set a border and also set the border radius. |
RemoveOutline |
|
This |
Remove the default outline used by browsers. |
Font:
Name |
Arguments |
Return |
Description |
SetFontSize |
|
This |
Change the font size. |
Interaction:
Name |
Arguments |
Return |
Description |
ForceInteraction |
|
This |
When you defined the overlay as not filling the viewport it will no more obstruct the mouse events and widget will not be interactive. But if you want a specific widget have it you can use this function. |
AddHoveredEvent |
|
VOID |
This function will set the events "mouseenter" and "mouseleave". |
AddPressedEvent |
|
VOID |
This function will set the events "mousedown" and "mouseup". |
Movable |
|
VOID |
If you've set the overlay as movable and you don't want a widget moving either one direction or all, use this function. |
trigger |
|
VOID |
Force trigger a specific event. |
Private Details
All private details are usable but its recommended to not use any of those. It might modify the proper functioning of the class.
Variables (Members):
Main Members
Name |
Type |
Default Value |
Description |
id |
String |
undefined |
Global HMTL Id of the viewer (# + name). |
registryName |
String |
undefined |
Name of this widget. |
basedId |
String |
undefined |
Where it is located is the existing DOM (its parent). |
widgetType |
Hold the type of this widget. |
||
layout |
null |
Hold this widget layout (if created). |
Information
Name |
Type |
Default Value |
Description |
position |
Class |
x: 0 and y: 0 and fromRight: false and fromBottom: false |
Hold the actual position of the widget. |
horizontalLock |
Boolean |
true |
Used to check if movement is locked horizontally. |
verticalLock |
Boolean |
true |
Used to check if movement is locked vertically. |
shiftX |
Integer |
0 |
Hold the actual shift X |
shiftY |
Integer |
0 |
Hold the actual shift Y |
backgroundImageSize |
Integer - @CSS String |
100% |
Hold the background image size. |
AllWidget |
Widgets[] |
[] |
Hold all children Widgets. |
lastZIndex |
Integer |
100 |
To make sure the Widgets are properly layered we decrement this variable each widgets. |
intervals |
Integer[] |
[] |
Hold all animation IDs. |
Functions:
Interaction Functions
Name |
Arguments |
Return |
Description |
Shift |
|
None |
Used by parent widget or overlay for moving based on a general shift. |
Compatibility
LANGUAGE CLASS: Not compatible.
Created with the Personal Edition of HelpNDoc: Produce electronic books easily