Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Gui.Desktop Class Reference

Desktop containing set of windows. More...

Inheritance diagram for Dragengine.Gui.Desktop:
Dragengine.Gui.Container Dragengine.Gui.Widget

Public Member Functions

void addMousePointerListener (MousePointerListener listener)
 Add mouse pointer listener.
void addWidget (Widget widget)
 Add window to desktop.
void addWidget (Widget widget, Object settings)
 Add window to desktop.
void addWindow (Window window)
 Add window to desktop.
void addWindow (Window window, Object settings)
 Add window to desktop.
bool allowsChildGrabFocus ()
 Container allows child widgets to grab the focus.
void clearFocusWidget ()
void dispose ()
 Disposes of widget.
void ensureVisible ()
 Ensure widget is fully visible on desktop if possible.
void ensureVisible (RectArea box)
 Ensure boundary is visible on desktop if possible.
void focusActiveWidgetOfFirstUsableWindow ()
 Focus the active widget of the top window supporting it if possible.
void focusDirectional (int direction)
 Focus widget in direction that can grab the focus.
MousePointerFactory getActiveMousePointer ()
 Active mouse pointer factory or null.
Window getActiveWindow ()
 Active window or null.
bool getAllowMoveOutsideDesktop ()
 Allow mouse pointer to move outside desktop boundaries.
Desktop getDesktop ()
Point getDesktopPosition ()
 Widget position in desktop coordinates.
Widget getDirectionalCaptureWidget ()
 Widget having captured directional navigation.
Widget getFocusWidget ()
 Focused widget or null.
GamepadController getGamepadController ()
 Gamepad controller or null.
Widget getHoverWidget ()
 Widget the mouse hovers above or null.
bool getIsMouseHidden ()
 Mouse pointer is hidden.
RectArea getMouseArea ()
 Movement area of mouse pointer or null if not set.
Widget getMouseCaptureWidget ()
Point getMouseLocation ()
 Location of mouse pointer.
MousePointer getMousePointerInstance ()
 Mouse pointer instance or null.
Point getNoBorderPosition ()
 Top left position excluding no window border.
Point getNoBorderSize ()
 Maximum size excluding no window border.
BorderSize getNoWindowBorder ()
 Area along the borders no window can occupy.
ToolTipManager getToolTipManager ()
 Tool tip manager or null.
RectArea getVisibleDesktopBoundary ()
 Visible widget boundary in desktop coordinates.
WindowVirtualKeyboard getWindowVirtualKeyboard ()
 Virtual keyboard window or null.
void giveUpFocus ()
void layoutParent ()
Desktop new (int width, int height)
 Create desktop widget.
Desktop new (int x, int y, int width, int height)
 Create desktop widget.
Desktop new (Point size)
 Create desktop widget.
void onMouseMove (MouseEvent event)
void onMousePointerChanged (MousePointerEvent event)
 Mouse pointer changed.
void onMousePointerHidden (MousePointerEvent event)
 Mouse pointer has been hidden.
void onMousePointerShown (MousePointerEvent event)
 Mouse pointer has been shown.
void onResize (WidgetEvent event)
 Size changed.
void popdownVirtualKeyboard ()
 Popdown virtual keyboard if Desktop has one assigned.
void processEvent (Event event)
void raiseWindowsAlwaysOnTop ()
 Raise windows with getAlwaysOnTop() set.
void removeAllWidgets ()
 Remove all windows from desktop.
void removeMousePointerListener (MousePointerListener listener)
 Remove mouse pointer listener.
void removeWidget (Widget widget)
 Remove window from desktop.
bool requestCaptureDirectional (Widget widget)
 Request to capture directional navigation for the specified widget.
bool requestCaptureMouse (Widget widget)
void requestGrabFocus (Widget widget)
bool requestReleaseDirectional (Widget widget)
 Request to release directional navigation capture.
bool requestReleaseMouse (Widget widget)
void sendEventToListeners (Event event, bool sendToParent)
 Send event to all appropriate listeners for events of its kind.
void setActiveMousePointer (MousePointerFactory mousePointer)
 Set active mouse pointer or null.
void setAllowMoveOutsideDesktop (bool allowMoveOutsideDesktop)
 Set if mouse pointer is allowed to move outside desktop boundaries.
void setGamepadController (GamepadController controller)
 Set gamepad controller or null.
void setIsMouseHidden (bool hidden)
 Set if mouse pointer is hidden.
void setMouseArea (RectArea area)
 Set movement area of the mouse pointer or null to clear.
void setMouseLocation (Point location)
 Set location of mouse pointer.
void setNoWindowBorder (BorderSize size)
 Set area along the borders no window can occupy.
void setToolTipManager (ToolTipManager tooltipManager)
 Set tool tip manager or null.
void setWindowVirtualKeyboard (WindowVirtualKeyboard window)
 Set virtual keyboard window or null.
void warpCenterMouse ()
 Warp mouse pointer centered in desktop.
void warpCenterMouseIn (Widget widget)
 Warp mouse pointer centered inside widget.
void warpMouseFocusLocation ()
 Warp mouse pointer on focus widget using directional focus location.
void warpMouseFocusLocation (Widget widget)
 Warp mouse pointer on widget using directional focus location.
void warpMouseIn (Widget widget, Point location)
 Warp mouse pointer relative to widget.
void warpMousePointer (Point location)
 Warp mouse pointer.
Widget widgetAcceptingInputAt (Point position)
 Widget accepting input at position.
Public Member Functions inherited from Dragengine.Gui.Container
void collectClosestFocusWidget (ClosestDirectionFocusFinder finder, Point origin)
 Find closest focus widget for directional navigation.
void doLayout ()
Widget findFocusableWidget ()
Widget findLastFocusableWidget ()
Widget findWidget (Block ablock)
 Find widget using block or null if not found.
int getContainerHeight ()
Point getContainerSize ()
int getContainerWidth ()
bool getHasBlockedDoLayout ()
 doLayout calls happened during runWhileBlockingLayout.
Layout getLayout ()
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.
bool getStateChangeNotifyChildren ()
 Notify children if state changed.
Widget getWidget (int index)
Widget getWidgetAt (Point position)
 Widget at coordinates or null if not found.
int getWidgetCount ()
bool hasFocusWidget ()
 Focus widget is inside container somewhere.
bool hasWidget (Widget widget)
int indexOfWidget (Widget widget)
Object injectWidget (Object injectValue, Block ablock)
 Process value visiting widgets using block.
bool isChildVisible (Widget child)
 Child widget is visible.
bool isChildVisibleOnDesktop (Widget child)
 Child widget is visible on desktop.
bool isMouseInside ()
 Mouse is hovering over this widget.
void moveWidget (Widget widget, int newPosition)
Container new ()
Container new (Layout layout)
 Create container with layout.
Container new (Layout layout, Block blockAddContent)
 Create container with layout calling block to add content.
Container new (Point position, Point size)
Widget nextFocusWidgetAfter (Widget widget)
 Find next widget in the focus cycle that can grab the focus.
void onGuiThemeChanged ()
void onPaddingChanged ()
 Padding changed.
void onStateChanged (StateChangeEvent event)
 State changed.
Widget prevFocusWidgetAfter (Widget widget)
 Find previous widget in the focus cycle that can grab the focus.
void runWhileBlockingLayout (Block ablock)
 Run block while layouting is blocked.
void setEnabled (bool enabled)
void setHasBlockedDoLayout (bool hasBlockedDoLayout)
 Set if doLayout calls happened during runWhileBlockingLayout.
void setLayout (Layout layout)
void setMousePointer (MousePointerFactory mousePointer)
 Set mouse pointer to use.
void setStateChangeNotifyChildren (bool notify)
 Set to notify children if state changed.
Public Member Functions inherited from Dragengine.Gui.Widget
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 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.
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.
RectArea getDesktopBoundary ()
 Rectangular boundary of widget relative to desktop.
RectArea getDesktopBoundaryWithBorder ()
 Rectangular boundary of widget including border relative to parent.
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.
Point getLocalMouseLocation ()
 Parent desktop mouse location in widget coordinates.
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.
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 getVisibleRelativeBoundary (Container parent)
 Visible widget boundary relative to parent coordinate system.
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 isPointInside (Point position)
bool isTransformationSet ()
void layoutParentIfBlocked ()
 Calls layoutParent if getHasBlockedLayoutParent() is true.
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 onHidden (WidgetEvent event)
 Widget has been hidden.
void onParentStateChanged ()
 Parent state changed.
void onParentStateChanged (bool force)
 Parent state changed.
void onReposition (WidgetEvent event)
 Position 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 onTranslationChanged ()
 Translation manager or active language pack changed.
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 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 runWhileBlockingLayoutParent (Block ablock)
 Run block while layouting is blocked.
void safeDispose ()
 Safely dispose of widget.
void sendEvent (Event event)
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 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 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

MousePointerFactory pActiveMousePointer
bool pBlockSetHoverWidget
Decoration.Area pDragArea
Point pDragOffset
Window pDragWindow
Widget pFocusWidget
GamepadController pGamepadController
RectArea pMouseArea
bool pMouseHidden
Point pMouseLocation
MousePointer pMousePointerInstance
Array pMousePointerListeners
BorderSize pNoWindowBorder
ToolTipManager pToolTipManager
Window pTrackDecoration
Decoration.Area pTrackDecorationAreaHover
WindowVirtualKeyboard pWindowVirtualKeyboard
Public Attributes inherited from Dragengine.Gui.Container
bool pBlockLayout
Point pCachedMinSize
int pCachedMinSizeForHeightHeight
Point pCachedMinSizeForHeightSize
Point pCachedMinSizeForWidthSize
int pCachedMinSizeForWidthWidth
Array pChildren
bool pHasBlockedDoLayout
Layout pLayout
bool pStateChangeNotifyChildren
Public Attributes inherited from Dragengine.Gui.Widget
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

void clearDragWindow ()
 Clear drag window and release mouse capture if drag window is present.
void clearHoverWidget ()
 Clear hover widget.
Window getTrackDecoration ()
 Decoration whose state is tracked or null.
Decoration.Area getTrackDecorationAreaHover ()
 Tracked decoration area the mouse hovers above.
void setHoverWidget (Widget widget, MouseEvent event)
 Set widget the mouse hovers above.
void setTrackDecoration (Window window)
 Set decoration whose state is tracked or null.
void setTrackDecorationAreaHover (Decoration.Area areaHover)
 Set tracked decoration area the mouse hovers above.
Protected Member Functions inherited from Dragengine.Gui.Widget
WidgetDesigner getDesignerFromTheme ()
 Get designer from gui theme.
void updateCanvasBackground ()
 Update background canvas content.
void updateCanvasGeometry ()
 Update canvas position and size.

Detailed Description

Desktop containing set of windows.

Provides typical desktop support like handling window interaction, focus and hover widget as well as mouse pointer handling.

Todo
Add support to set mouse pointers for different situations:
  • normal mouse pointer
  • resizing mouse pointes: 8 pointers for each direction these also have to go into a new DefaultDesktopDesigner class. change the mouse pointer depending on the situation. mouse pointers should have only the responsibility to provide and update a canvas. complex logic like showing additional widgets like the InfoMousePointer does have to be moved into MouseListener which update widgets matching the mouse pointer position. this separates extended logic from basic design which can be done using XML. It also allows to attach logic to a MousePointer without the need to alter the instance itself.

Member Function Documentation

◆ addMousePointerListener()

void Dragengine.Gui.Desktop.addMousePointerListener ( MousePointerListener listener)

Add mouse pointer listener.

Version
1.7

References clearHoverWidget(), and setHoverWidget().

Referenced by sendEventToListeners().

◆ addWidget() [1/2]

void Dragengine.Gui.Desktop.addWidget ( Widget widget)

Add window to desktop.

Reimplemented from Dragengine.Gui.Container.

Referenced by sendEventToListeners().

◆ addWidget() [2/2]

void Dragengine.Gui.Desktop.addWidget ( Widget widget,
Object settings )

Add window to desktop.

Reimplemented from Dragengine.Gui.Container.

References Dragengine.Gui.Container.getWidgetCount().

◆ addWindow() [1/2]

void Dragengine.Gui.Desktop.addWindow ( Window window)

Add window to desktop.

To add windows use this function rather than addWidget.

References pDragWindow, and widgetAcceptingInputAt().

Referenced by sendEventToListeners().

◆ addWindow() [2/2]

void Dragengine.Gui.Desktop.addWindow ( Window window,
Object settings )

Add window to desktop.

To add windows use this function rather than addWidget.

References Dragengine.Gui.Widget.getVisible(), and Dragengine.Gui.Container.getWidget().

◆ allowsChildGrabFocus()

bool Dragengine.Gui.Desktop.allowsChildGrabFocus ( )

Container allows child widgets to grab the focus.

Reimplemented from Dragengine.Gui.Container.

References setTrackDecorationAreaHover().

Referenced by sendEventToListeners().

◆ clearDragWindow()

void Dragengine.Gui.Desktop.clearDragWindow ( )
protected

Clear drag window and release mouse capture if drag window is present.

Version
1.25

References dispose().

Referenced by sendEventToListeners(), and setNoWindowBorder().

◆ clearFocusWidget()

void Dragengine.Gui.Desktop.clearFocusWidget ( )

Clears the focus widget.

Referenced by sendEventToListeners().

◆ clearHoverWidget()

void Dragengine.Gui.Desktop.clearHoverWidget ( )
protected

◆ dispose()

void Dragengine.Gui.Desktop.dispose ( )

Disposes of widget.

Reimplemented from Dragengine.Gui.Widget.

References new(), pDragOffset, pNoWindowBorder, and pTrackDecorationAreaHover.

Referenced by clearDragWindow(), getHoverWidget(), and sendEventToListeners().

◆ ensureVisible() [1/2]

void Dragengine.Gui.Desktop.ensureVisible ( )

Ensure widget is fully visible on desktop if possible.

Version
1.29

Reimplemented from Dragengine.Gui.Widget.

Referenced by sendEventToListeners().

◆ ensureVisible() [2/2]

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

Ensure boundary is visible on desktop if possible.

Version
1.29

Reimplemented from Dragengine.Gui.Widget.

References getTrackDecoration(), and pTrackDecoration.

◆ focusActiveWidgetOfFirstUsableWindow()

void Dragengine.Gui.Desktop.focusActiveWidgetOfFirstUsableWindow ( )

Focus the active widget of the top window supporting it if possible.

Referenced by sendEventToListeners().

◆ focusDirectional()

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

Focus widget in direction that can grab the focus.

Version
1.29
Parameters
directionDirection as InputEventKey.arrowLeft, InputEventKey.arrowRight, InputEventKey.arrowUp or InputEventKey.arrowDown.

Reimplemented from Dragengine.Gui.Widget.

Referenced by sendEventToListeners().

◆ getActiveMousePointer()

MousePointerFactory Dragengine.Gui.Desktop.getActiveMousePointer ( )

Active mouse pointer factory or null.

References pBlockSetHoverWidget.

Referenced by sendEventToListeners().

◆ getActiveWindow()

Window Dragengine.Gui.Desktop.getActiveWindow ( )

◆ getAllowMoveOutsideDesktop()

bool Dragengine.Gui.Desktop.getAllowMoveOutsideDesktop ( )

Allow mouse pointer to move outside desktop boundaries.

Version
1.24

Enabling this is useful for top level desktops residing in a non-input-capturing game window. If enabled the user can click and move outside the game window with the mouse movement not being clamped to the game window. Default value is false.

References Dragengine.Gui.Widget.getEnabled(), and Dragengine.Gui.Container.getWidgetAt().

Referenced by sendEventToListeners().

◆ getDesktop()

Desktop Dragengine.Gui.Desktop.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 from Dragengine.Gui.Widget.

References new().

Referenced by sendEventToListeners().

◆ getDesktopPosition()

Point Dragengine.Gui.Desktop.getDesktopPosition ( )

Widget position in desktop coordinates.

Reimplemented from Dragengine.Gui.Widget.

Referenced by sendEventToListeners().

◆ getDirectionalCaptureWidget()

Widget Dragengine.Gui.Desktop.getDirectionalCaptureWidget ( )

Widget having captured directional navigation.

Version
1.29

Reimplemented from Dragengine.Gui.Widget.

References pFocusWidget.

Referenced by getGamepadController().

◆ getFocusWidget()

Widget Dragengine.Gui.Desktop.getFocusWidget ( )

◆ getGamepadController()

GamepadController Dragengine.Gui.Desktop.getGamepadController ( )

Gamepad controller or null.

Version
1.20

References getDirectionalCaptureWidget().

Referenced by sendEventToListeners().

◆ getHoverWidget()

Widget Dragengine.Gui.Desktop.getHoverWidget ( )

◆ getIsMouseHidden()

bool Dragengine.Gui.Desktop.getIsMouseHidden ( )

Mouse pointer is hidden.

Referenced by sendEventToListeners().

◆ getMouseArea()

RectArea Dragengine.Gui.Desktop.getMouseArea ( )

Movement area of mouse pointer or null if not set.

Referenced by sendEventToListeners().

◆ getMouseCaptureWidget()

Widget Dragengine.Gui.Desktop.getMouseCaptureWidget ( )

Retrieves the widget having captured the mouse.

Reimplemented from Dragengine.Gui.Widget.

References Dragengine.Gui.Widget.getVisible(), and pFocusWidget.

Referenced by popdownVirtualKeyboard().

◆ getMouseLocation()

Point Dragengine.Gui.Desktop.getMouseLocation ( )

Location of mouse pointer.

References getHoverWidget().

Referenced by setGamepadController().

◆ getMousePointerInstance()

MousePointer Dragengine.Gui.Desktop.getMousePointerInstance ( )

Mouse pointer instance or null.

Referenced by sendEventToListeners().

◆ getNoBorderPosition()

Point Dragengine.Gui.Desktop.getNoBorderPosition ( )

Top left position excluding no window border.

References pDragWindow.

Referenced by sendEventToListeners().

◆ getNoBorderSize()

Point Dragengine.Gui.Desktop.getNoBorderSize ( )

Maximum size excluding no window border.

References pDragArea, pDragWindow, and requestReleaseMouse().

Referenced by sendEventToListeners().

◆ getNoWindowBorder()

BorderSize Dragengine.Gui.Desktop.getNoWindowBorder ( )

Area along the borders no window can occupy.

Referenced by sendEventToListeners().

◆ getToolTipManager()

ToolTipManager Dragengine.Gui.Desktop.getToolTipManager ( )

Tool tip manager or null.

Version
1.7

References pTrackDecoration, and pTrackDecorationAreaHover.

Referenced by sendEventToListeners().

◆ getTrackDecoration()

Window Dragengine.Gui.Desktop.getTrackDecoration ( )
protected

Decoration whose state is tracked or null.

References Dragengine.Gui.Widget.getWindow().

Referenced by ensureVisible().

◆ getTrackDecorationAreaHover()

Decoration.Area Dragengine.Gui.Desktop.getTrackDecorationAreaHover ( )
protected

Tracked decoration area the mouse hovers above.

Referenced by requestCaptureDirectional().

◆ getVisibleDesktopBoundary()

RectArea Dragengine.Gui.Desktop.getVisibleDesktopBoundary ( )

Visible widget boundary in desktop coordinates.

Version
1.29

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

Reimplemented from Dragengine.Gui.Widget.

References pMouseLocation, pMousePointerInstance, and Dragengine.Gui.Widget.setPosition().

Referenced by sendEventToListeners().

◆ getWindowVirtualKeyboard()

WindowVirtualKeyboard Dragengine.Gui.Desktop.getWindowVirtualKeyboard ( )

Virtual keyboard window or null.

Version
1.7

References pTrackDecoration, and pTrackDecorationAreaHover.

Referenced by sendEventToListeners().

◆ giveUpFocus()

void Dragengine.Gui.Desktop.giveUpFocus ( )

Notifies that the current focus widget can no longer hold the focus.

Reimplemented from Dragengine.Gui.Container.

Referenced by sendEventToListeners().

◆ layoutParent()

void Dragengine.Gui.Desktop.layoutParent ( )

Layout parent if existing. Modified version to not layout of Desktop. Desktop widgets have a fixed size and do not change size if their windows change in any way. Prevents triggering parent layout calls wasting time. On the other hand check for condition changes altering stored widgets

Reimplemented from Dragengine.Gui.Container.

References warpMousePointer().

Referenced by sendEventToListeners().

◆ new() [1/3]

Desktop Dragengine.Gui.Desktop.new ( int width,
int height )

Create desktop widget.

References new().

Referenced by dispose(), getActiveWindow(), getDesktop(), getFocusWidget(), new(), new(), new(), and sendEventToListeners().

◆ new() [2/3]

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

Create desktop widget.

Reimplemented from Dragengine.Gui.Container.

References new(), and pMousePointerListeners.

◆ new() [3/3]

Desktop Dragengine.Gui.Desktop.new ( Point size)

Create desktop widget.

References new().

◆ onMouseMove()

void Dragengine.Gui.Desktop.onMouseMove ( MouseEvent event)

Notification that the mouse has moved.

References onMouseMove().

Referenced by onMouseMove(), raiseWindowsAlwaysOnTop(), and sendEventToListeners().

◆ onMousePointerChanged()

void Dragengine.Gui.Desktop.onMousePointerChanged ( MousePointerEvent event)

Mouse pointer changed.

Version
1.7

References warpCenterMouseIn(), and warpMouseIn().

Referenced by sendEventToListeners().

◆ onMousePointerHidden()

void Dragengine.Gui.Desktop.onMousePointerHidden ( MousePointerEvent event)

Mouse pointer has been hidden.

Version
1.7

Referenced by sendEventToListeners().

◆ onMousePointerShown()

void Dragengine.Gui.Desktop.onMousePointerShown ( MousePointerEvent event)

Mouse pointer has been shown.

Version
1.7

References warpCenterMouse(), and warpMousePointer().

Referenced by sendEventToListeners().

◆ onResize()

void Dragengine.Gui.Desktop.onResize ( WidgetEvent event)

Size changed.

Sends event to listeners.

Reimplemented from Dragengine.Gui.Widget.

References warpMouseIn(), and warpMousePointer().

Referenced by sendEventToListeners().

◆ popdownVirtualKeyboard()

void Dragengine.Gui.Desktop.popdownVirtualKeyboard ( )

Popdown virtual keyboard if Desktop has one assigned.

Version
1.24

Modifies Widget.popdownVirtualKeyboard() to always pop down virtual keyboard no matter which widget is assigned to it.

Reimplemented from Dragengine.Gui.Widget.

References getMouseCaptureWidget().

Referenced by sendEventToListeners().

◆ processEvent()

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

Sends an Event to the focus widget or drop it.

Reimplemented from Dragengine.Gui.Widget.

References pMouseArea, and setMouseLocation().

Referenced by sendEventToListeners().

◆ raiseWindowsAlwaysOnTop()

void Dragengine.Gui.Desktop.raiseWindowsAlwaysOnTop ( )

Raise windows with getAlwaysOnTop() set.

Version
1.15

References onMouseMove().

Referenced by sendEventToListeners().

◆ removeAllWidgets()

void Dragengine.Gui.Desktop.removeAllWidgets ( )

Remove all windows from desktop.

Reimplemented from Dragengine.Gui.Container.

References Dragengine.Gui.Container.getWidgetAt().

Referenced by sendEventToListeners().

◆ removeMousePointerListener()

void Dragengine.Gui.Desktop.removeMousePointerListener ( MousePointerListener listener)

Remove mouse pointer listener.

Version
1.7

References getHoverWidget(), and setHoverWidget().

Referenced by sendEventToListeners().

◆ removeWidget()

void Dragengine.Gui.Desktop.removeWidget ( Widget widget)

Remove window from desktop.

Reimplemented from Dragengine.Gui.Container.

References Dragengine.Gui.Widget.getEnabled().

Referenced by sendEventToListeners().

◆ requestCaptureDirectional()

bool Dragengine.Gui.Desktop.requestCaptureDirectional ( Widget widget)

Request to capture directional navigation for the specified widget.

Returns
true if the request has been accepted.

Reimplemented from Dragengine.Gui.Container.

References getTrackDecorationAreaHover(), and pTrackDecorationAreaHover.

Referenced by sendEventToListeners().

◆ requestCaptureMouse()

bool Dragengine.Gui.Desktop.requestCaptureMouse ( Widget widget)

Request to capture the mouse for the specified widget. Returns true if the request has been accepted.

Reimplemented from Dragengine.Gui.Container.

References pTrackDecoration.

Referenced by sendEventToListeners().

◆ requestGrabFocus()

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

Request to focus the specified widget.

Reimplemented from Dragengine.Gui.Widget.

References pTrackDecoration, and setTrackDecoration().

Referenced by sendEventToListeners().

◆ requestReleaseDirectional()

bool Dragengine.Gui.Desktop.requestReleaseDirectional ( Widget widget)

Request to release directional navigation capture.

Returns
true if the request has been accepted.

Reimplemented from Dragengine.Gui.Container.

References pTrackDecorationAreaHover, and setTrackDecorationAreaHover().

Referenced by sendEventToListeners().

◆ requestReleaseMouse()

bool Dragengine.Gui.Desktop.requestReleaseMouse ( Widget widget)

Request to release mouse capture. Returns true if the request has been accepted.

Reimplemented from Dragengine.Gui.Container.

Referenced by getNoBorderSize(), and sendEventToListeners().

◆ sendEventToListeners()

void Dragengine.Gui.Desktop.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 from Dragengine.Gui.Widget.

References addMousePointerListener(), addWidget(), addWindow(), allowsChildGrabFocus(), clearDragWindow(), clearFocusWidget(), clearHoverWidget(), dispose(), ensureVisible(), focusActiveWidgetOfFirstUsableWindow(), focusDirectional(), getActiveMousePointer(), getActiveWindow(), getAllowMoveOutsideDesktop(), Dragengine.Gui.Widget.getBoundary(), Dragengine.Gui.Widget.getCanFocusDirectional(), Dragengine.Gui.Widget.getCanvasWidget(), getDesktop(), getDesktopPosition(), Dragengine.Gui.Widget.getEnabled(), getFocusWidget(), getGamepadController(), getHoverWidget(), getIsMouseHidden(), Dragengine.Gui.Container.getMinimumSize(), getMouseArea(), getMousePointerInstance(), getNoBorderPosition(), getNoBorderSize(), getNoWindowBorder(), Dragengine.Gui.Widget.getParent(), Dragengine.Gui.Widget.getPosition(), Dragengine.Gui.Widget.getSize(), getToolTipManager(), Dragengine.Gui.Widget.getVisible(), getVisibleDesktopBoundary(), Dragengine.Gui.Container.getWidget(), Dragengine.Gui.Container.getWidgetAt(), Dragengine.Gui.Container.getWidgetCount(), Dragengine.Gui.Widget.getWindow(), getWindowVirtualKeyboard(), giveUpFocus(), Dragengine.Gui.Widget.grabFocus(), Dragengine.Gui.Widget.hasParent(), Dragengine.Gui.Widget.isFullEnabled(), layoutParent(), new(), onMouseMove(), onMousePointerChanged(), onMousePointerHidden(), onMousePointerShown(), onResize(), pActiveMousePointer, pDragArea, pDragOffset, pDragWindow, pFocusWidget, pGamepadController, pMouseArea, pMouseHidden, pMouseLocation, pMousePointerInstance, pMousePointerListeners, pNoWindowBorder, popdownVirtualKeyboard(), processEvent(), pToolTipManager, pTrackDecoration, pWindowVirtualKeyboard, raiseWindowsAlwaysOnTop(), removeAllWidgets(), removeMousePointerListener(), removeWidget(), requestCaptureDirectional(), requestCaptureMouse(), requestGrabFocus(), requestReleaseDirectional(), requestReleaseMouse(), Dragengine.Gui.Widget.safeDispose(), Dragengine.Gui.Widget.sendEvent(), sendEventToListeners(), setActiveMousePointer(), setAllowMoveOutsideDesktop(), setGamepadController(), Dragengine.Gui.Widget.setHasFocus(), Dragengine.Gui.Widget.setHeight(), setHoverWidget(), setIsMouseHidden(), setMouseArea(), setMouseLocation(), setNoWindowBorder(), Dragengine.Gui.Widget.setPosition(), Dragengine.Gui.Widget.setSize(), setToolTipManager(), setTrackDecoration(), setTrackDecorationAreaHover(), Dragengine.Gui.Widget.setVisible(), Dragengine.Gui.Widget.setWidth(), setWindowVirtualKeyboard(), Dragengine.Gui.Widget.setX(), Dragengine.Gui.Widget.setY(), warpMouseFocusLocation(), and warpMouseIn().

Referenced by sendEventToListeners().

◆ setActiveMousePointer()

void Dragengine.Gui.Desktop.setActiveMousePointer ( MousePointerFactory mousePointer)

Set active mouse pointer or null.

If factory changes a new mouse pointer instance is created if not null.

Referenced by sendEventToListeners(), warpMouseFocusLocation(), and warpMouseFocusLocation().

◆ setAllowMoveOutsideDesktop()

void Dragengine.Gui.Desktop.setAllowMoveOutsideDesktop ( bool allowMoveOutsideDesktop)

Set if mouse pointer is allowed to move outside desktop boundaries.

Version
1.24

Enabling this is useful for top level desktops residing in a non-input-capturing game window. If enabled the user can click and move outside the game window with the mouse movement not being clamped to the game window.

References getHoverWidget().

Referenced by sendEventToListeners().

◆ setGamepadController()

void Dragengine.Gui.Desktop.setGamepadController ( GamepadController controller)

Set gamepad controller or null.

Version
1.20

References getMouseLocation(), and pMouseLocation.

Referenced by sendEventToListeners(), and setHoverWidget().

◆ setHoverWidget()

void Dragengine.Gui.Desktop.setHoverWidget ( Widget widget,
MouseEvent event )
protected

Set widget the mouse hovers above.

If widget is different than the old one enter and leave messages are send.

References setGamepadController(), and setToolTipManager().

Referenced by addMousePointerListener(), removeMousePointerListener(), sendEventToListeners(), and warpMousePointer().

◆ setIsMouseHidden()

void Dragengine.Gui.Desktop.setIsMouseHidden ( bool hidden)

◆ setMouseArea()

void Dragengine.Gui.Desktop.setMouseArea ( RectArea area)

Set movement area of the mouse pointer or null to clear.

References pDragWindow.

Referenced by sendEventToListeners().

◆ setMouseLocation()

void Dragengine.Gui.Desktop.setMouseLocation ( Point location)

Set location of mouse pointer.

Location is clamped to the mouse movement area.

References Dragengine.Gui.Widget.getParent(), and Dragengine.Gui.Widget.getVisible().

Referenced by processEvent(), and sendEventToListeners().

◆ setNoWindowBorder()

void Dragengine.Gui.Desktop.setNoWindowBorder ( BorderSize size)

Set area along the borders no window can occupy.

References clearDragWindow().

Referenced by sendEventToListeners().

◆ setToolTipManager()

void Dragengine.Gui.Desktop.setToolTipManager ( ToolTipManager tooltipManager)

Set tool tip manager or null.

Version
1.7

References pTrackDecoration.

Referenced by sendEventToListeners(), and setHoverWidget().

◆ setTrackDecoration()

void Dragengine.Gui.Desktop.setTrackDecoration ( Window window)
protected

Set decoration whose state is tracked or null.

Referenced by requestGrabFocus(), and sendEventToListeners().

◆ setTrackDecorationAreaHover()

void Dragengine.Gui.Desktop.setTrackDecorationAreaHover ( Decoration.Area areaHover)
protected

◆ setWindowVirtualKeyboard()

void Dragengine.Gui.Desktop.setWindowVirtualKeyboard ( WindowVirtualKeyboard window)

Set virtual keyboard window or null.

Version
1.7

References pTrackDecoration.

Referenced by getHoverWidget(), and sendEventToListeners().

◆ warpCenterMouse()

void Dragengine.Gui.Desktop.warpCenterMouse ( )

Warp mouse pointer centered in desktop.

Use this method if you move the moue pointer directly as otherwise the appropriate messages are not send.

References pBlockSetHoverWidget.

Referenced by onMousePointerShown().

◆ warpCenterMouseIn()

void Dragengine.Gui.Desktop.warpCenterMouseIn ( Widget widget)

Warp mouse pointer centered inside widget.

Use this method if you move the moue pointer directly as otherwise the appropriate messages are not send.

References Dragengine.Gui.Container.runWhileBlockingLayout().

Referenced by onMousePointerChanged().

◆ warpMouseFocusLocation() [1/2]

void Dragengine.Gui.Desktop.warpMouseFocusLocation ( )

Warp mouse pointer on focus widget using directional focus location.

Version
1.29

Does nothing if focus widget is not present.

References Dragengine.Gui.Widget.sendEvent(), and setActiveMousePointer().

◆ warpMouseFocusLocation() [2/2]

void Dragengine.Gui.Desktop.warpMouseFocusLocation ( Widget widget)

Warp mouse pointer on widget using directional focus location.

Version
1.29

References setActiveMousePointer().

Referenced by sendEventToListeners().

◆ warpMouseIn()

void Dragengine.Gui.Desktop.warpMouseIn ( Widget widget,
Point location )

Warp mouse pointer relative to widget.

Use this method if you move the moue pointer directly as otherwise the appropriate messages are not send.

References getHoverWidget().

Referenced by onMousePointerChanged(), onResize(), and sendEventToListeners().

◆ warpMousePointer()

void Dragengine.Gui.Desktop.warpMousePointer ( Point location)

Warp mouse pointer.

Use this method if you move the moue pointer directly as otherwise the appropriate messages are not send.

References pBlockSetHoverWidget, and setHoverWidget().

Referenced by layoutParent(), onMousePointerShown(), and onResize().

◆ widgetAcceptingInputAt()

Widget Dragengine.Gui.Desktop.widgetAcceptingInputAt ( Point position)

Widget accepting input at position.

Version
1.17

References getActiveWindow(), and getFocusWidget().

Referenced by addWindow().

Member Data Documentation

◆ pActiveMousePointer

MousePointerFactory Dragengine.Gui.Desktop.pActiveMousePointer

Referenced by sendEventToListeners().

◆ pBlockSetHoverWidget

bool Dragengine.Gui.Desktop.pBlockSetHoverWidget

◆ pDragArea

Decoration.Area Dragengine.Gui.Desktop.pDragArea

◆ pDragOffset

Point Dragengine.Gui.Desktop.pDragOffset

Referenced by dispose(), and sendEventToListeners().

◆ pDragWindow

Window Dragengine.Gui.Desktop.pDragWindow

◆ pFocusWidget

◆ pGamepadController

GamepadController Dragengine.Gui.Desktop.pGamepadController

Referenced by sendEventToListeners().

◆ pMouseArea

RectArea Dragengine.Gui.Desktop.pMouseArea

◆ pMouseHidden

bool Dragengine.Gui.Desktop.pMouseHidden

◆ pMouseLocation

Point Dragengine.Gui.Desktop.pMouseLocation

◆ pMousePointerInstance

MousePointer Dragengine.Gui.Desktop.pMousePointerInstance

◆ pMousePointerListeners

Array Dragengine.Gui.Desktop.pMousePointerListeners

◆ pNoWindowBorder

BorderSize Dragengine.Gui.Desktop.pNoWindowBorder

Referenced by dispose(), and sendEventToListeners().

◆ pToolTipManager

ToolTipManager Dragengine.Gui.Desktop.pToolTipManager

◆ pTrackDecoration

◆ pTrackDecorationAreaHover

◆ pWindowVirtualKeyboard

WindowVirtualKeyboard Dragengine.Gui.Desktop.pWindowVirtualKeyboard

Referenced by sendEventToListeners().


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