Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
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.MenuItemSeparator Dragengine.Gui.ProgressBar Dragengine.Gui.ProgressGauge 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.
void addGamepadListener (GamepadListener listener)
 Add gamepad listener.
void addKeyListener (KeyListener listener)
void addMouseListener (MouseListener listener)
void addStateChangeListener (StateChangeListener listener)
 Add state change listener.
void addWidgetListener (WidgetListener listener)
 Add widget listener.
bool canGrabFullFocus ()
void captureDirectional ()
 Captures directional navigation if not already captured by another widget.
void collectClosestFocusWidget (ClosestDirectionFocusFinder finder, Point origin)
 Find closest focus widget for directional navigation.
void design ()
 Design widget using WidgetDesigner.
void desktopWarpMouseFocusHere ()
 Warp mouse to focus location on this widget.
void desktopWarpMouseFocusLocation ()
 Warp mouse to focus location on desktop focus widget.
void dispose ()
void ensureVisible ()
 Ensure widget is fully visible on desktop if possible.
void ensureVisible (RectArea boundary)
 Ensure boundary is visible on desktop if possible.
Widget findFocusableWidget ()
Widget findLastFocusableWidget ()
void focusDirectional (int direction)
 Focus widget in direction that can grab the focus.
CanvasCreator getBackgroundCanvasCreator ()
 Background canvas creator or null to use background color.
bool getBlockLayoutParent ()
 Block layoutParent calls.
Border getBorder ()
BorderSize getBorderSize ()
RectArea getBoundary ()
 Rectangular boundary of the widget.
RectArea getBoundaryWithBorder ()
 Rectangular boundary of the widget including border.
bool getCanFocus ()
bool getCanFocusDirectional ()
 Widget can get focus using directional navigation.
CanvasView getCanvasBackground ()
CanvasView getCanvasContent ()
CanvasView getCanvasWidget ()
Clipboard getClipboard ()
 Clipboard or null to use parent clipboard.
ColorMatrix getColorTransformation ()
 Color transformation.
WidgetDesigner getDesigner ()
 Designer.
String getDesignerSelector ()
 Designer selector.
Desktop getDesktop ()
RectArea getDesktopBoundary ()
 Rectangular boundary of widget relative to desktop.
RectArea getDesktopBoundaryWithBorder ()
 Rectangular boundary of widget including border relative to parent.
Point getDesktopPosition ()
 Widget position in desktop coordinates.
Widget getDirectionalCaptureWidget ()
 Widget having captured directional navigation.
bool getEnabled ()
MousePointerFactory getFirstMousePointer ()
 First assigned mouse pointer.
Point getFocusMouseLocation ()
 Focus mouse location in widget coordinates.
Font getFont ()
bool getHasBlockedLayoutParent ()
 layoutParent calls happened during runWhileBlockingLayoutParent.
bool getHasFocus ()
int getHeight ()
 Height of widget.
RangeModel getHorizontalRangeModel ()
 Horizontal range model for viewports to synchronize the horizontal scrollbar.
Widget getHoverWidget ()
 Widget the mouse hovers above or null.
Point getLocalMouseLocation ()
 Parent desktop mouse location in widget coordinates.
Point getMinimumSize ()
Point getMinimumSizeForHeight (int height)
 Minimum size of widget using reference widget height and variable width.
Point getMinimumSizeForWidth (int width)
 Minimum size of widget using reference widget width and variable height.
Point getMinimumSizeWithBorder ()
Point getMinimumSizeWithBorderForHeight (int height)
 Minimum size of widget with border using reference height.
Point getMinimumSizeWithBorderForWidth (int width)
 Minimum size of widget with border for reference width.
Widget getMouseCaptureWidget ()
 Widget having captured the mouse.
MousePointerFactory getMousePointer ()
 Mouse pointer to use.
BorderSize getPadding ()
 Padding.
Container getParent ()
Point getPosition ()
 Position of the widget.
bool getProtectBackgroundCanvasCreator ()
 Protect custom set background canvas creator.
bool getProtectBorder ()
 Protect custom set border.
bool getProtectFont ()
 Protect custom set font.
bool getProtectMinimumSize ()
 Protect custom set minimumsize.
bool getProtectMousePointer ()
 Protect custom set mouse pointer.
bool getProtectPadding ()
 Protect custom set padding.
bool getProtectTextColor ()
 Protect custom set text color.
RectArea getRelativeBoundary (Container parent)
 Rectangular boundary of widget relative to parent.
RectArea getRelativeBoundaryWithBorder (Container parent)
 Rectangular boundary of widget including border relative to parent.
Point getRelativePosition (Container parent)
 Widget position in parent widget coordinates.
Point getScreenPosition ()
 Widget position in screen coordinates.
RectArea getScreenRectArea ()
Point getSetMinimumSize ()
Point getSize ()
 Size of the widget.
Color getTextBorderColor ()
 Text border color.
float getTextBorderThickness ()
 Text border thickness in percentage of the font size or null.
Color getTextColor ()
 Text color.
float getTextDilation ()
 Text dilation in percentage of the font size.
String getTitle ()
 Widget title.
Object getToolTip ()
 Tooltip or null.
float getTotalTransparency ()
TexMatrix2 getTransformation ()
float getTransparency ()
RangeModel getVerticalRangeModel ()
 Vertical range model for viewports to synchronize the vertical scrollbar.
bool getVisible ()
RectArea getVisibleDesktopBoundary ()
 Visible widget boundary in desktop coordinates.
RectArea getVisibleRelativeBoundary (Container parent)
 Visible widget boundary relative to parent coordinate system.
Widget getWidgetAt (Point position)
 Widget at coordinates or null if not found.
int getWidth ()
 Width of widget.
Window getWindow ()
Point getWindowPosition ()
 Widget position in window coordinates.
int getX ()
 X position of widget.
int getY ()
 Y position of widget.
void grabFocus ()
bool hasParent (Container container)
bool isCapturingDirectional ()
 Widget is capturing directional navigation.
bool isCapturingMouse ()
 Widget is capturing mouse.
bool isDesignerSet ()
 Custom designer is set.
bool isFullEnabled ()
 Widget and all parent widgets are enabled.
bool isMinimumSizeSet ()
bool isMouseInside ()
 Mouse is hovering over this widget.
bool isPointInside (Point position)
bool isTransformationSet ()
void layoutParent ()
void layoutParentIfBlocked ()
 Calls layoutParent if getHasBlockedLayoutParent() is true.
Widget new ()
 Create widget.
Widget new (int x, int y, int width, int height)
 Create widget with initial location and size.
Widget new (Point position, Point size)
 Create widget with initial location and size.
Widget nextFocusWidget ()
 Find next widget in the focus cycle that can grab the focus.
void notifyBorderParametersChanged ()
void onDesignerChanged ()
 Designer changed.
void onDesignerSelectorChanged ()
 Designer selector changed.
void onDispose (WidgetEvent event)
 Window is disposing.
void onFocusLost (FocusEvent event)
 Widget lost focus.
void onFocusReceived (FocusEvent event)
 Widget received focus.
void onFrameUpdate (float elapsed)
 Do frame update.
void onGamepadButtonPressed (GamepadEvent event)
 Gamepad button has been pressed.
void onGamepadButtonReleased (GamepadEvent event)
 Gamepad button has been released.
void onGuiThemeChanged ()
void onHidden (WidgetEvent event)
 Widget has been hidden.
void onPaddingChanged ()
 Padding changed.
void onParentStateChanged ()
 Parent state changed.
void onParentStateChanged (bool force)
 Parent state changed.
void onReposition (WidgetEvent event)
 Position changed.
void onResize (WidgetEvent event)
 Size changed.
void onSetFont ()
void onSetTextColor ()
 Text parameters changed.
void onSetTextDilation ()
 Text parameters changed that affect text dilation.
void onShown (WidgetEvent event)
 Widget has been shown.
void onStateChanged (StateChangeEvent event)
 State changed.
void onTranslationChanged ()
 Translation manager or active language pack changed.
void popdownVirtualKeyboard ()
 Popdown virtual keyboard if Desktop has one assigned.
void popdownVirtualKeyboardDirectional ()
 Popdown virtual keyboard if Desktop has one assigned and direction focus widget.
void popupVirtualKeyboard ()
 Popup virtual keyboard if Desktop has one assigned.
Widget prevFocusWidget ()
 Find previous widget in the focus cycle that can grab the focus.
void processEvent (Event event)
 Process an event.
void releaseDirectional ()
 Release directional navigation capture.
void releaseMouse ()
void removeDragListener (DragListener listener)
void removeFocusListener (FocusListener listener)
 Remove focus listener.
void removeGamepadListener (GamepadListener listener)
 Remove gamepad listener.
void removeKeyListener (KeyListener listener)
void removeMouseListener (MouseListener listener)
void removeStateChangeListener (StateChangeListener listener)
 Remove state change listener.
void removeWidgetListener (WidgetListener listener)
 Remove widget listener.
void requestGrabFocus (Widget widget)
void runWhileBlockingLayoutParent (Block ablock)
 Run block while layouting is blocked.
void safeDispose ()
 Safely dispose of widget.
void sendEvent (Event event)
void sendEventToListeners (Event event, bool sendToParent)
 Send event to all appropriate listeners for events of its kind.
void setBackgroundCanvasCreator (CanvasCreator creator)
 Set background canvas creator or null to use background color.
void setBlockLayoutParent (bool blockLayoutParent)
 Set block layoutParent calls.
void setBorder (Border border)
void setCanFocus (bool canFocus)
void setCanFocusDirectional (bool canFocus)
 Set if widget can get focus using directional navigation.
void setClipboard (Clipboard clipboard)
 Set clipboard or null to use parent clipboard.
void setColorTransformation (ColorMatrix transformation)
 Set color transformation.
void setDesigner (WidgetDesigner designer)
 Set designer.
void setDesignerSelector (String selector)
 Set designer selector.
void setEnabled (bool enabled)
void setFont (Font font)
void setHasBlockedLayoutParent (bool hasBlockedLayoutParent)
 Set if layoutParent calls happened during runWhileBlockingLayoutParent.
void setHasFocus (bool hasFocus)
void setHeight (int height)
 Set height of widget.
void setMinimumSize (Point size)
void setMousePointer (MousePointerFactory mousePointer)
 Set mouse pointer to use.
void setPadding (BorderSize padding)
 Set padding.
void setParent (Container parent)
void setPosition (Point position)
 Set position of widget.
void setProtectBackgroundCanvasCreator (bool protect)
 Set protect custom set background canvas creator.
void setProtectBorder (bool protect)
 Set protect custom set border.
void setProtectFont (bool protect)
 Set protect custom set font.
void setProtectMinimumSize (bool protect)
 Set protect custom set minimumsize.
void setProtectMousePointer (bool protect)
 Set protect custom set mouse pointer.
void setProtectPadding (bool protect)
 Set protect custom set padding.
void setProtectTextColor (bool protect)
 Set protect custom set text color.
void setSize (Point size)
 Set size of widget.
void setTextBorderColor (Color color)
 Set text border color.
void setTextBorderThickness (float thickness)
 Set text border thickness in percentage of the font size or null.
void setTextColor (Color color)
 Set text color.
void setTextDilation (float dilation)
 Set text dilation in percentage of the font size.
void setTitle (String title)
 Set widget title.
void setToolTip (Object toolTip)
 Set tooltip or null.
void setTransformation (TexMatrix2 transformation)
void setTransparency (float transparency)
void setVisible (bool visible)
void setWidth (int width)
 Set width of widget.
void setX (int x)
 Set X position of widget.
void setY (int y)
 Set Y Position of widget.
void simulateKeyPress (int keyCode, int keyChar)
 Simulate keyboard press event.
void simulateKeyPressRelease (int keyCode, int keyChar)
 Simulate keyboard press and release event.
void simulateKeyRelease (int keyCode, int keyChar)
 Simulate keyboard release event.
void startFrameUpdater ()
 Start frame updater if not running.
void stopFrameUpdater ()
 Stop frame updater if running.

Public Attributes

CanvasCreator pBackgroundCanvasCreator
bool pBlockLayoutParent
Border pBorder
CanvasView pCanvasWidget
Clipboard pClipboard
WidgetDesigner pDesigner
String pDesignerSelector
Font pFont
FrameUpdater pFrameUpdater
bool pIsDesignerSet
Array pKeyListeners
MousePointerFactory pMousePointer
BorderSize pPadding
Container pParent
Point pPosition
bool pProtectBackgroundCanvasCreator
RepeatKeyEventTimer pRepeatEventTimer
float pTextBorderThickness
Color pTextColor
GuiTheme pTheme
String pThemeSelector
String pTitle
Object pToolTip
TexMatrix2 pTransformation
TranslationManager pTranslationManager
float pTransparency
bool pVisible

Protected Member Functions

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

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)

◆ addGamepadListener()

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

Add gamepad listener.

References setColorTransformation().

◆ addKeyListener()

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

Add key listener.

References getTotalTransparency(), pParent, and pTransparency.

Referenced by Dragengine.Gui.WindowDialog.message().

◆ addMouseListener()

◆ addStateChangeListener()

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

Add state change listener.

Referenced by Dragengine.Gui.ScrollBar.ActionScroll.enableDirectionButtons().

◆ addWidgetListener()

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

Add widget listener.

References pTransformation.

Referenced by Dragengine.Gui.WindowLogo.setTimeout().

◆ 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

◆ captureDirectional()

void Dragengine.Gui.Widget.captureDirectional ( )

Captures directional navigation if not already captured by another widget.

Version
1.29

Referenced by Dragengine.Gui.WindowVirtualKeyboard.createVirtualKeyHide(), Dragengine.Gui.WindowPopup.onGamepadButtonPressed(), and Dragengine.Gui.WindowPopup.sendEvent().

◆ collectClosestFocusWidget()

void Dragengine.Gui.Widget.collectClosestFocusWidget ( ClosestDirectionFocusFinder finder,
Point origin )

Find closest focus widget for directional navigation.

Version
1.29
Parameters
finderFinder to add candidate widgets.
originOrigin in widget coordinates.

Reimplemented in Dragengine.Gui.Container.

◆ design()

void Dragengine.Gui.Widget.design ( )

◆ desktopWarpMouseFocusHere()

void Dragengine.Gui.Widget.desktopWarpMouseFocusHere ( )

◆ desktopWarpMouseFocusLocation()

void Dragengine.Gui.Widget.desktopWarpMouseFocusLocation ( )

Warp mouse to focus location on desktop focus widget.

Version
1.29

Does nothing if desktop is not present.

◆ dispose()

void Dragengine.Gui.Widget.dispose ( )

Disposes of the widget cleaning references.

Warning
This does not remove the widget from the parent container if present. Calling this method while a widget is still inside a parent container will cause exceptions. Use safeDispose() to safely dispose of a widget.

Reimplemented in Dragengine.Gui.BgButton, Dragengine.Gui.Button, Dragengine.Gui.CheckBox, Dragengine.Gui.ComboBox.ComboPopup, Dragengine.Gui.ComboBox, Dragengine.Gui.ConsoleInputField, Dragengine.Gui.DefaultComboBoxEditor, Dragengine.Gui.Desktop, Dragengine.Gui.DisplayFPSRate, Dragengine.Gui.DisplayVideo, Dragengine.Gui.EditModuleParametersPanel, Dragengine.Gui.GameRoot, Dragengine.Gui.Label, Dragengine.Gui.ListBox, Dragengine.Gui.MainMenus.Interactive.IMMTextDisplay, Dragengine.Gui.MainMenus.Interactive.InteractiveMainMenu, Dragengine.Gui.MenuBar, Dragengine.Gui.MenuBarItem, Dragengine.Gui.MenuItem, Dragengine.Gui.MenuItemCommand, Dragengine.Gui.MenuItemSubMenu, Dragengine.Gui.MenuPopup, Dragengine.Gui.ModManagement.MMImageGalleryPreviewImage, Dragengine.Gui.OptionBox, Dragengine.Gui.PanelInteractPrompt, Dragengine.Gui.PanelInteractPromptController, Dragengine.Gui.PanelPlayerChoice, Dragengine.Gui.ProgressBar, Dragengine.Gui.ProgressGauge, Dragengine.Gui.ScrollPanel, Dragengine.Gui.ShoutConsole, Dragengine.Gui.SpinButton, Dragengine.Gui.SubTitleBoxTextBorder, Dragengine.Gui.SwitchPanel, Dragengine.Gui.TextArea, Dragengine.Gui.TextWidget, Dragengine.Gui.ToggleButton, Dragengine.Gui.Window, Dragengine.Gui.WindowCaptureBinding, Dragengine.Gui.WindowConsole, Dragengine.Gui.WindowDialog, Dragengine.Gui.WindowGameWorld, Dragengine.Gui.WindowLoading, Dragengine.Gui.WindowLogo, and Dragengine.Gui.WindowModal.

References new(), pPosition, pTitle, and pVisible.

Referenced by Dragengine.Gui.PanelFPSRates.addFPSWidgets(), Dragengine.Gui.EMPSystem.ParameterValueEditor.applyChanges(), Dragengine.Gui.ModManagement.MMAuthProviderListRenderer.ProviderWidget.createContent(), Dragengine.Gui.ModManagement.MMPanelModInfo.createContent(), Dragengine.Gui.ModManagement.MMPanelModUserAccount.findLoadAvatarImage(), Dragengine.Gui.PanelHud.getBottomLeft(), Dragengine.Gui.PanelHud.getBottomRight(), Dragengine.Gui.Container.getContainerHeight(), Dragengine.Gui.ModManagement.MMTransferListRenderer.ModWidget.getDefaultMod(), Dragengine.Gui.ModManagement.MMModificationListRenderer.ModWidget.getDefaultSize(), Dragengine.Gui.ModManagement.MMTransferListRenderer.ModWidget.getDefaultSize(), Dragengine.Gui.PanelPlayerChoiceEntry.getFocusMouseLocation(), getHasBlockedLayoutParent(), Dragengine.Gui.Viewport.getHorizontalRangeModel(), Dragengine.Gui.EditBindingsPanel.getModelInfo(), Dragengine.Gui.ModManagement.MMImageGallery.new(), Dragengine.Gui.RatingUpDown.ratingChanged(), Dragengine.Gui.EditBindingsPanel.resetChanges(), Dragengine.Gui.ModManagement.MMAuthProviderListRenderer.ProviderWidget.setAllDesignerSelectors(), setBorder(), Dragengine.Gui.ModManagement.MMModificationListRenderer.ModWidget.setDefaultMinimumSize(), Dragengine.Gui.ModManagement.MMTransferListRenderer.ModWidget.setDefaultMinimumSize(), Dragengine.Gui.Container.setMousePointer(), Dragengine.Gui.DisplayInteractPromptEntry.updateBindingWidgets(), Dragengine.Gui.ModManagement.MMPanelModInfo.updateButtonStates(), Dragengine.Gui.Viewport.updateContentPositionY(), Dragengine.Gui.ModManagement.MMPanelModManagement.SearchCategoryCheckBox.ServiceModsSelectionChanged.updateModelTransfers(), Dragengine.Gui.ModManagement.MMModificationListRenderer.ModWidget.updateRenderer(), and Dragengine.Gui.RatingUpDown.updateStates().

◆ ensureVisible() [1/2]

void Dragengine.Gui.Widget.ensureVisible ( )

Ensure widget is fully visible on desktop if possible.

Version
1.29

Reimplemented in Dragengine.Gui.Desktop.

Referenced by getProtectMinimumSize(), Dragengine.Gui.Container.onGuiThemeChanged(), and setProtectMousePointer().

◆ ensureVisible() [2/2]

void Dragengine.Gui.Widget.ensureVisible ( RectArea boundary)

Ensure boundary is visible on desktop if possible.

Version
1.29

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

◆ findFocusableWidget()

Widget Dragengine.Gui.Widget.findFocusableWidget ( )

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

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

◆ findLastFocusableWidget()

Widget Dragengine.Gui.Widget.findLastFocusableWidget ( )

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

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

◆ focusDirectional()

void Dragengine.Gui.Widget.focusDirectional ( int direction)

◆ getBackgroundCanvasCreator()

CanvasCreator Dragengine.Gui.Widget.getBackgroundCanvasCreator ( )

Background canvas creator or null to use background color.

References new().

◆ getBlockLayoutParent()

bool Dragengine.Gui.Widget.getBlockLayoutParent ( )

Block layoutParent calls.

Version
1.23

Used to prevent deadloops and performance problems with layoutParent/doLayout calls. Be careful to disable blocking even in case of exceptions. Also make sure to restore the block layout call in place before changing it by yourself to not break chains.

References pBackgroundCanvasCreator, pKeyListeners, pParent, and pVisible.

Referenced by getVisibleDesktopBoundary().

◆ getBorder()

Border Dragengine.Gui.Widget.getBorder ( )

Retrieves the border or null if not set.

References pParent, and safeDispose().

Referenced by Dragengine.Gui.Window.becomeBackgroundWindow(), and getMinimumSizeWithBorderForWidth().

◆ getBorderSize()

◆ getBoundary()

RectArea Dragengine.Gui.Widget.getBoundary ( )

Rectangular boundary of the widget.

References pParent.

Referenced by Dragengine.Gui.Desktop.sendEventToListeners(), setBackgroundCanvasCreator(), and setTitle().

◆ getBoundaryWithBorder()

RectArea Dragengine.Gui.Widget.getBoundaryWithBorder ( )

Rectangular boundary of the widget including border.

Referenced by setBackgroundCanvasCreator().

◆ getCanFocus()

◆ getCanFocusDirectional()

bool Dragengine.Gui.Widget.getCanFocusDirectional ( )

◆ getCanvasBackground()

CanvasView Dragengine.Gui.Widget.getCanvasBackground ( )

Canvas view for the widget background.

References getCanFocus().

Referenced by Dragengine.Gui.Window.becomeBackgroundWindow().

◆ getCanvasContent()

◆ getCanvasWidget()

◆ getClipboard()

Clipboard Dragengine.Gui.Widget.getClipboard ( )

Clipboard or null to use parent clipboard.

Version
1.11

Referenced by Dragengine.Gui.TextField.measureAdvance().

◆ getColorTransformation()

ColorMatrix Dragengine.Gui.Widget.getColorTransformation ( )

Color transformation.

References setPosition().

Referenced by removeStateChangeListener().

◆ getDesigner()

◆ getDesignerFromTheme()

WidgetDesigner Dragengine.Gui.Widget.getDesignerFromTheme ( )
protected

Get designer from gui theme.

Reimplemented in Dragengine.Gui.SpinButton.

◆ 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.

Reimplemented in Dragengine.Gui.ModManagement.MMTransferListRenderer.ModWidget.

References getDesktopBoundary(), getDesktopBoundaryWithBorder(), new(), and pBorder.

Referenced by Dragengine.Gui.ModManagement.MMModificationListRenderer.ModWidget.getDefaultSize(), Dragengine.Gui.WindowDialog.message(), Dragengine.Gui.PanelPlayerChoiceEntry.onDesignerSelectorChanged(), Dragengine.Gui.ComboBox.onGamepadButtonPressed(), and Dragengine.Gui.SubTitleBoxTextBorder.writeObjectToFile().

◆ getDesktop()

◆ getDesktopBoundary()

RectArea Dragengine.Gui.Widget.getDesktopBoundary ( )

Rectangular boundary of widget relative to desktop.

Version
1.29

References getHasBlockedLayoutParent().

Referenced by getDesignerSelector(), and getProtectFont().

◆ getDesktopBoundaryWithBorder()

RectArea Dragengine.Gui.Widget.getDesktopBoundaryWithBorder ( )

Rectangular boundary of widget including border relative to parent.

References setHasBlockedLayoutParent().

Referenced by getDesignerSelector().

◆ getDesktopPosition()

◆ getDirectionalCaptureWidget()

Widget Dragengine.Gui.Widget.getDirectionalCaptureWidget ( )

Widget having captured directional navigation.

Version
1.29

Reimplemented in Dragengine.Gui.Desktop.

◆ getEnabled()

◆ 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.

◆ getFocusMouseLocation()

Point Dragengine.Gui.Widget.getFocusMouseLocation ( )

Focus mouse location in widget coordinates.

Version
1.29

Used for directional focus change.

Reimplemented in Dragengine.Gui.CheckBox, Dragengine.Gui.OptionBox, Dragengine.Gui.PanelPlayerChoiceEntry, Dragengine.Gui.TextArea, and Dragengine.Gui.TextField.

Referenced by Dragengine.Gui.Button.updateWidgetImage().

◆ getFont()

◆ getHasBlockedLayoutParent()

bool Dragengine.Gui.Widget.getHasBlockedLayoutParent ( )

layoutParent calls happened during runWhileBlockingLayoutParent.

Version
1.23

References dispose(), and pBlockLayoutParent.

Referenced by getDesktopBoundary().

◆ getHasFocus()

bool Dragengine.Gui.Widget.getHasFocus ( )

Retrieve if widget has the focus.

References new(), and pBorder.

Referenced by Dragengine.Gui.Window.becomeBackgroundWindow(), and getCanvasWidget().

◆ getHeight()

◆ 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.ListBox, Dragengine.Gui.TextArea, and Dragengine.Gui.Viewport.

References isFullEnabled(), and pParent.

Referenced by Dragengine.Gui.ScrollPanel.updateScrollBarHiding().

◆ getHoverWidget()

Widget Dragengine.Gui.Widget.getHoverWidget ( )

Widget the mouse hovers above or null.

Version
1.11

Asks parent for hover widget otherwise returns null.

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

References pTransparency.

Referenced by Dragengine.Gui.Container.onGuiThemeChanged().

◆ getLocalMouseLocation()

Point Dragengine.Gui.Widget.getLocalMouseLocation ( )

Parent desktop mouse location in widget coordinates.

Version
1.23

If no parent desktop is found zero point is returned.

References getSize().

Referenced by Dragengine.Gui.WindowVirtualKeyboard.createVirtualKeyHide(), Dragengine.Gui.WindowPopup.onGamepadButtonPressed(), and Dragengine.Gui.Container.onGuiThemeChanged().

◆ 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.Container, and Dragengine.Gui.ListBox.

References pBlockLayoutParent.

Referenced by getWindowPosition(), setCanFocus(), and setMinimumSize().

◆ 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.Container, Dragengine.Gui.DisplayStyledText, Dragengine.Gui.Label, Dragengine.Gui.ListBox, and Dragengine.Gui.TextArea.

References pBlockLayoutParent.

Referenced by getScreenRectArea(), and setMousePointer().

◆ getMinimumSizeWithBorder()

Point Dragengine.Gui.Widget.getMinimumSizeWithBorder ( )

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

Referenced by getToolTip().

◆ 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.

References getCanvasWidget(), and pBorder.

Referenced by setHasFocus().

◆ 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.

References getBorder(), pBorder, and setBorder().

Referenced by getScreenRectArea().

◆ getMouseCaptureWidget()

Widget Dragengine.Gui.Widget.getMouseCaptureWidget ( )

Widget having captured the mouse.

Version
1.29

Reimplemented in Dragengine.Gui.Desktop.

◆ getMousePointer()

MousePointerFactory Dragengine.Gui.Widget.getMousePointer ( )

Mouse pointer to use.

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

References isMinimumSizeSet().

◆ getPadding()

◆ getParent()

◆ getPosition()

◆ getProtectBackgroundCanvasCreator()

bool Dragengine.Gui.Widget.getProtectBackgroundCanvasCreator ( )

Protect custom set background canvas creator.

◆ getProtectBorder()

bool Dragengine.Gui.Widget.getProtectBorder ( )

Protect custom set border.

References getRelativeBoundary(), getVisibleRelativeBoundary(), and pParent.

◆ getProtectFont()

bool Dragengine.Gui.Widget.getProtectFont ( )

Protect custom set font.

References getDesktopBoundary(), and getVisibleDesktopBoundary().

◆ getProtectMinimumSize()

bool Dragengine.Gui.Widget.getProtectMinimumSize ( )

Protect custom set minimumsize.

References ensureVisible().

◆ 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.

◆ getRelativeBoundary()

RectArea Dragengine.Gui.Widget.getRelativeBoundary ( Container parent)

Rectangular boundary of widget relative to parent.

Version
1.29

References layoutParentIfBlocked().

Referenced by getProtectBorder(), and isDesignerSet().

◆ getRelativeBoundaryWithBorder()

RectArea Dragengine.Gui.Widget.getRelativeBoundaryWithBorder ( Container parent)

Rectangular boundary of widget including border relative to parent.

References layoutParent().

Referenced by isDesignerSet().

◆ getRelativePosition()

◆ 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.

References getBorderSize(), getMinimumSizeForWidth(), getMinimumSizeWithBorderForWidth(), and pBorder.

◆ getSetMinimumSize()

Point Dragengine.Gui.Widget.getSetMinimumSize ( )

Retrieve the set minimal size of widget or null.

Referenced by setToolTip().

◆ getSize()

◆ getTextBorderColor()

Color Dragengine.Gui.Widget.getTextBorderColor ( )

◆ getTextBorderThickness()

float Dragengine.Gui.Widget.getTextBorderThickness ( )

Text border thickness in percentage of the font size or null.

Version
1.35

A good starting value for balanced border size is 0.025 (2.5%) or 0.03 (3%).

References getSize(), and getWidth().

Referenced by onGamepadButtonPressed().

◆ getTextColor()

◆ getTextDilation()

float Dragengine.Gui.Widget.getTextDilation ( )

Text dilation in percentage of the font size.

Version
1.35

References new(), and setSize().

◆ getTitle()

String Dragengine.Gui.Widget.getTitle ( )

Widget title.

Version
1.13

For use by borders and decorators to provide a title to a widget.

References setHeight(), setSize(), and setWidth().

◆ 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.

References getMinimumSizeWithBorder(), new(), and pBorder.

◆ 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.

References getPosition(), and pPosition.

Referenced by addKeyListener(), and isMouseInside().

◆ getTransformation()

TexMatrix2 Dragengine.Gui.Widget.getTransformation ( )

Transformation or null if not set.

References getX(), and pPosition.

Referenced by addFocusListener().

◆ getTransparency()

float Dragengine.Gui.Widget.getTransparency ( )

Retrieve transparency of widget.

References pBorder.

Referenced by getCanvasContent().

◆ 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.ListBox, Dragengine.Gui.TextArea, and Dragengine.Gui.Viewport.

References isFullEnabled(), and pParent.

Referenced by Dragengine.Gui.ScrollPanel.updateScrollBarHiding().

◆ getVisible()

◆ getVisibleDesktopBoundary()

RectArea Dragengine.Gui.Widget.getVisibleDesktopBoundary ( )

Visible widget boundary in desktop coordinates.

Version
1.29

Clips getBoundary() to the visible area of all parent containers.

Reimplemented in Dragengine.Gui.Desktop.

References getBlockLayoutParent(), and pBlockLayoutParent.

Referenced by getProtectFont(), and setProtectFont().

◆ getVisibleRelativeBoundary()

RectArea Dragengine.Gui.Widget.getVisibleRelativeBoundary ( Container parent)

Visible widget boundary relative to parent coordinate system.

Version
1.29

Referenced by getProtectBorder(), and setProtectBackgroundCanvasCreator().

◆ getWidgetAt()

Widget Dragengine.Gui.Widget.getWidgetAt ( Point position)

◆ getWidth()

◆ 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.

Referenced by Dragengine.Gui.ModManagement.MMPanelModInfo.createContent(), Dragengine.Gui.Desktop.getTrackDecoration(), Dragengine.Gui.Desktop.sendEventToListeners(), and Dragengine.Gui.ModManagement.MMPanelModManagement.SearchCategoryCheckBox.ServiceModsSelectionChanged.updateModelTransfers().

◆ getWindowPosition()

Point Dragengine.Gui.Widget.getWindowPosition ( )

Widget position in window coordinates.

Reimplemented in Dragengine.Gui.Window.

References getMinimumSize(), and getMinimumSizeForHeight().

◆ getX()

◆ getY()

◆ grabFocus()

◆ hasParent()

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

◆ isCapturingDirectional()

bool Dragengine.Gui.Widget.isCapturingDirectional ( )

Widget is capturing directional navigation.

Version
1.29

Referenced by Dragengine.Gui.ComboBox.setEditor().

◆ isCapturingMouse()

bool Dragengine.Gui.Widget.isCapturingMouse ( )

Widget is capturing mouse.

Version
1.29

Referenced by Dragengine.Gui.TextField.measureAdvance().

◆ isDesignerSet()

bool Dragengine.Gui.Widget.isDesignerSet ( )

◆ isFullEnabled()

bool Dragengine.Gui.Widget.isFullEnabled ( )

◆ isMinimumSizeSet()

◆ 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, and Dragengine.Gui.MenuBarItem.

References getTotalTransparency(), pParent, and pTransparency.

◆ isPointInside()

bool Dragengine.Gui.Widget.isPointInside ( Point position)

◆ isTransformationSet()

bool Dragengine.Gui.Widget.isTransformationSet ( )

Transformation is set.

References getY(), and pPosition.

Referenced by removeWidgetListener().

◆ layoutParent()

◆ layoutParentIfBlocked()

void Dragengine.Gui.Widget.layoutParentIfBlocked ( )

Calls layoutParent if getHasBlockedLayoutParent() is true.

Version
1.23

Call this instead of calling layoutParent() directly to improve performance by not calling layoutParent() if not required. This method is typically called after calling runWhileBlockingLayoutParent().

Referenced by getRelativeBoundary(), and Dragengine.Gui.Button.updateWidgetImage().

◆ new() [1/3]

Widget Dragengine.Gui.Widget.new ( )

Create widget.

Reimplemented in Dragengine.Gui.Button, Dragengine.Gui.CheckBox, Dragengine.Gui.ComboBox, Dragengine.Gui.ConsoleInputField, Dragengine.Gui.Container, Dragengine.Gui.DefaultComboBoxEditor, Dragengine.Gui.DisplayCanvas, Dragengine.Gui.DisplayFPSRate, Dragengine.Gui.DisplayIcon, Dragengine.Gui.DisplayImage, Dragengine.Gui.DisplayInteractPromptEntry, Dragengine.Gui.DisplayRotatingImage, Dragengine.Gui.DisplayStyledText, Dragengine.Gui.DisplayVideo, Dragengine.Gui.EditModuleParametersPanel, Dragengine.Gui.GameRoot, Dragengine.Gui.ListBox, Dragengine.Gui.MenuBar, Dragengine.Gui.MenuItem, Dragengine.Gui.MenuItemSeparator, Dragengine.Gui.MenuPopup, Dragengine.Gui.ModManagement.MMWindowModManagement, Dragengine.Gui.OptionBox, Dragengine.Gui.Panel, Dragengine.Gui.PanelFPSRates, Dragengine.Gui.PanelHud, Dragengine.Gui.PanelInteractPrompt, Dragengine.Gui.PanelInteractPromptController, Dragengine.Gui.PanelPlayerChoice, Dragengine.Gui.ProgressBar, Dragengine.Gui.ProgressGauge, Dragengine.Gui.ScrollPanel, Dragengine.Gui.SpinButton, Dragengine.Gui.SubTitleBox, Dragengine.Gui.SwitchPanel, Dragengine.Gui.TextArea, Dragengine.Gui.TextField, Dragengine.Gui.ToggleButton, Dragengine.Gui.Viewport, Dragengine.Gui.Window, Dragengine.Gui.WindowConsole, Dragengine.Gui.WindowDialog, Dragengine.Gui.WindowGameWorld, Dragengine.Gui.WindowLoading, Dragengine.Gui.WindowLogo, Dragengine.Gui.WindowModal, Dragengine.Gui.WindowOverColor, Dragengine.Gui.WindowPopup, Dragengine.Gui.WindowSubTitle, Dragengine.Gui.WindowToolTip, Dragengine.Gui.WindowVirtualKeyboard, and Dragengine.Gui.WorldRenderer.

References pClipboard, pProtectBackgroundCanvasCreator, and pToolTip.

Referenced by dispose(), getBackgroundCanvasCreator(), getDesigner(), getDesignerSelector(), getHasFocus(), getParent(), getTextDilation(), getToolTip(), hasParent(), isDesignerSet(), new(), safeDispose(), and setDesignerSelector().

◆ 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.Container, Dragengine.Gui.Desktop, Dragengine.Gui.Panel, Dragengine.Gui.Window, Dragengine.Gui.WindowConsole, Dragengine.Gui.WindowDialog, Dragengine.Gui.WindowModal, Dragengine.Gui.WindowSettings, and Dragengine.Gui.WorldRenderer.

References pBlockLayoutParent, and pTranslationManager.

◆ 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.Container, and Dragengine.Gui.Window.

References new().

◆ nextFocusWidget()

Widget Dragengine.Gui.Widget.nextFocusWidget ( )

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

Referenced by Dragengine.Gui.Container.onGuiThemeChanged(), and updateCanvasBackground().

◆ notifyBorderParametersChanged()

void Dragengine.Gui.Widget.notifyBorderParametersChanged ( )

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

References getParent(), and pParent.

Referenced by getTextColor(), and Dragengine.Gui.Window.updateCanvasGeometry().

◆ onDesignerChanged()

void Dragengine.Gui.Widget.onDesignerChanged ( )

◆ onDesignerSelectorChanged()

◆ onDispose()

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

Window is disposing.

Sends event to listeners of this widget only. Method is only called if widget listeners are present.

Referenced by setHasBlockedLayoutParent().

◆ onFocusLost()

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

◆ onFocusReceived()

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

◆ onFrameUpdate()

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

◆ onGamepadButtonPressed()

void Dragengine.Gui.Widget.onGamepadButtonPressed ( GamepadEvent event)

Gamepad button has been pressed.

Default behaviour sends event to all gamepad listeners or propagates event to parent if allowed.

Reimplemented in Dragengine.Gui.ComboBox, Dragengine.Gui.MainMenus.Interactive.InteractiveMainMenu, Dragengine.Gui.TextArea, Dragengine.Gui.TextField, Dragengine.Gui.WindowCaptureBinding, and Dragengine.Gui.WindowPopup.

References getTextBorderThickness().

Referenced by updateCanvasBackground().

◆ onGamepadButtonReleased()

void Dragengine.Gui.Widget.onGamepadButtonReleased ( GamepadEvent event)

Gamepad button has been released.

Default behaviour sends event to all gamepad listeners or propagates event to parent if allowed.

References pTextBorderThickness.

Referenced by updateCanvasBackground().

◆ onGuiThemeChanged()

void Dragengine.Gui.Widget.onGuiThemeChanged ( )

◆ 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.

◆ 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.

◆ onReposition()

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

Position changed.

Sends event to listeners.

Referenced by setColorTransformation().

◆ onResize()

◆ onSetFont()

void Dragengine.Gui.Widget.onSetFont ( )

◆ onSetTextColor()

void Dragengine.Gui.Widget.onSetTextColor ( )

Text parameters changed.

Called if one of these parameters changed:

  • Text color
  • Text border color

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

Referenced by sendEventToListeners().

◆ onSetTextDilation()

void Dragengine.Gui.Widget.onSetTextDilation ( )

Text parameters changed that affect text dilation.

Called if one of these parameters changed:

  • Text border thickness
  • Text dilation

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

◆ onShown()

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

Widget has been shown.

Sends event to listeners.

Reimplemented in Dragengine.Gui.WindowConsole.

Referenced by Dragengine.Gui.Window.becomeBackgroundWindow().

◆ onStateChanged()

void Dragengine.Gui.Widget.onStateChanged ( StateChangeEvent event)

◆ onTranslationChanged()

void Dragengine.Gui.Widget.onTranslationChanged ( )

Translation manager or active language pack changed.

Version
1.20

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

Referenced by updateCanvasBackground().

◆ popdownVirtualKeyboard()

void Dragengine.Gui.Widget.popdownVirtualKeyboard ( )

Popdown virtual keyboard if Desktop has one assigned.

Version
1.7

Does nothing if the virtual keyboard is shown and not assigned to this widget.

Reimplemented in Dragengine.Gui.Desktop.

Referenced by Dragengine.Gui.TextField.measureAdvance().

◆ popdownVirtualKeyboardDirectional()

void Dragengine.Gui.Widget.popdownVirtualKeyboardDirectional ( )

Popdown virtual keyboard if Desktop has one assigned and direction focus widget.

Version
1.29

Does nothing if the virtual keyboard is shown and not assigned to this widget.

Referenced by Dragengine.Gui.WindowPopup.onGamepadButtonPressed().

◆ popupVirtualKeyboard()

void Dragengine.Gui.Widget.popupVirtualKeyboard ( )

Popup virtual keyboard if Desktop has one assigned.

Version
1.7

Does nothing if the virtual keyboard is shown and already assigned to this widget.

Referenced by Dragengine.Gui.TextField.measureAdvance().

◆ prevFocusWidget()

Widget Dragengine.Gui.Widget.prevFocusWidget ( )

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

Referenced by Dragengine.Gui.Container.onGuiThemeChanged(), and updateCanvasBackground().

◆ 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.Desktop, and Dragengine.Gui.GameRoot.

◆ releaseDirectional()

void Dragengine.Gui.Widget.releaseDirectional ( )

Release directional navigation capture.

Version
1.29

Referenced by Dragengine.Gui.WindowVirtualKeyboard.createVirtualKeyHide(), and Dragengine.Gui.WindowPopup.grabFocus().

◆ releaseMouse()

◆ removeDragListener()

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

Remove a drag listener.

◆ removeFocusListener()

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

◆ removeGamepadListener()

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

Remove gamepad listener.

References getTextBorderColor(), and pCanvasWidget.

◆ removeKeyListener()

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

Remove key listener.

References getFont(), and pFont.

Referenced by Dragengine.Gui.WindowDialog.message().

◆ removeMouseListener()

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

Remove mouse listener.

◆ removeStateChangeListener()

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

Remove state change listener.

References getColorTransformation(), and pCanvasWidget.

◆ removeWidgetListener()

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

Remove widget listener.

References isTransformationSet(), and pTransformation.

◆ requestGrabFocus()

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

Request to focus the specified widget.

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

◆ runWhileBlockingLayoutParent()

void Dragengine.Gui.Widget.runWhileBlockingLayoutParent ( Block ablock)

Run block while layouting is blocked.

Version
1.23

This method is useful when you do multiple changes to a widget avoiding layoutParent calls to be done for each modification except once to avoid performance loss. The method ensures the blocking state is restored to the value present before even in case of exceptions. You still have to call layoutParent() to trigger an update after returning from the method call. This method call can be nested safely.

Referenced by isMinimumSizeSet(), and Dragengine.Gui.Button.updateWidgetImage().

◆ safeDispose()

◆ sendEvent()

◆ sendEventToListeners()

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

◆ setBackgroundCanvasCreator()

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

Set background canvas creator or null to use background color.

References getBoundary(), getBoundaryWithBorder(), and pBorder.

Referenced by Dragengine.Gui.ScrollBar.ActionScroll.enableDirectionButtons().

◆ setBlockLayoutParent()

void Dragengine.Gui.Widget.setBlockLayoutParent ( bool blockLayoutParent)

Set block layoutParent calls.

Version
1.23

Used to prevent deadloops and performance problems with layoutParent/doLayout calls. Be careful to disable blocking even in case of exceptions. Also make sure to restore the block layout call in place before changing it by yourself to not break chains.

References pBorder, pCanvasWidget, and pDesigner.

Referenced by getMinimumSize().

◆ setBorder()

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

◆ setCanFocus()

◆ setCanFocusDirectional()

◆ setClipboard()

void Dragengine.Gui.Widget.setClipboard ( Clipboard clipboard)

Set clipboard or null to use parent clipboard.

Version
1.11

Referenced by Dragengine.Gui.Desktop.getFocusWidget().

◆ setColorTransformation()

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

Set color transformation.

References onReposition(), and pPosition.

Referenced by addGamepadListener(), and Dragengine.Gui.Window.becomeBackgroundWindow().

◆ 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.

References getBorderSize(), new(), and pBorder.

Referenced by Dragengine.Gui.MenuItem.addLeftIcon(), Dragengine.Gui.WindowSettings.addSheetButton(), Dragengine.Gui.EMPSystem.ParameterValueEditor.applyChanges(), Dragengine.Gui.MainMenus.Interactive.IMMTextDisplay.clearText(), Dragengine.Gui.Window.close(), Dragengine.Gui.ModManagement.MMWindowModManagement.createButton(), Dragengine.Gui.ModManagement.MMDialogReportMod.createContent(), Dragengine.Gui.ModManagement.MMPanelModInfo.createContent(), Dragengine.Gui.WindowGameWorld.createContent(), Dragengine.Gui.WindowSettings.createContent(), Dragengine.Services.User.DialogServiceUserAcceptTos.createContent(), Dragengine.Gui.ModManagement.MMWindowModInfo.createModInfoPanel(), Dragengine.Gui.CheckBox.dispose(), Dragengine.Gui.ConsoleInputField.dispose(), Dragengine.Gui.OptionBox.dispose(), Dragengine.Gui.PanelPlayerChoice.dispose(), Dragengine.Gui.WindowConsole.dispose(), Dragengine.Gui.ModManagement.MMPanelModUserAccount.findLoadAvatarImage(), Dragengine.Gui.MenuItemCommand.fireAction(), Dragengine.Gui.PanelFPSRates.forEachFPSRate(), Dragengine.Gui.Desktop.getActiveWindow(), Dragengine.Gui.Label.getAlignment(), Dragengine.Gui.ShoutConsole.getConsole(), Dragengine.Gui.ModManagement.MMModificationListRenderer.ModWidget.getDefaultSize(), Dragengine.Gui.ModManagement.MMTransferListRenderer.ModWidget.getDefaultSize(), Dragengine.Gui.SpinButton.getDesignerFromTheme(), Dragengine.Gui.TextArea.getHorizontalRangeModel(), Dragengine.Gui.MainMenus.Interactive.InteractiveMainMenu.getInteract(), Dragengine.Gui.ProgressGauge.getModel(), Dragengine.Gui.OptionBox.getOptionBoxWidget(), Dragengine.Gui.WindowGameWorld.getPanelBorder(), Dragengine.Gui.WindowLoading.getPreloadManager(), Dragengine.Gui.WorldRenderer.getRenderMinimumSize(), Dragengine.Gui.DisplayImage.getRepeatMode(), Dragengine.Gui.ProgressBar.getShowPercentage(), Dragengine.Gui.Label.getText(), Dragengine.Gui.MainMenus.Interactive.IMMTextDisplay.getText(), Dragengine.Gui.WindowOverColor.getTimeStay(), Dragengine.Gui.ListBox.getVerticalRangeModel(), Dragengine.Gui.WindowDialog.message(), Dragengine.Gui.CheckBox.new(), Dragengine.Gui.CheckBox.new(), Dragengine.Gui.CheckBox.new(), Dragengine.Gui.CheckBox.new(), Dragengine.Gui.DefaultComboBoxEditor.new(), Dragengine.Gui.DisplayIcon.new(), Dragengine.Gui.MenuBar.new(), Dragengine.Gui.MenuItemCheck.new(), Dragengine.Gui.MenuItemCheck.new(), Dragengine.Gui.MenuItemCheck.new(), Dragengine.Gui.MenuItemCommand.new(), Dragengine.Gui.MenuItemOption.new(), Dragengine.Gui.MenuItemOption.new(), Dragengine.Gui.MenuItemOption.new(), Dragengine.Gui.MenuItemSeparator.new(), Dragengine.Gui.MenuItemToggle.new(), Dragengine.Gui.MenuItemToggle.new(), Dragengine.Gui.MenuItemToggle.new(), Dragengine.Gui.MenuPopup.new(), Dragengine.Gui.ModManagement.MMImageGallery.new(), Dragengine.Gui.OptionBox.new(), Dragengine.Gui.OptionBox.new(), Dragengine.Gui.OptionBox.new(), Dragengine.Gui.OptionBox.new(), Dragengine.Gui.PanelPlayerChoice.new(), Dragengine.Gui.SubTitleBox.new(), Dragengine.Gui.WorldRenderer.new(), Dragengine.Gui.MenuBarItem.onDesignerSelectorChanged(), Dragengine.Gui.PanelHud.onDesignerSelectorChanged(), Dragengine.Gui.PanelPlayerChoiceEntry.onDesignerSelectorChanged(), Dragengine.Gui.ComboBox.onFocusReceived(), Dragengine.Gui.WindowLogo.onFrameUpdate(), Dragengine.Gui.ComboBox.onGamepadButtonPressed(), Dragengine.Gui.WindowCaptureBinding.onGamepadButtonPressed(), Dragengine.Gui.ComboBox.onKeyPress(), Dragengine.Gui.EditBindingsListBox.onKeyPress(), Dragengine.Gui.ModManagement.MMImageGalleryPreviewImage.onOriginalImageChanged(), Dragengine.Gui.ComboBox.requestReleaseMouse(), Dragengine.Gui.EditModuleParametersPanel.setAdvanced(), Dragengine.Gui.ProgressGauge.setBlendWidth(), Dragengine.Gui.TextField.setCursorPositionStart(), Dragengine.Gui.DisplayImage.setImage(), Dragengine.Gui.DisplayImage.setRepeatMode(), Dragengine.Gui.DisplayVideo.setRepeatMode(), Dragengine.Gui.DisplayRotatingImage.setRotation(), Dragengine.Gui.ProgressGauge.setShowPercentage(), Dragengine.Gui.DisplayVideo.setVideoColorTransform(), Dragengine.Gui.DisplayInteractPromptEntry.updateBindingWidgets(), Dragengine.Gui.ModManagement.MMPanelModManagement.SearchCategoryCheckBox.ServiceModsSelectionChanged.updateModelTransfers(), Dragengine.Gui.Button.updateWidgetImage(), Dragengine.Gui.PanelInteractPrompt.updateWidgets(), and Dragengine.Gui.SubTitleBoxTextBorder.writeObjectToFile().

◆ 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.

References getPadding(), and pPadding.

Referenced by Dragengine.Gui.BgButton.updateBackgroundImage(), and Dragengine.Gui.ProgressBar.updateLabelCanvasParams().

◆ setHasBlockedLayoutParent()

void Dragengine.Gui.Widget.setHasBlockedLayoutParent ( bool hasBlockedLayoutParent)

Set if layoutParent calls happened during runWhileBlockingLayoutParent.

Version
1.23

References onDispose(), and stopFrameUpdater().

Referenced by getDesktopBoundaryWithBorder().

◆ setHasFocus()

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

Sets if widget has the focus.

References getMinimumSizeWithBorderForHeight().

Referenced by Dragengine.Gui.Desktop.sendEventToListeners().

◆ setHeight()

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

◆ setMinimumSize()

◆ 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.

References getMinimumSize(), and getMinimumSizeForWidth().

◆ setPadding()

◆ 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.

References getEnabled(), and pVisible.

Referenced by Dragengine.Gui.MainMenus.Interactive.InteractiveMainMenu.createAndAddBehaviorFactories(), Dragengine.Gui.ModManagement.MMImageGallery.new(), and Dragengine.Gui.Container.setLayout().

◆ setPosition()

◆ setProtectBackgroundCanvasCreator()

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

Set protect custom set background canvas creator.

References getVisibleRelativeBoundary().

◆ 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.

References getVisibleDesktopBoundary(), and pParent.

◆ setProtectMinimumSize()

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

Set protect custom set minimumsize.

Referenced by Dragengine.Gui.ComboBox.onFocusLost().

◆ setProtectMousePointer()

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

Set protect custom set mouse pointer.

References ensureVisible(), getMinimumSize(), and getParent().

◆ setProtectPadding()

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

Set protect custom set padding.

Referenced by Dragengine.Gui.ScrollBar.ActionScroll.enableDirectionButtons().

◆ setProtectTextColor()

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

Set protect custom set text color.

◆ setSize()

◆ setTextBorderColor()

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

Set text border color.

Version
1.35

References setPosition(), and setY().

Referenced by sendEventToListeners(), and Dragengine.Gui.BgButton.updateBackgroundImage().

◆ setTextBorderThickness()

void Dragengine.Gui.Widget.setTextBorderThickness ( float thickness)

Set text border thickness in percentage of the font size or null.

Version
1.35

A good starting value for balanced border size is 0.025 (2.5%) or 0.03 (3%).

References getHeight(), getX(), and getY().

Referenced by isPointInside(), and Dragengine.Gui.BgButton.updateBackgroundImage().

◆ setTextColor()

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

Set text color.

References getSize().

Referenced by Dragengine.Gui.BgButton.updateBackgroundImage().

◆ setTextDilation()

void Dragengine.Gui.Widget.setTextDilation ( float dilation)

Set text dilation in percentage of the font size.

Version
1.35

References onResize(), updateCanvasBackground(), and updateCanvasGeometry().

Referenced by Dragengine.Gui.BgButton.updateBackgroundImage().

◆ setTitle()

void Dragengine.Gui.Widget.setTitle ( String title)

Set widget title.

Version
1.13

For use by borders and decorators to provide a title to a widget.

Reimplemented in Dragengine.Gui.Window.

References getBoundary(), and setSize().

◆ setToolTip()

◆ setTransformation()

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

Set transformation or null if not set.

References getY().

Referenced by removeFocusListener().

◆ setTransparency()

◆ setVisible()

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

Sets if widget is visible.

Referenced by Dragengine.Gui.ModManagement.MMPanelModInfo.createContent(), Dragengine.Gui.PanelInteractPromptController.createContent(), Dragengine.Gui.PanelPlayerChoice.createOptionWidget(), Dragengine.Gui.WindowVirtualKeyboard.createVirtualKeyHide(), Dragengine.Gui.PanelPlayerChoice.dispose(), Dragengine.Gui.WindowConsole.dispose(), Dragengine.Gui.ScrollBar.ActionScroll.enableDirectionButtons(), Dragengine.Gui.ModManagement.MMPanelModUserAccount.findLoadAvatarImage(), Dragengine.Gui.CheckBox.getFocusMouseLocation(), Dragengine.Gui.OptionBox.getFocusMouseLocation(), Dragengine.Gui.BgButton.getImage(), Dragengine.Gui.WindowPopup.grabFocus(), Dragengine.Gui.WindowToolTip.grabFocus(), Dragengine.Gui.WindowPlayerChoice.hoverOverFirstOption(), Dragengine.Gui.WindowModal.moveAboveBlockWindow(), Dragengine.Gui.WindowModal.new(), Dragengine.Gui.Button.onButtonRelease(), Dragengine.Gui.ComboBox.onGamepadButtonPressed(), Dragengine.Gui.BgButton.onStateChanged(), Dragengine.Gui.WindowOverColor.realGetWidgetAt(), Dragengine.Gui.WindowToolTip.realGetWidgetAt(), Dragengine.Gui.WindowPlayerChoice.replaceMouseArea(), Dragengine.Gui.WindowPopup.sendEvent(), Dragengine.Gui.Desktop.sendEventToListeners(), Dragengine.Gui.BgButton.setImage(), Dragengine.Gui.BgButton.unlockSize(), Dragengine.Gui.ProgressBar.updateLabelCanvasParams(), Dragengine.Gui.ScrollPanel.updateScrollBarHiding(), Dragengine.Gui.WindowLogo.updateTransparency(), and Dragengine.Gui.Button.updateWidgetImage().

◆ setWidth()

◆ setX()

◆ setY()

◆ simulateKeyPress()

void Dragengine.Gui.Widget.simulateKeyPress ( int keyCode,
int keyChar )

Simulate keyboard press event.

Version
1.29
Parameters
keyCodeKey code of the key to simulate. Use InputEventKey constant.

Referenced by Dragengine.Gui.WindowVirtualKeyboard.createVirtualKeyHide().

◆ simulateKeyPressRelease()

void Dragengine.Gui.Widget.simulateKeyPressRelease ( int keyCode,
int keyChar )

Simulate keyboard press and release event.

Version
1.29
Parameters
keyCodeKey code of the key to simulate. Use InputEventKey constant.

Referenced by Dragengine.Gui.TextField.measureAdvance().

◆ simulateKeyRelease()

void Dragengine.Gui.Widget.simulateKeyRelease ( int keyCode,
int keyChar )

Simulate keyboard release event.

Version
1.29
Parameters
keyCodeKey code of the key to simulate. Use InputEventKey constant.

Referenced by Dragengine.Gui.WindowVirtualKeyboard.createVirtualKeyHide().

◆ startFrameUpdater()

◆ stopFrameUpdater()

◆ 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.

References design(), grabFocus(), isPointInside(), nextFocusWidget(), onGamepadButtonPressed(), onGamepadButtonReleased(), onGuiThemeChanged(), onTranslationChanged(), pParent, prevFocusWidget(), pTheme, pThemeSelector, pTranslationManager, sendEvent(), and sendEventToListeners().

Referenced by layoutParent(), and setTextDilation().

◆ 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.

Referenced by getEnabled(), getTextBorderColor(), layoutParent(), and setTextDilation().

Member Data Documentation

◆ pBackgroundCanvasCreator

CanvasCreator Dragengine.Gui.Widget.pBackgroundCanvasCreator

Referenced by getBlockLayoutParent().

◆ pBlockLayoutParent

◆ pBorder

◆ pCanvasWidget

CanvasView Dragengine.Gui.Widget.pCanvasWidget

◆ pClipboard

Clipboard Dragengine.Gui.Widget.pClipboard

Referenced by new().

◆ pDesigner

WidgetDesigner Dragengine.Gui.Widget.pDesigner

Referenced by setBlockLayoutParent().

◆ pDesignerSelector

◆ pFont

Font Dragengine.Gui.Widget.pFont

◆ pFrameUpdater

FrameUpdater Dragengine.Gui.Widget.pFrameUpdater

◆ pIsDesignerSet

bool Dragengine.Gui.Widget.pIsDesignerSet

◆ pKeyListeners

Array Dragengine.Gui.Widget.pKeyListeners

Referenced by getBlockLayoutParent(), and getParent().

◆ pMousePointer

MousePointerFactory Dragengine.Gui.Widget.pMousePointer

◆ pPadding

BorderSize Dragengine.Gui.Widget.pPadding

◆ pParent

◆ pPosition

◆ pProtectBackgroundCanvasCreator

bool Dragengine.Gui.Widget.pProtectBackgroundCanvasCreator

Referenced by new().

◆ pRepeatEventTimer

RepeatKeyEventTimer Dragengine.Gui.Widget.pRepeatEventTimer

◆ pTextBorderThickness

float Dragengine.Gui.Widget.pTextBorderThickness

Referenced by onGamepadButtonReleased().

◆ pTextColor

Color Dragengine.Gui.Widget.pTextColor

Referenced by getCanvasContent().

◆ pTheme

GuiTheme Dragengine.Gui.Widget.pTheme

Referenced by updateCanvasBackground().

◆ pThemeSelector

String Dragengine.Gui.Widget.pThemeSelector

Referenced by updateCanvasBackground().

◆ pTitle

String Dragengine.Gui.Widget.pTitle

Referenced by dispose().

◆ pToolTip

Object Dragengine.Gui.Widget.pToolTip

Referenced by new().

◆ pTransformation

TexMatrix2 Dragengine.Gui.Widget.pTransformation

◆ pTranslationManager

TranslationManager Dragengine.Gui.Widget.pTranslationManager

Referenced by new(), and updateCanvasBackground().

◆ pTransparency

float Dragengine.Gui.Widget.pTransparency

◆ pVisible

bool Dragengine.Gui.Widget.pVisible

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