class ImageWidget view source
extends WidgetBase

Image widget.

Constructor

new ImageWidget(opts : Object)

Parameters

opts Object instantiation options
opts.appHash number internal app hash
opts.appWidget ApplicationWidget early ApplicationWidget link
opts.auiTag number internal aui tag id
opts.inTable boolean internal is in table
opts.inMatrix boolean internal is in matrix
opts.inFirstTableRow boolean internal
opts.inScrollGrid boolean internal is in a scroll grid
opts.ignoreLayout boolean ignore layout char measurer
Instance members

addClass(className : string)
[inherits from WidgetBase]

Add the given class to element

Parameters

className string class to add

detach()
[inherits from WidgetBase]

Detach the widget from the dom

emit(type : string, arguments… : any)
[inherits from EventListener]

Emit an event

Parameters

type string event type to emit
arguments any arguments (excluding type) will be set in event.data

getApplicationIdentifier() : (string)
[inherits from WidgetBase]

Get the unique identifier of the application

Returns

(string) the unique identifier of the application

getApplicationWidget() : (ApplicationWidget)
[inherits from WidgetBase]

Get Application Widget related to the widget

Returns

(ApplicationWidget) ApplicationWidget

getBackgroundColor() : (string)
[inherits from ColoredWidgetBase]

Returns the background color

Returns

(string) a color definition as an RGB function ('rgb(128, 255, 0)')

getBuildParameters() : (Object)
[inherits from WidgetBase]

Returns build parameters

Returns

(Object) build parameters

getClassName() : (string)
[inherits from WidgetBase]

Get the main class name of the widget

Returns

(string) the main class name

getColor() : (string)
[inherits from ColoredWidgetBase]

Returns the fore color

Returns

(string) a color definition as an RGB function ('rgb(128, 255, 0)')

getColorFromStyle() : (string)
[inherits from ColoredWidgetBase]

Returns the fore color (directly from style css)

Returns

(string) a color definition as an RGB function ('rgb(128, 255, 0)')

getDialogType() : (string)
[inherits from WidgetBase]

return widget current dialog type

Returns

(string) values can be : Input, InputArray, Display, DisplayArray or Construct

getElement() : (HTMLElement)
[inherits from WidgetBase]

Get the root element of the widget

Returns

(HTMLElement) the root element of the widget

getEnd() : (string)
[inherits from WidgetBase]

Get end (for reversed mode)

Returns

(string) end keyword for rtl

getFormWidget() : (FormWidget)
[inherits from WidgetBase]

Get the Form Widget related to the widget

Returns

(FormWidget) FormWidget

getImage() : (string)

Shortcut for getSrc This is used in the context of a Static FormField

Returns

(string) the URL of the displayed image or a font-image URL: font:[fontname]:[character]:[color]

getLayoutEngine() : (LayoutEngineBase)
[inherits from WidgetBase]

Get the widget's layout engine

Returns

(LayoutEngineBase) the widget's layout engine

getLayoutInformation() : (LayoutInformation)
[inherits from WidgetBase]

Get the widget's layout information

Returns

(LayoutInformation) the widget's layout information

getName() : (string)
[inherits from WidgetBase]

Get the name of the widget class

Returns

(string) the widget class name

getParentWidget() : (WidgetGroupBase)
[inherits from WidgetBase]

Get the parent widget

Returns

(WidgetGroupBase) the parent widget

getSrc() : (string)

Get the source of the image file

Returns

(string) the URL of the displayed image or a font-image URL: font:[fontname]:[character]:[color]

getStart() : (string)
[inherits from WidgetBase]

Get start (for reversed mode)

Returns

(string) start keyword for rtl

getStyle(selector : string, property : string, appliesOnRoot : boolean) : (any)
[inherits from WidgetBase]

Get widget style property value

Parameters

selector string additional sub selector
property string property name
appliesOnRoot boolean true if the returned selector should match the root too.

Returns

(any) property value if set, undefined otherwise

getTableWidgetBase() : (TableWidgetBase)
[inherits from WidgetBase]

Get the table Widget base class related to the widget

Returns

(TableWidgetBase) TableWidgetBase

getTitle() : (string)
[inherits from WidgetBase]

Get the title of the widget

Returns

(string) the tooltip text

getUniqueIdentifier() : (string)
[inherits from WidgetBase]

Get the unique identifier of the widget

Returns

(string) the unique identifier of the widget

getUserInterfaceWidget() : (UserInterfaceWidget)
[inherits from WidgetBase]

Get the UI widget related to the widget

Returns

(UserInterfaceWidget) UserInterfaceWidget

getValue() : (string)

Shortcut for getSrc This is used in the context of an Image FormField

Returns

(string) the URL of the displayed image or a font-image URL: font:[fontname]:[character]:[color]

getWindowWidget() : (WindowWidget)
[inherits from WidgetBase]

Get the Window Widget related to the widget

Returns

(WindowWidget) WindowWidget

hasClass(className : string)
[inherits from WidgetBase]

Checks if the widget element has the given class

Parameters

className string class to check

hasFocus() : (boolean)
[inherits from WidgetBase]

Check if widget node has focus (class gbc_Focus)

Returns

(boolean) true if widget node has focus

hasVMFocus() : (boolean)
[inherits from WidgetBase]

Check if widget node has VM focus

Returns

(boolean) true if widget node has VM focus

ignoreLayout() : (boolean)
[inherits from WidgetBase]

Does the widget ignore layouting

Returns

(boolean) true if the widget ignore all layout.

isChildOf(parent : WidgetBase) : (boolean)
[inherits from WidgetBase]

Check if this widget is a child of a given one

Parameters

parent WidgetBase the reference parent widget

Returns

(boolean) true if is a child, false otherwise

isDestroyed() : (boolean)
[inherits from EventListener]

Returns if the node is destroyed

Returns

(boolean) true if node is destroyed

isEnabled() : (boolean)
[inherits from WidgetBase]

Check if widget is enabled

Returns

(boolean) true if the widget allows user interaction, false otherwise.

isFocusable() : (boolean)
[inherits from WidgetBase]

Returns if the widget is focusable

Returns

(boolean) State of focusable

isFontImage() : (boolean)

Check if image is a font image

Returns

(boolean) true if is a font image

isHidden() : (boolean)
[inherits from WidgetBase]

Check if the widget is hidden

Returns

(boolean) true if the widget is hidden, false otherwise

isInMatrix() : (boolean)
[inherits from WidgetBase]

Check if the widget is in a matrix

Returns

(boolean) true if the widget is in a matrix, false otherwise.

isInTable() : (boolean)
[inherits from WidgetBase]

Check if the widget is in a table

Returns

(boolean) true if the widget is in a table, false otherwise.

isNoBorder() : (boolean)
[inherits from WidgetBase]

Check if the widget is displayed without border

Returns

(boolean) true if the widget has no border class, false otherwise

isReversed() : (boolean)
[inherits from WidgetBase]

Check if arabic mode is enabled

Returns

(boolean) true if enabled

isVisible() : (boolean)
[inherits from WidgetBase]

Check if the widget is visible

Returns

(boolean) true if visible, false otherwise

loseFocus()
[inherits from WidgetBase]

Called before setFocus to notify previous focused widget

loseVMFocus()
[inherits from WidgetBase]

Called before setting VM focus to notify previous VM focused widget

removeClass(className : string)
[inherits from WidgetBase]

Remove the given class from element

Parameters

className string class to delete

replaceWith(widget : WidgetBase)
[inherits from WidgetBase]

Replace the current widget with a given one

Parameters

widget WidgetBase the new widget

setAlignment(y : number|string, x : number|string)

Align the image

Parameters

y number|string y position
x number|string x position

setAutoScale(setted : boolean)

Forces the image to be stretched to fit in the area reserved for the image.

Parameters

setted boolean true : autoScale , false: default

setBackgroundColor(color : string, notImportant : boolean)
[inherits from ColoredWidgetBase]

Sets the background color

Parameters

color string a CSS color definition. Can be a color name ('red', 'blue'), an hex code ('#f5d48a') or a color function ('rgb(128, 255, 0)') null restores the default value.
notImportant boolean Set the CSS color definition on the ID whithout '!important'.

setClickableImage(clickable : boolean)

If image has action, change cursor

Parameters

clickable boolean true if clickable, false otherwise

setColor(color : string)
[inherits from ColoredWidgetBase]

Set the fore color

Parameters

color string a CSS color definition. Can be a color name ('red', 'blue'), an hex code ('#f5d48a') or a color function ('rgb(128, 255, 0)'). null restores the default value.

setDialogType(dialogType : string)
[inherits from WidgetBase]

Set widget current dialog type. Can be Input, Input Array, Display, Display Array or Construct

Parameters

dialogType string Dialog type

setEnabled(enabled : boolean)
[inherits from WidgetBase]

Defines the enabled status of the widget

Parameters

enabled boolean true if the widget allows user interaction, false otherwise.

setFocusable(focusable : boolean)
[inherits from WidgetBase]

Defines if the widget is focusable

Parameters

focusable boolean State of focusable

setImage(image : string)

ShortCut for setSrc This is used in the context of a Static Image

Parameters

image string the URL of the image to display or a font-image URL: font:[fontname]:[character]:[color]

setNoBorder(noBorder : boolean)
[inherits from WidgetBase]

Remove or add borders to the widget

Parameters

noBorder boolean true if the widget has no border class, false otherwise

setParentWidget(widget : WidgetGroupBase, options : Object)
[inherits from WidgetBase]

Defines the parent widget

Parameters

widget WidgetGroupBase the widget to use as parent
options Object possible options
options.noLayoutInvalidation boolean won't affect parent layout

setReverse(rtl : boolean)
[inherits from WidgetBase]

Set Arabic mode

Parameters

rtl boolean true if widget is right to left

setSrc(src : string, directApply : boolean)

Set the source of the image file

Parameters

src string the URL of the image to display or a font-image URL: font:[fontname]:[character]:[color]
directApply boolean true to apply src directly (internal use)

setStretch(stretch : boolean)

Define the image as stretchable

Parameters

stretch boolean true if stretchable

setStyle(selector : string|Object, style : Object)
[inherits from WidgetBase]

Updates widget style with new rules

Parameters

selector string|Object additional sub selector
style Object style properties to set

setValue(val : string)

ShortCut for setSrc This is used in the context of an Image FormField

Parameters

val string the URL of the image to display or a font-image URL: font:[fontname]:[character]:[color]

toggleClass(className : string, switcher : boolean)
[inherits from WidgetBase]

Toggle the given class to element

Parameters

className string class to toggle
switcher boolean forced new state

translate()
[inherits from WidgetBase]

Translate the widget

when(type : string, handler : Hook, once : boolean) : (HandleRegistration)
[inherits from EventListener]

Registers a handler for this event type

Parameters

type string event type (e.g. "attribute changed")
handler Hook handler to trigger when the event type is emitted
once boolean if true, will only fire once

Returns

(HandleRegistration) a registration handle (for unbind purpose)