Drag[en]gine Script Module DragonScript  1.7
Dragengine.Gui.Widget Class Reference
Inheritance diagram for Dragengine.Gui.Widget:
Dragengine.Gui.Container Dragengine.Gui.DisplayCanvas Dragengine.Gui.DisplayImage Dragengine.Gui.DisplayStyledText Dragengine.Gui.DisplayVideo Dragengine.Gui.Label Dragengine.Gui.ProgressBar Dragengine.Gui.ShoutConsole Dragengine.Gui.TextWidget Dragengine.Gui.WorldRenderer

Classes

class  RepeatKeyEventTimer
 Repeat key event timer. More...
 

Public Member Functions

void addDragListener (DragListener listener)
 
void addFocusListener (FocusListener listener)
 Add focus listener. More...
 
void addGamepadListener (GamepadListener listener)
 Add gamepad listener. More...
 
void addKeyListener (KeyListener listener)
 
void addMouseListener (MouseListener listener)
 
void addStateChangeListener (StateChangeListener listener)
 Add state change listener. More...
 
void addWidgetListener (WidgetListener listener)
 Add widget listener. More...
 
bool canGrabFullFocus ()
 
void captureMouse ()
 
void design ()
 Design widget using WidgetDesigner. More...
 
void dispose ()
 
Widget findFocusableWidget ()
 
Widget findLastFocusableWidget ()
 
CanvasCreator getBackgroundCanvasCreator ()
 Background canvas creator or null to use background color. More...
 
Border getBorder ()
 
BorderSize getBorderSize ()
 
RectArea getBoundary ()
 Rectangulare boundary of the widget. More...
 
RectArea getBoundaryWithBorder ()
 Rectangulare boundary of the widget including border. More...
 
bool getCanFocus ()
 
CanvasView getCanvasBackground ()
 
CanvasView getCanvasContent ()
 
CanvasView getCanvasWidget ()
 
ColorMatrix getColorTransformation ()
 Color transformation. More...
 
WidgetDesigner getDesigner ()
 Designer. More...
 
String getDesignerSelector ()
 Designer selector. More...
 
Desktop getDesktop ()
 
Point getDesktopPosition ()
 Widget position in desktop coordinates. More...
 
bool getEnabled ()
 
MousePointerFactory getFirstMousePointer ()
 First assigned mouse pointer. More...
 
Font getFont ()
 
bool getHasFocus ()
 
int getHeight ()
 Height of widget. More...
 
RangeModel getHorizontalRangeModel ()
 Horizontal range model for viewports to synchronize the horizontal scrollbar. More...
 
Point getMinimumSize ()
 
Point getMinimumSizeForHeight (int height)
 Minimum size of widget using reference widget height and variable width. More...
 
Point getMinimumSizeForWidth (int width)
 Minimum size of widget using reference widget width and variable height. More...
 
Point getMinimumSizeWithBorder ()
 
Point getMinimumSizeWithBorderForHeight (int height)
 Minimum size of widget with border using reference height. More...
 
Point getMinimumSizeWithBorderForWidth (int width)
 Minimum size of widget with border for reference width. More...
 
MousePointerFactory getMousePointer ()
 Mouse pointer to use. More...
 
BorderSize getPadding ()
 Padding. More...
 
Container getParent ()
 
Point getPosition ()
 Position of the widget. More...
 
bool getProtectBackgroundCanvasCreator ()
 Protect custom set background canvas creator. More...
 
bool getProtectBorder ()
 Protect custom set border. More...
 
bool getProtectFont ()
 Protect custom set font. More...
 
bool getProtectMinimumSize ()
 Protect custom set minimumsize. More...
 
bool getProtectMousePointer ()
 Protect custom set mouse pointer. More...
 
bool getProtectPadding ()
 Protect custom set padding. More...
 
bool getProtectTextColor ()
 Protect custom set text color. More...
 
Point getRelativePosition (Container parent)
 Widget position in parent widget coordinates. More...
 
Point getScreenPosition ()
 Widget position in screen coordinates. More...
 
RectArea getScreenRectArea ()
 
Point getSetMinimumSize ()
 
Point getSize ()
 Size of the widget. More...
 
Color getTextColor ()
 Text color. More...
 
Object getToolTip ()
 Tooltip or null. More...
 
float getTotalTransparency ()
 
TexMatrix2 getTransformation ()
 
float getTransparency ()
 
RangeModel getVerticalRangeModel ()
 Vertical range model for viewports to synchronize the vertical scrollbar. More...
 
bool getVisible ()
 
int getWidth ()
 Width of widget. More...
 
Window getWindow ()
 
Point getWindowPosition ()
 Widget position in window coordinates. More...
 
int getX ()
 X position of widget. More...
 
int getY ()
 Y position of widget. More...
 
bool hasParent (Container container)
 
bool isDesignerSet ()
 Custom designer is set. More...
 
bool isFullEnabled ()
 Widget and all parent widgets are enabled. More...
 
bool isMinimumSizeSet ()
 
bool isMouseInside ()
 Mouse is hovering over this widget. More...
 
bool isTransformationSet ()
 
void layoutParent ()
 
Widget new ()
 Create widget. More...
 
Widget new (int x, int y, int width, int height)
 Create widget with initial location and size. More...
 
Widget new (Point position, Point size)
 Create widget with initial location and size. More...
 
Widget nextFocusWidget ()
 Find next widget in the focus cycle that can grab the focus. More...
 
void notifyBorderParametersChanged ()
 
void onDesignerChanged ()
 Designer changed. More...
 
void onDesignerSelectorChanged ()
 Designer selector changed. More...
 
void onDispose (WidgetEvent event)
 Window is disposing. More...
 
void onFocusLost (FocusEvent event)
 Widget lost focus. More...
 
void onFocusReceived (FocusEvent event)
 Widget received focus. More...
 
void onFrameUpdate (float elapsed)
 Do frame update. More...
 
void onGuiThemeChanged ()
 
void onHidden (WidgetEvent event)
 Widget has been hidden. More...
 
void onPaddingChanged ()
 Padding changed. More...
 
void onParentStateChanged ()
 Parent state changed. More...
 
void onParentStateChanged (bool force)
 Parent state changed. More...
 
void onReposition (WidgetEvent event)
 Position changed. More...
 
void onResize (WidgetEvent event)
 Size changed. More...
 
void onSetFont ()
 
void onSetTextColor ()
 Text color changed. More...
 
void onShown (WidgetEvent event)
 Widget has been shown. More...
 
void onStateChanged (StateChangeEvent event)
 State changed. More...
 
void popdownVirtualKeyboard ()
 Popdown virtual keyboard if Desktop has one assigned. More...
 
void popupVirtualKeyboard ()
 Popup virtual keyboard if Desktop has one assigned. More...
 
Widget prevFocusWidget ()
 Find previous widget in the focus cycle that can grab the focus. More...
 
void processEvent (Event event)
 
void releaseMouse ()
 
void removeDragListener (DragListener listener)
 
void removeFocusListener (FocusListener listener)
 Remove focus listener. More...
 
void removeGamepadListener (GamepadListener listener)
 Remove gamepad listener. More...
 
void removeKeyListener (KeyListener listener)
 
void removeMouseListener (MouseListener listener)
 
void removeStateChangeListener (StateChangeListener listener)
 Remove state change listener. More...
 
void removeWidgetListener (WidgetListener listener)
 Remove widget listener. More...
 
void requestGrabFocus (Widget widget)
 
void safeDispose ()
 Safely dispose of widget. More...
 
void sendEvent (Event event)
 
void sendEventToListeners (Event event, bool sendToParent)
 Send event to all appropriate listeners for events of its kind. More...
 
void setBackgroundCanvasCreator (CanvasCreator creator)
 Set background canvas creator or null to use background color. More...
 
void setBorder (Border border)
 
void setCanFocus (bool canFocus)
 
void setColorTransformation (ColorMatrix transformation)
 Set color transformation. More...
 
void setDesigner (WidgetDesigner designer)
 Set designer. More...
 
void setDesignerSelector (String selector)
 Set designer selector. More...
 
void setEnabled (bool enabled)
 
void setFont (Font font)
 
void setHasFocus (bool hasFocus)
 
void setHeight (int height)
 Set height of widget. More...
 
void setMinimumSize (Point size)
 
void setMousePointer (MousePointerFactory mousePointer)
 Set mouse pointer to use. More...
 
void setPadding (BorderSize padding)
 Set padding. More...
 
void setParent (Container parent)
 
void setPosition (Point position)
 Set position of widget. More...
 
void setProtectBackgroundCanvasCreator (bool protect)
 Set protect custom set background canvas creator. More...
 
void setProtectBorder (bool protect)
 Set protect custom set border. More...
 
void setProtectFont (bool protect)
 Set protect custom set font. More...
 
void setProtectMinimumSize (bool protect)
 Set protect custom set minimumsize. More...
 
void setProtectMousePointer (bool protect)
 Set protect custom set mouse pointer. More...
 
void setProtectPadding (bool protect)
 Set protect custom set padding. More...
 
void setProtectTextColor (bool protect)
 Set protect custom set text color. More...
 
void setSize (Point size)
 Set size of widget. More...
 
void setTextColor (Color color)
 Set text color. More...
 
void setToolTip (Object toolTip)
 Set tooltip or null. More...
 
void setTransformation (TexMatrix2 transformation)
 
void setTransparency (float transparency)
 
void setVisible (bool visible)
 
void setWidth (int width)
 Set width of widget. More...
 
void setX (int x)
 Set X position of widget. More...
 
void setY (int y)
 Set Y Position of widget. More...
 
void startFrameUpdater ()
 Start frame updater if not running. More...
 
void stopFrameUpdater ()
 Stop frame updater if running. More...
 
void stopRepeatEventTimer ()
 

Protected Member Functions

WidgetDesigner getDesignerFromTheme ()
 Get designer from gui theme. More...
 
void updateCanvasBackground ()
 Update background canvas content. More...
 
void updateCanvasGeometry ()
 Update canvas position and size. More...
 

Detailed Description

Widget base class. Represents a graphical screen component.

Member Function Documentation

◆ addDragListener()

void Dragengine.Gui.Widget.addDragListener ( DragListener  listener)

Add drag listener.

◆ addFocusListener()

void Dragengine.Gui.Widget.addFocusListener ( FocusListener  listener)

Add focus listener.

◆ addGamepadListener()

void Dragengine.Gui.Widget.addGamepadListener ( GamepadListener  listener)

Add gamepad listener.

◆ addKeyListener()

void Dragengine.Gui.Widget.addKeyListener ( KeyListener  listener)

Add key listener.

◆ addMouseListener()

void Dragengine.Gui.Widget.addMouseListener ( MouseListener  listener)

Add mouse listener.

◆ addStateChangeListener()

void Dragengine.Gui.Widget.addStateChangeListener ( StateChangeListener  listener)

Add state change listener.

◆ addWidgetListener()

void Dragengine.Gui.Widget.addWidgetListener ( WidgetListener  listener)

Add widget listener.

◆ canGrabFullFocus()

bool Dragengine.Gui.Widget.canGrabFullFocus ( )

Determines if a widget can grab the full focus. Full focus means that all parents above the widget are visible and enabled

◆ captureMouse()

void Dragengine.Gui.Widget.captureMouse ( )

Captures the mouse if not already captured by another widget.

◆ design()

void Dragengine.Gui.Widget.design ( )

Design widget using WidgetDesigner.

◆ dispose()

◆ findFocusableWidget()

Widget Dragengine.Gui.Widget.findFocusableWidget ( )

Find first widget that can grab the focus or null if none exists.

Reimplemented in Dragengine.Gui.ListBox.

◆ findLastFocusableWidget()

Widget Dragengine.Gui.Widget.findLastFocusableWidget ( )

Find last widget that can grab the focus or null if none exists.

Reimplemented in Dragengine.Gui.ListBox.

◆ getBackgroundCanvasCreator()

CanvasCreator Dragengine.Gui.Widget.getBackgroundCanvasCreator ( )

Background canvas creator or null to use background color.

◆ getBorder()

Border Dragengine.Gui.Widget.getBorder ( )

Retrieves the border or null if not set.

◆ getBorderSize()

BorderSize Dragengine.Gui.Widget.getBorderSize ( )

Get border size. If no border is set an empty border size is returned.

◆ getBoundary()

RectArea Dragengine.Gui.Widget.getBoundary ( )

Rectangulare boundary of the widget.

◆ getBoundaryWithBorder()

RectArea Dragengine.Gui.Widget.getBoundaryWithBorder ( )

Rectangulare boundary of the widget including border.

◆ getCanFocus()

bool Dragengine.Gui.Widget.getCanFocus ( )

Retrieve if widget can get the focus.

◆ getCanvasBackground()

CanvasView Dragengine.Gui.Widget.getCanvasBackground ( )

Canvas view for the widget background.

◆ getCanvasContent()

CanvasView Dragengine.Gui.Widget.getCanvasContent ( )

Canvas view for the widget content.

◆ getCanvasWidget()

CanvasView Dragengine.Gui.Widget.getCanvasWidget ( )

Canvas view for the entire widget.

◆ getColorTransformation()

ColorMatrix Dragengine.Gui.Widget.getColorTransformation ( )

Color transformation.

◆ getDesigner()

WidgetDesigner Dragengine.Gui.Widget.getDesigner ( )

Designer.

◆ getDesignerFromTheme()

WidgetDesigner Dragengine.Gui.Widget.getDesignerFromTheme ( )
protected

Get designer from gui theme.

Reimplemented in Dragengine.Gui.SpinButton, and Dragengine.Gui.ScrollBar.

◆ getDesignerSelector()

String Dragengine.Gui.Widget.getDesignerSelector ( )

Designer selector.

Selects designer from gui theme. Selector composes of alphanumeric identifier. A chain of identifiers can be specified separated by periods. If a chain is defined the full chain is first checked to find the designer. If not found the right most identifier is stripped and the remaining chain checked for a match. The first match is used. This allows to add optional quallifier identifers at the end of the chain for future use while still matching broader designers in the mean time.

If null no designer is used from gui theme. Otherwise use class name (for example Widget) with optional qualifiers appended if necessary.

◆ getDesktop()

Desktop Dragengine.Gui.Widget.getDesktop ( )

Retrieves the desktop or null if this widget is not part of a desktop. The default implementation forwards the request to the parent with the Desktop or a subclass thereof intercepting.

Reimplemented in Dragengine.Gui.Desktop.

◆ getDesktopPosition()

Point Dragengine.Gui.Widget.getDesktopPosition ( )

Widget position in desktop coordinates.

Reimplemented in Dragengine.Gui.Desktop.

◆ getEnabled()

bool Dragengine.Gui.Widget.getEnabled ( )

Retrieve if widget is enabled.

◆ getFirstMousePointer()

MousePointerFactory Dragengine.Gui.Widget.getFirstMousePointer ( )

First assigned mouse pointer.

If the Widget has a mouse pointer this one is returned otherwise the one of the parent. Can be null if no widget up to top most one has an assigned mouse pointer.

◆ getFont()

Font Dragengine.Gui.Widget.getFont ( )

Retrieve font of widget.

◆ getHasFocus()

bool Dragengine.Gui.Widget.getHasFocus ( )

Retrieve if widget has the focus.

◆ getHeight()

int Dragengine.Gui.Widget.getHeight ( )

Height of widget.

◆ getHorizontalRangeModel()

RangeModel Dragengine.Gui.Widget.getHorizontalRangeModel ( )

Horizontal range model for viewports to synchronize the horizontal scrollbar.

If this widget has no reasonable horizontal range model it should return null.

Reimplemented in Dragengine.Gui.Viewport, Dragengine.Gui.TextArea, and Dragengine.Gui.ListBox.

◆ getMinimumSize()

◆ getMinimumSizeForHeight()

Point Dragengine.Gui.Widget.getMinimumSizeForHeight ( int  height)

Minimum size of widget using reference widget height and variable width.

Default implementation uses getMinimumSize().

Reimplemented in Dragengine.Gui.ListBox, and Dragengine.Gui.Container.

◆ getMinimumSizeForWidth()

Point Dragengine.Gui.Widget.getMinimumSizeForWidth ( int  width)

Minimum size of widget using reference widget width and variable height.

Default implementation uses getMinimumSize().

Reimplemented in Dragengine.Gui.TextArea, Dragengine.Gui.ListBox, Dragengine.Gui.Label, Dragengine.Gui.DisplayStyledText, and Dragengine.Gui.Container.

◆ getMinimumSizeWithBorder()

Point Dragengine.Gui.Widget.getMinimumSizeWithBorder ( )

Retrieve the minimal size of widget including the border size if one is set.

◆ getMinimumSizeWithBorderForHeight()

Point Dragengine.Gui.Widget.getMinimumSizeWithBorderForHeight ( int  height)

Minimum size of widget with border using reference height.

Convenience method for Layout implementations to get the minimum size of a widget using getMinimumSizeForHeight() including border. Calls getMinimumSizeForHeight() with the border height (if present) subtracted from height. The border size is then added to the result.

◆ getMinimumSizeWithBorderForWidth()

Point Dragengine.Gui.Widget.getMinimumSizeWithBorderForWidth ( int  width)

Minimum size of widget with border for reference width.

Convenience method for Layout implementations to get the minimum size of a widget using getMinimumSizeForWidth() including border. Calls getMinimumSizeForWidth() with the border width (if present) subtracted from width. The border size is then added to the result.

◆ getMousePointer()

MousePointerFactory Dragengine.Gui.Widget.getMousePointer ( )

Mouse pointer to use.

If widget has no mouse pointer the parent mouse pointer is used.

◆ getPadding()

BorderSize Dragengine.Gui.Widget.getPadding ( )

Padding.

◆ getParent()

Container Dragengine.Gui.Widget.getParent ( )

Retrieves the parent of widget or null if there is none.

◆ getPosition()

Point Dragengine.Gui.Widget.getPosition ( )

Position of the widget.

◆ getProtectBackgroundCanvasCreator()

bool Dragengine.Gui.Widget.getProtectBackgroundCanvasCreator ( )

Protect custom set background canvas creator.

◆ getProtectBorder()

bool Dragengine.Gui.Widget.getProtectBorder ( )

Protect custom set border.

◆ getProtectFont()

bool Dragengine.Gui.Widget.getProtectFont ( )

Protect custom set font.

◆ getProtectMinimumSize()

bool Dragengine.Gui.Widget.getProtectMinimumSize ( )

Protect custom set minimumsize.

◆ getProtectMousePointer()

bool Dragengine.Gui.Widget.getProtectMousePointer ( )

Protect custom set mouse pointer.

◆ getProtectPadding()

bool Dragengine.Gui.Widget.getProtectPadding ( )

Protect custom set padding.

◆ getProtectTextColor()

bool Dragengine.Gui.Widget.getProtectTextColor ( )

Protect custom set text color.

◆ getRelativePosition()

Point Dragengine.Gui.Widget.getRelativePosition ( Container  parent)

Widget position in parent widget coordinates.

◆ getScreenPosition()

Point Dragengine.Gui.Widget.getScreenPosition ( )

Widget position in screen coordinates.

◆ getScreenRectArea()

RectArea Dragengine.Gui.Widget.getScreenRectArea ( )

Retrieves the rect area on the screen of the widget.

◆ getSetMinimumSize()

Point Dragengine.Gui.Widget.getSetMinimumSize ( )

Retrieve the set minimal size of widget or null.

◆ getSize()

Point Dragengine.Gui.Widget.getSize ( )

Size of the widget.

◆ getTextColor()

Color Dragengine.Gui.Widget.getTextColor ( )

Text color.

◆ getToolTip()

Object Dragengine.Gui.Widget.getToolTip ( )

Tooltip or null.

Version
1.7

Object is typically of type String or StyledTextDocument. Other object types are possible if the tool tip providing object supports it.

◆ getTotalTransparency()

float Dragengine.Gui.Widget.getTotalTransparency ( )

Retrieve total transparency of widget. This is the transparency of this widget multiplied by the total transparency of the parent.

◆ getTransformation()

TexMatrix2 Dragengine.Gui.Widget.getTransformation ( )

Transformation or null if not set.

◆ getTransparency()

float Dragengine.Gui.Widget.getTransparency ( )

Retrieve transparency of widget.

◆ getVerticalRangeModel()

RangeModel Dragengine.Gui.Widget.getVerticalRangeModel ( )

Vertical range model for viewports to synchronize the vertical scrollbar.

If this widget has no reasonable vertical range model it should return null.

Reimplemented in Dragengine.Gui.Viewport, Dragengine.Gui.TextArea, and Dragengine.Gui.ListBox.

◆ getVisible()

bool Dragengine.Gui.Widget.getVisible ( )

Retrieve if widget is visible.

◆ getWidth()

int Dragengine.Gui.Widget.getWidth ( )

Width of widget.

◆ getWindow()

Window Dragengine.Gui.Widget.getWindow ( )

Retrieves the window or null if this widget is not part of a window. The default implementation forwards the request to the parent with the Window or a subclass thereof intercepting.

Reimplemented in Dragengine.Gui.Window.

◆ getWindowPosition()

Point Dragengine.Gui.Widget.getWindowPosition ( )

Widget position in window coordinates.

Reimplemented in Dragengine.Gui.Window.

◆ getX()

int Dragengine.Gui.Widget.getX ( )

X position of widget.

◆ getY()

int Dragengine.Gui.Widget.getY ( )

Y position of widget.

◆ hasParent()

bool Dragengine.Gui.Widget.hasParent ( Container  container)

Determines if this widget is parent directly or indirectly to a given container.

◆ isDesignerSet()

bool Dragengine.Gui.Widget.isDesignerSet ( )

Custom designer is set.

◆ isFullEnabled()

bool Dragengine.Gui.Widget.isFullEnabled ( )

Widget and all parent widgets are enabled.

◆ isMinimumSizeSet()

bool Dragengine.Gui.Widget.isMinimumSizeSet ( )

Determines if the minimal size is set explicitly.

◆ isMouseInside()

bool Dragengine.Gui.Widget.isMouseInside ( )

Mouse is hovering over this widget.

Tests if the hover widget of the parent desktop is this widget.

Reimplemented in Dragengine.Gui.Container.

◆ isTransformationSet()

bool Dragengine.Gui.Widget.isTransformationSet ( )

Transformation is set.

◆ layoutParent()

void Dragengine.Gui.Widget.layoutParent ( )

Layout parent if existing. Call if a change potentially alters the size requirements.

Reimplemented in Dragengine.Gui.Viewport, Dragengine.Gui.Desktop, and Dragengine.Gui.Container.

◆ new() [1/3]

◆ new() [2/3]

Widget Dragengine.Gui.Widget.new ( int  x,
int  y,
int  width,
int  height 
)

Create widget with initial location and size.

Width and height are clamped to 0 at minimum. Negative sizes can not be used.

Reimplemented in Dragengine.Gui.WorldRenderer, Dragengine.Gui.WindowModal, Dragengine.Gui.WindowDialog, Dragengine.Gui.WindowConsole, Dragengine.Gui.Window, Dragengine.Gui.WindowSettings, Dragengine.Gui.Panel, Dragengine.Gui.Desktop, and Dragengine.Gui.Container.

◆ new() [3/3]

Widget Dragengine.Gui.Widget.new ( Point  position,
Point  size 
)

Create widget with initial location and size.

Width and height are clamped to 0 at minimum. Negative sizes can not be used.

Reimplemented in Dragengine.Gui.Window, and Dragengine.Gui.Container.

◆ nextFocusWidget()

Widget Dragengine.Gui.Widget.nextFocusWidget ( )

Find next widget in the focus cycle that can grab the focus.

◆ notifyBorderParametersChanged()

void Dragengine.Gui.Widget.notifyBorderParametersChanged ( )

Notify border about changes to the widget parameters potentially affecing the border.

◆ onDesignerChanged()

void Dragengine.Gui.Widget.onDesignerChanged ( )

◆ onDesignerSelectorChanged()

◆ onDispose()

void Dragengine.Gui.Widget.onDispose ( WidgetEvent  event)

Window is disposing.

Sends event to listeners.

◆ onFocusLost()

void Dragengine.Gui.Widget.onFocusLost ( FocusEvent  event)

Widget lost focus.

Sends event to listeners.

Reimplemented in Dragengine.Gui.TextField, Dragengine.Gui.TextArea, Dragengine.Gui.ComboBox, and Dragengine.Gui.Button.

◆ onFocusReceived()

void Dragengine.Gui.Widget.onFocusReceived ( FocusEvent  event)

Widget received focus.

Sends event to listeners.

Reimplemented in Dragengine.Gui.TextField, Dragengine.Gui.TextArea, Dragengine.Gui.ComboBox, and Dragengine.Gui.Button.

◆ onFrameUpdate()

void Dragengine.Gui.Widget.onFrameUpdate ( float  elapsed)

◆ onGuiThemeChanged()

void Dragengine.Gui.Widget.onGuiThemeChanged ( )

Notification that the gui theme changed. Attention! You have to super-call this method since it is used a bit differently than the other callback methods.

Reimplemented in Dragengine.Gui.WindowConsole, Dragengine.Gui.Window, Dragengine.Gui.TextArea, Dragengine.Gui.SpinButton, Dragengine.Gui.ScrollBar, Dragengine.Gui.ProgressBar, Dragengine.Gui.ListBox, Dragengine.Gui.Label, Dragengine.Gui.Container, and Dragengine.Gui.ComboBox.

◆ onHidden()

void Dragengine.Gui.Widget.onHidden ( WidgetEvent  event)

Widget has been hidden.

Sends event to listeners.

◆ onPaddingChanged()

◆ onParentStateChanged() [1/2]

void Dragengine.Gui.Widget.onParentStateChanged ( )

Parent state changed.

Called by some certain widgets supporting childs widgets able to track their state.

The default implementation triggers a design() call.

Reimplemented in Dragengine.Gui.Container.

◆ onParentStateChanged() [2/2]

void Dragengine.Gui.Widget.onParentStateChanged ( bool  force)

Parent state changed.

Version
1.7

Calls onParentStateChanged(bool) on all child widgets. Supports forcing update on the entire children chain.

Reimplemented in Dragengine.Gui.Container.

◆ onReposition()

void Dragengine.Gui.Widget.onReposition ( WidgetEvent  event)

Position changed.

Sends event to listeners.

◆ onResize()

◆ onSetFont()

void Dragengine.Gui.Widget.onSetFont ( )

Notification that the widget font changed.

Reimplemented in Dragengine.Gui.TextField, Dragengine.Gui.TextArea, Dragengine.Gui.ProgressBar, and Dragengine.Gui.Label.

◆ onSetTextColor()

void Dragengine.Gui.Widget.onSetTextColor ( )

◆ onShown()

void Dragengine.Gui.Widget.onShown ( WidgetEvent  event)

Widget has been shown.

Sends event to listeners.

Reimplemented in Dragengine.Gui.WindowConsole, and Dragengine.Gui.Window.

◆ onStateChanged()

◆ popdownVirtualKeyboard()

void Dragengine.Gui.Widget.popdownVirtualKeyboard ( )

Popdown virtual keyboard if Desktop has one assigned.

Version
1.7

◆ popupVirtualKeyboard()

void Dragengine.Gui.Widget.popupVirtualKeyboard ( )

Popup virtual keyboard if Desktop has one assigned.

Version
1.7

◆ prevFocusWidget()

Widget Dragengine.Gui.Widget.prevFocusWidget ( )

Find previous widget in the focus cycle that can grab the focus.

◆ processEvent()

void Dragengine.Gui.Widget.processEvent ( Event  event)

Process an event. This allows the widget to be used as the root widget in a game. Using this function you can implement your own desktop management routines or use no windows at all. An event is send to the root widget using this function. No other widget has to get an event sent through this function. Use the sendEvent function to further dispatch events through all widgets.
The default implementation is to send the event to yourself. Overwrite this behaviour to implement Desktop Widgets.

Reimplemented in Dragengine.Gui.GameRoot, and Dragengine.Gui.Desktop.

◆ releaseMouse()

void Dragengine.Gui.Widget.releaseMouse ( )

Release mouse capture.

◆ removeDragListener()

void Dragengine.Gui.Widget.removeDragListener ( DragListener  listener)

Remove a drag listener.

◆ removeFocusListener()

void Dragengine.Gui.Widget.removeFocusListener ( FocusListener  listener)

Remove focus listener.

◆ removeGamepadListener()

void Dragengine.Gui.Widget.removeGamepadListener ( GamepadListener  listener)

Remove gamepad listener.

◆ removeKeyListener()

void Dragengine.Gui.Widget.removeKeyListener ( KeyListener  listener)

Remove key listener.

◆ removeMouseListener()

void Dragengine.Gui.Widget.removeMouseListener ( MouseListener  listener)

Remove mouse listener.

◆ removeStateChangeListener()

void Dragengine.Gui.Widget.removeStateChangeListener ( StateChangeListener  listener)

Remove state change listener.

◆ removeWidgetListener()

void Dragengine.Gui.Widget.removeWidgetListener ( WidgetListener  listener)

Remove widget listener.

◆ requestGrabFocus()

void Dragengine.Gui.Widget.requestGrabFocus ( Widget  widget)

Request to focus the specified widget.

Reimplemented in Dragengine.Gui.Window, Dragengine.Gui.Desktop, and Dragengine.Gui.ComboBox.

◆ safeDispose()

void Dragengine.Gui.Widget.safeDispose ( )

Safely dispose of widget.

If widget has parent removes the widget from the parent before calling dispose().

◆ sendEvent()

void Dragengine.Gui.Widget.sendEvent ( Event  event)

Sends an event to the widget. The Widget will check for focus grab and other situations and sends the event to all registered listeners.

Reimplemented in Dragengine.Gui.WindowPopup.

◆ sendEventToListeners()

void Dragengine.Gui.Widget.sendEventToListeners ( Event  event,
bool  sendToParent 
)

Send event to all appropriate listeners for events of its kind.

If there are no listeners the event is send to the parent if sendToParent is true.

Reimplemented in Dragengine.Gui.Window, and Dragengine.Gui.Desktop.

◆ setBackgroundCanvasCreator()

void Dragengine.Gui.Widget.setBackgroundCanvasCreator ( CanvasCreator  creator)

Set background canvas creator or null to use background color.

◆ setBorder()

void Dragengine.Gui.Widget.setBorder ( Border  border)

Sets the border or null if not set.

◆ setCanFocus()

void Dragengine.Gui.Widget.setCanFocus ( bool  canFocus)

Sets if widget can get the focus.

◆ setColorTransformation()

void Dragengine.Gui.Widget.setColorTransformation ( ColorMatrix  transformation)

Set color transformation.

◆ setDesigner()

void Dragengine.Gui.Widget.setDesigner ( WidgetDesigner  designer)

Set designer.

◆ setDesignerSelector()

void Dragengine.Gui.Widget.setDesignerSelector ( String  selector)

Set designer selector.

Selects designer from gui theme. Selector composes of alphanumeric identifier. A chain of identifiers can be specified separated by periods. If a chain is defined the full chain is first checked to find the designer. If not found the right most identifier is stripped and the remaining chain checked for a match. The first match is used. This allows to add optional quallifier identifers at the end of the chain for future use while still matching broader designers in the mean time.

If null no designer is used from gui theme. Otherwise use class name (for example Widget) with optional qualifiers appended if necessary.

Reimplemented in Dragengine.Gui.DisplayInputSource.

◆ setEnabled()

void Dragengine.Gui.Widget.setEnabled ( bool  enabled)

Sets if widget is enabled.

Reimplemented in Dragengine.Gui.Container.

◆ setFont()

void Dragengine.Gui.Widget.setFont ( Font  font)

Sets new font of widget or null to use the gui theme one.

Reimplemented in Dragengine.Gui.BgButton.

◆ setHasFocus()

void Dragengine.Gui.Widget.setHasFocus ( bool  hasFocus)

Sets if widget has the focus.

◆ setHeight()

void Dragengine.Gui.Widget.setHeight ( int  height)

Set height of widget.

◆ setMinimumSize()

void Dragengine.Gui.Widget.setMinimumSize ( Point  size)

Sets the minimum size of widget or null if there is no limit.

◆ setMousePointer()

void Dragengine.Gui.Widget.setMousePointer ( MousePointerFactory  mousePointer)

Set mouse pointer to use.

If widget has no mouse pointer the parent mouse pointer is used.

Reimplemented in Dragengine.Gui.Container.

◆ setPadding()

void Dragengine.Gui.Widget.setPadding ( BorderSize  padding)

Set padding.

◆ setParent()

void Dragengine.Gui.Widget.setParent ( Container  parent)

Sets the parent of widget. Use this function with caution. It should only be used by widgets which can contain other widgets to set their parent widget.

◆ setPosition()

void Dragengine.Gui.Widget.setPosition ( Point  position)

Set position of widget.

◆ setProtectBackgroundCanvasCreator()

void Dragengine.Gui.Widget.setProtectBackgroundCanvasCreator ( bool  protect)

Set protect custom set background canvas creator.

◆ setProtectBorder()

void Dragengine.Gui.Widget.setProtectBorder ( bool  protect)

Set protect custom set border.

◆ setProtectFont()

void Dragengine.Gui.Widget.setProtectFont ( bool  protect)

Set protect custom set font.

◆ setProtectMinimumSize()

void Dragengine.Gui.Widget.setProtectMinimumSize ( bool  protect)

Set protect custom set minimumsize.

◆ setProtectMousePointer()

void Dragengine.Gui.Widget.setProtectMousePointer ( bool  protect)

Set protect custom set mouse pointer.

◆ setProtectPadding()

void Dragengine.Gui.Widget.setProtectPadding ( bool  protect)

Set protect custom set padding.

◆ setProtectTextColor()

void Dragengine.Gui.Widget.setProtectTextColor ( bool  protect)

Set protect custom set text color.

◆ setSize()

void Dragengine.Gui.Widget.setSize ( Point  size)

Set size of widget.

◆ setTextColor()

void Dragengine.Gui.Widget.setTextColor ( Color  color)

Set text color.

Reimplemented in Dragengine.Gui.BgButton.

◆ setToolTip()

void Dragengine.Gui.Widget.setToolTip ( Object  toolTip)

Set tooltip or null.

Version
1.7

Object is typically of type String or StyledTextDocument. Other object types are possible if the tool tip providing object supports it.

◆ setTransformation()

void Dragengine.Gui.Widget.setTransformation ( TexMatrix2  transformation)

Set transformation or null if not set.

◆ setTransparency()

void Dragengine.Gui.Widget.setTransparency ( float  transparency)

Sets transparency of widget.

◆ setVisible()

void Dragengine.Gui.Widget.setVisible ( bool  visible)

Sets if widget is visible.

◆ setWidth()

void Dragengine.Gui.Widget.setWidth ( int  width)

Set width of widget.

◆ setX()

void Dragengine.Gui.Widget.setX ( int  x)

Set X position of widget.

◆ setY()

void Dragengine.Gui.Widget.setY ( int  y)

Set Y Position of widget.

◆ startFrameUpdater()

void Dragengine.Gui.Widget.startFrameUpdater ( )

Start frame updater if not running.

Once running the widget receives onFrameUpdate() calls every frame update.

◆ stopFrameUpdater()

void Dragengine.Gui.Widget.stopFrameUpdater ( )

Stop frame updater if running.

◆ stopRepeatEventTimer()

void Dragengine.Gui.Widget.stopRepeatEventTimer ( )

Stops the repeat key event timer.

◆ updateCanvasBackground()

void Dragengine.Gui.Widget.updateCanvasBackground ( )
protected

Update background canvas content.

Sets the content of the background canvas to canvas created by canvas creator if existing. Widget calls this method if background canvas creator or gui theme changed.

◆ updateCanvasGeometry()

void Dragengine.Gui.Widget.updateCanvasGeometry ( )
protected

Update canvas position and size.

The position and size of the background and content canvas are adjusted to match the position and size of the widget in the parent container. Border canvas if existing is adjusted to always fit properly around the canvas background and content.

Warning
This method is also called from the constructor. Subclasses overwriting this method have to be able to run while the subclass constructor has not yet been processed.

Reimplemented in Dragengine.Gui.Window.


The documentation for this class was generated from the following file: