The widget_text is a special module use to show text dynamically.

How to Initialize any Widgets?


To add a widgets call AddWidget function from GUIs members that own this function.


Class Details


Main Functions


       Initialization & Main Functions

Name

Arguments

Return

Description

Init

  • String: BaseID - HMTL ID defining the position in the DOM of the tab. (Automatically set by AddWidgets).
  • String: RegistryName - Name that define this overlay, all children IDs will start by this.

VOID

This function Initialized every part of the viewer : 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.


It will also call the parent Init().

Launch

  • None

VOID

Launch all systems required by the this and will call all children launch.


It will also call the parent Launch().



Text Functions


Name

Arguments

Return

Description

AddLang

  • Lang: Lang - Lang to assign with this widget.

THIS

Assign a Lang class to this widgets to make the function SetText usable.

SetText

  • String: TextID - Text id is the JSON file
  • String: TextID - Text group is the JSON file
  • String: TextID - The default if not found

THIS

Set the text of this widgets (will not work if no Lang is set).

AddText

  • String: Text - Text you want to add.

THIS

Add a text to the widget


Note: to use Lang class use SetText function.

ClearText

  • NONE

THIS

Will clear the text.

TextAlign

  • String: Horizontal - Horizontal alignment ("Left", "Centered", "Right").
  • String: Vertical - Vertical alignment ("Top", "Centered", "Botttom").

THIS

Change text alignment.


Note: when used before launch the functionality might not work properly don't hesitate to relaunch the text.

Replace

  • String: Replace - The text to replace
  • String: To - The text change with.

THIS

Replace a specified text in the widget.





Font Functions


Name

Arguments

Return

Description

SetFontFamily

  • String: Name - Font family name.

THIS

Change text font family.

SetFontColor

  • Color: Color - Background Color

THIS

Change the font color.

SetBold

  • Boolean : Remove - true if you want to remove it.

THIS

Add or remove the bold property of the text.

SetItalic

  • Boolean : Remove - true if you want to remove it.

THIS

Add or remove the italic property of the text.

AddAnimatedGradient

  • Color[0] and Integer[+1]: Colors - Each color take two place in array, the first is the color and the second the percent position.
  • Integer: FinalDistance - Distance between the last and the first color.
  • Integer: Speed - How many time in MS it take to make a full cycle.
  • Integer: FPS - frame rate of the animation.
  • Function: AAGCallback - Callback function when all set.
  • Class: AAGArgs - Callback function arguments

THIS

This function will create, launch, and apply to the text a AnimatedGradient but inside the letters.



Overrides / Inherited Functions:

Setters Functions


Name

Arguments

Return

Description

AddLayout

  • LayoutType: Type - Define which layout you want.

Layout

Same as parent.

AddWidget

  • WidgetType: Type - Define which widget you want.
  • String: Name - Name of this widgets.

Widgets

Same as parent.

Destroy

  • None

None

Same as parent.

Clear

  • None

None

Same as parent.




Design functions

               Positions and general design:


Name

Arguments

Return

Description

Visible

  • Boolean: IsVisible - Set you want it to appear or disappear.
  • Integer: Fade - Fading time in MS
  • Function: VisCallback - Callback function called when fade is over.

This

Same as parent.

SetSizePosition

  • Integer - @CSS String: Width - of this widget (based  on parent).
  • Integer - @CSS String: Height - of this widget (based  on parent).
  • Integer - @CSS String: X - (horizontal) of this widget (based  on parent).
  • Integer - @CSS String: Y - (vertical) of this widget (based  on parent).
  • Boolean: FromRight - Set if x has to start from right
  • Boolean: FromBottom - Set if x has to start from bottom

This

Same as parent.

GetPosition

  • @CSS String: Where - position in CSS

@CSS String

Same as parent.

GetSize

  • None

Class:

  • w: width
  • h: height

Same as parent.

SetPadding

  • String: At - Where to add the padding (Top, Left, Bottom, Right or All).
  • Integer - @CSS String: Value - Size of the padding

This

Same as parent.

SetMargin

  • String: At - Where to add the padding (Top, Left, Bottom, Right or All).
  • Integer - @CSS String: Value - Size of the margin

This

Same as parent..

AddVerticalOverflow

  • @CSS String: State - CSS overflow state

This

Same as parent.

AddHorizontalOverflow

  • @CSS String: State - CSS overflow state

This

Same as parent.

SetRotation

  • Integer: Deg - Degrees of rotation

This

Same as parent.



               Style:


Name

Arguments

Return

Description

SetBackgroundColor

  • Color: BG - Background Color

This

Same as parent.

SetBackgroundImage

  • String: URL - Image link
  • Function: SBICallback - Callback when the image has been loaded.
  • Boolean: Debug - Set if you need a debug when the image has been loaded.

VOID

Same as parent.

SetBGImageRepeat

  • @Nullable @CSS String: Vertical - repeat CSS property for vertical.
  • @Nullable @CSS String: Vertical - repeat CSS property for Horizontal.

This

Same as parent.

SetBGImageSizeAndPosition

  • Integer - @CSS String: Size - CSS background size.
  • Integer - @CSS String: X - CSS position
  • Integer - @CSS String: Y - CSS position 

This

Same as parent.

SetOpacity

  • Float: Opacity - Opacity value [0,1]

None

Same as parent.



               Contour:


Name

Arguments

Return

Description

SetBorder

  • String: At - Define which border you want or enter "All" (Can can add more than one - it always start by a capital).
  • @CSS String: Type - CSS border type.
  • Integer - @CSS String: Thickness - CSS border size.
  • Color: Color - Border Color
  • Integer - @CSS String - Class: Thickness - Set the border radius (integer will be same "px" for all). To use the class just send member like: class.top_left.

This

Same as parent.

RemoveOutline

  • None

This

Same as parent.


Font:


Name

Arguments

Return

Description

SetFontSize

  • Integer - @CSS String : Value - Set the font size based on CSS values.

This

Same as parent.


Interaction:


Name

Arguments

Return

Description

ForceInteraction

  • None

This

Same as parent.

AddHoveredEvent

  • Function: funcIn - Function called when mouse enter
  • Function: funcOut  - Function called when mouse leave

VOID

Same as parent.

AddPressedEvent

  • Function: funcIn - Function called when mouse is pressed
  • Function: funcOut  - Function called when mouse is released

VOID

Same as parent.

Movable

  • Boolean: LockHorizontal
  • Boolean: LockVertical

VOID

Same as parent.

trigger

  • String : Trigger - JQuery event name.

VOID

Same as parent.



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

parent

Widget

undefined

Parent class of this widget

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

WidgetType

WIDGET

Hold the type of this widget.

divID

String

undefined

Hold the text ("p") id.

layout

Layout

null

Hold this widget layout (if created).


Information

Name

Type

Default Value

Description

verticalAlign

String

"top"

Hold the actual text align set for the vertical.

horizontalAlign

String

"left"

Hold the actual text align set for the horizontal.

lang

Lang

null

Hold the Lang class used for the text.

gradient

AnimatedGradient

null

Hold the actual gradient animation if called.


Overrides / Inherited functions:


Name

Arguments

Return

Description

Shift

  • Integer - @CSS String: ShiftX
  • Integer - @CSS String: ShiftY

None

Same as parent.



Compatibility



LANGUAGE CLASS:  Compatible.

Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents