Drag[en]gine Script Module DragonScript Script API  1.0
Widget Class Reference
Inheritance diagram for Widget:
Container DisplayCanvas DisplayImage DisplayRotatingImage DisplayStyledText DisplayVideo Label ProgressBar ShoutConsole TextWidget WorldRenderer

Classes

class  RepeatKeyEventTimer
 Repeat key event timer. More...
 

Public Member Functions

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

Protected Member Functions

WidgetDesigner getDesignerFromTheme ()
 Get designer from gui theme. More...
 

Detailed Description

Widget base class. Represents a graphical screen component.

Author
Roland Pl├╝ss
Version
1.0

Member Function Documentation

◆ addDragListener()

void addDragListener ( DragListener  listener)

Add drag listener.

◆ addFocusListener()

void addFocusListener ( FocusListener  listener)

Add focus listener.

◆ addGamepadListener()

void addGamepadListener ( GamepadListener  listener)

Add gamepad listener.

◆ addKeyListener()

void addKeyListener ( KeyListener  listener)

Add key listener.

◆ addMouseListener()

void addMouseListener ( MouseListener  listener)

Add mouse listener.

◆ addStateChangeListener()

void addStateChangeListener ( StateChangeListener  listener)

Add state change listener.

◆ addWidgetListener()

void addWidgetListener ( WidgetListener  listener)

Add widget listener.

◆ canGrabFullFocus()

bool canGrabFullFocus ( )

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

◆ captureMouse()

void captureMouse ( )

Captures the mouse if not already captured by another widget.

◆ design()

void design ( )

Design widget using WidgetDesigner.

◆ dispose()

void dispose ( )

Disposes of the widget cleaning references.

◆ findFocusableWidget()

Widget findFocusableWidget ( )

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

◆ findLastFocusableWidget()

Widget findLastFocusableWidget ( )

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

◆ getBackgroundCanvasCreator()

CanvasCreator getBackgroundCanvasCreator ( )

Background canvas creator or null to use background color.

◆ getBorder()

Border getBorder ( )

Retrieves the border or null if not set.

◆ getBorderSize()

BorderSize getBorderSize ( )

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

◆ getBoundary()

RectArea getBoundary ( )

Rectangulare boundary of the widget.

◆ getBoundaryWithBorder()

RectArea getBoundaryWithBorder ( )

Rectangulare boundary of the widget including border.

◆ getCanFocus()

bool getCanFocus ( )

Retrieve if widget can get the focus.

◆ getCanvasBackground()

CanvasView getCanvasBackground ( )

Canvas view for the widget background.

◆ getCanvasContent()

CanvasView getCanvasContent ( )

Canvas view for the widget content.

◆ getCanvasWidget()

CanvasView getCanvasWidget ( )

Canvas view for the entire widget.

◆ getColorTransformation()

ColorMatrix getColorTransformation ( )

Color transformation.

◆ getDesigner()

WidgetDesigner getDesigner ( )

Designer.

◆ getDesignerFromTheme()

WidgetDesigner getDesignerFromTheme ( )
protected

Get designer from gui theme.

◆ getDesignerSelector()

String getDesignerSelector ( )

Designer selector.

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

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

◆ getDesktop()

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

◆ getDesktopPosition()

Point getDesktopPosition ( )

Widget position in desktop coordinates.

◆ getEnabled()

bool getEnabled ( )

Retrieve if widget is enabled.

◆ getFirstMousePointer()

MousePointerFactory getFirstMousePointer ( )

First assigned mouse pointer.

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

◆ getFont()

Font getFont ( )

Retrieve font of widget.

◆ getGuiTheme()

GuiTheme getGuiTheme ( )

Gui theme to use for this widget.

If an explicit gui theme is assigned it is used. Otherwise the gui theme of the parent widget is requested if present. If a gui theme selector is assigned the parent gui theme is queried for the gui theme with matching name. If no such gui theme exists the parent gui theme itself is used.

This list details the gui theme chosen in order of preference:

  • Assigned gui theme if not null
  • Named gui theme of parent gui theme if not null
  • Parent gui theme if not null
  • null gui theme

◆ getHasFocus()

bool getHasFocus ( )

Retrieve if widget has the focus.

◆ getHeight()

int getHeight ( )

Height of widget.

◆ getHorizontalRangeModel()

RangeModel getHorizontalRangeModel ( )

Horizontal range model for viewports to synchronize the horizontal scrollbar.

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

◆ getMinimumSize()

Point getMinimumSize ( )

Retrieve the minimal size of widget.

◆ getMinimumSizeForHeight()

Point getMinimumSizeForHeight ( int  height)

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

Default implementation uses getMinimumSize().

◆ getMinimumSizeForWidth()

Point getMinimumSizeForWidth ( int  width)

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

Default implementation uses getMinimumSize().

◆ getMinimumSizeWithBorder()

Point getMinimumSizeWithBorder ( )

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

◆ getMinimumSizeWithBorderForHeight()

Point getMinimumSizeWithBorderForHeight ( int  height)

Minimum size of widget with border using reference height.

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

◆ getMinimumSizeWithBorderForWidth()

Point getMinimumSizeWithBorderForWidth ( int  width)

Minimum size of widget with border for reference width.

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

◆ getMousePointer()

MousePointerFactory getMousePointer ( )

Mouse pointer to use.

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

◆ getPadding()

BorderSize getPadding ( )

Padding.

◆ getParent()

Container getParent ( )

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

◆ getPosition()

Point getPosition ( )

Position of the widget.

◆ getProtectBackgroundCanvasCreator()

bool getProtectBackgroundCanvasCreator ( )

Protect custom set background canvas creator.

◆ getProtectBorder()

bool getProtectBorder ( )

Protect custom set border.

◆ getProtectFont()

bool getProtectFont ( )

Protect custom set font.

◆ getProtectMinimumSize()

bool getProtectMinimumSize ( )

Protect custom set minimumsize.

◆ getProtectMousePointer()

bool getProtectMousePointer ( )

Protect custom set mouse pointer.

◆ getProtectPadding()

bool getProtectPadding ( )

Protect custom set padding.

◆ getProtectTextColor()

bool getProtectTextColor ( )

Protect custom set text color.

◆ getRelativePosition()

Point getRelativePosition ( Container  parent)

Widget position in parent widget coordinates.

◆ getScreenPosition()

Point getScreenPosition ( )

Widget position in screen coordinates.

◆ getScreenRectArea()

RectArea getScreenRectArea ( )

Retrieves the rect area on the screen of the widget.

◆ getSetMinimumSize()

Point getSetMinimumSize ( )

Retrieve the set minimal size of widget or null.

◆ getSize()

Point getSize ( )

Size of the widget.

◆ getTextColor()

Color getTextColor ( )

Text color.

◆ getThemeSelector()

String getThemeSelector ( )

Gui theme selector or null if not used.

◆ getTotalTransparency()

float getTotalTransparency ( )

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

◆ getTransformation()

TexMatrix2 getTransformation ( )

Transformation or null if not set.

◆ getTransparency()

float getTransparency ( )

Retrieve transparency of widget.

◆ getVerticalRangeModel()

RangeModel getVerticalRangeModel ( )

Vertical range model for viewports to synchronize the vertical scrollbar.

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

◆ getVisible()

bool getVisible ( )

Retrieve if widget is visible.

◆ getWidgetAt()

Widget getWidgetAt ( Point  position)

Widget at coordinates or null if not found.

◆ getWidth()

int getWidth ( )

Width of widget.

◆ getWindow()

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

◆ getWindowPosition()

Point getWindowPosition ( )

Widget position in window coordinates.

◆ getX()

int getX ( )

X position of widget.

◆ getY()

int getY ( )

Y position of widget.

◆ grabFocus()

void grabFocus ( )

Makes the widget grab the focus if possible.

◆ hasParent()

bool hasParent ( Container  container)

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

◆ isDesignerSet()

bool isDesignerSet ( )

Custom designer is set.

◆ isFullEnabled()

bool isFullEnabled ( )

Widget and all parent widgets are enabled.

◆ isGuiThemeSet()

bool isGuiThemeSet ( )

Determines if this widget has the theme set explicitly.

◆ isMinimumSizeSet()

bool isMinimumSizeSet ( )

Determines if the minimal size is set explicitly.

◆ isMouseInside()

bool isMouseInside ( )

Mouse is hovering over this widget.

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

◆ isPointInside()

bool isPointInside ( Point  position)

Determines if the given point lies inside the widget. This returns true if the x and y coordinates are bigger or equal 0 and are less tha width or height of the widget.

◆ isTransformationSet()

bool isTransformationSet ( )

Transformation is set.

◆ layoutParent()

void layoutParent ( )

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

◆ new() [1/2]

Widget new ( )

Create widget.

◆ new() [2/2]

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.

◆ nextFocusWidget()

Widget nextFocusWidget ( )

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

◆ notifyBorderParametersChanged()

void notifyBorderParametersChanged ( )

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

◆ onButtonPress()

void onButtonPress ( MouseEvent  event)

Notification that a mouse button has been pressed. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onButtonRelease()

void onButtonRelease ( MouseEvent  event)

Notification that a mouse button has been released. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onDesignerChanged()

void onDesignerChanged ( )

Designer changed.

◆ onDesignerSelectorChanged()

void onDesignerSelectorChanged ( )

Designer selector changed.

◆ onDispose()

void onDispose ( WidgetEvent  event)

Window is disposing.

Sends event to listeners.

◆ onDragDrop()

void onDragDrop ( DragEvent  event)

Notification that a drag operation ends with a drop on the widget. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onDragEnter()

void onDragEnter ( DragEvent  event)

Notification that a drag operation enters the widget. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onDragLeave()

void onDragLeave ( DragEvent  event)

Notification that a drag operation leaves the widget. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onDragOver()

void onDragOver ( DragEvent  event)

Notification that a drag operatio is in progress over the widget. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onFocusLost()

void onFocusLost ( FocusEvent  event)

Widget lost focus.

Sends event to listeners.

◆ onFocusReceived()

void onFocusReceived ( FocusEvent  event)

Widget received focus.

Sends event to listeners.

◆ onGamepadAxisMoved()

void onGamepadAxisMoved ( GamepadEvent  event)

Gamepad axis has been moved.

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

◆ onGamepadButtonPressed()

void onGamepadButtonPressed ( GamepadEvent  event)

Gamepad button has been pressed.

Default behaviour sends event to all gamepad listeners or propagates event to parent if allowed. grabFocus() is not called automatically.

◆ onGamepadButtonReleased()

void onGamepadButtonReleased ( GamepadEvent  event)

Gamepad button has been released.

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

◆ onGuiThemeChanged()

void onGuiThemeChanged ( )

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

◆ onHidden()

void onHidden ( WidgetEvent  event)

Widget has been hidden.

Sends event to listeners.

◆ onKeyPress()

void onKeyPress ( KeyEvent  event)

Notification that a key on the keyboard has been pressed. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onKeyRelease()

void onKeyRelease ( KeyEvent  event)

Notification that a key on the keyboard has been released. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onMouseEnter()

void onMouseEnter ( MouseEvent  event)

Notification that the mouse entered the widget. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onMouseLeave()

void onMouseLeave ( MouseEvent  event)

Notification that the mouse left the widget. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onMouseMove()

void onMouseMove ( MouseEvent  event)

Notification that the mouse has moved. The default behaviour is to send the message to all registered listeners or propagate it back to the parent if allowed.

◆ onMouseWheel()

void onMouseWheel ( MouseEvent  event)

Mouse wheel has moved.

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

◆ onPaddingChanged()

void onPaddingChanged ( )

Padding changed.

◆ onParentStateChanged()

void onParentStateChanged ( )

Parent state changed.

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

The default implementation triggers a design() call.

◆ onReposition()

void onReposition ( WidgetEvent  event)

Position changed.

Sends event to listeners.

◆ onResize()

void onResize ( WidgetEvent  event)

Size changed.

Sends event to listeners.

◆ onSetBackgroundColor()

void onSetBackgroundColor ( )

Background color changed.

◆ onSetFont()

void onSetFont ( )

Notification that the widget font changed.

◆ onSetTextColor()

void onSetTextColor ( )

Text color changed.

◆ onShown()

void onShown ( WidgetEvent  event)

Widget has been shown.

Sends event to listeners.

◆ onStateChanged()

void onStateChanged ( StateChangeEvent  event)

State changed.

Sends event to listeners.

◆ prevFocusWidget()

Widget prevFocusWidget ( )

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

◆ processEvent()

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

◆ releaseMouse()

void releaseMouse ( )

Release mouse capture.

◆ removeDragListener()

void removeDragListener ( DragListener  listener)

Remove a drag listener.

◆ removeFocusListener()

void removeFocusListener ( FocusListener  listener)

Remove focus listener.

◆ removeGamepadListener()

void removeGamepadListener ( GamepadListener  listener)

Remove gamepad listener.

◆ removeKeyListener()

void removeKeyListener ( KeyListener  listener)

Remove key listener.

◆ removeMouseListener()

void removeMouseListener ( MouseListener  listener)

Remove mouse listener.

◆ removeStateChangeListener()

void removeStateChangeListener ( StateChangeListener  listener)

Remove state change listener.

◆ removeWidgetListener()

void removeWidgetListener ( WidgetListener  listener)

Remove widget listener.

◆ requestGrabFocus()

void requestGrabFocus ( Widget  widget)

Request to focus the specified widget.

◆ sendEvent()

void sendEvent ( Event  event)

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

◆ sendEventToListeners()

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

◆ setBackgroundCanvasCreator()

void setBackgroundCanvasCreator ( CanvasCreator  creator)

Set background canvas creator or null to use background color.

◆ setBorder()

void setBorder ( Border  border)

Sets the border or null if not set.

◆ setCanFocus()

void setCanFocus ( bool  canFocus)

Sets if widget can get the focus.

◆ setColorTransformation()

void setColorTransformation ( ColorMatrix  transformation)

Set color transformation.

◆ setDesigner()

void setDesigner ( WidgetDesigner  designer)

Set designer.

◆ setDesignerSelector()

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

◆ setEnabled()

void setEnabled ( bool  enabled)

Sets if widget is enabled.

◆ setFont()

void setFont ( Font  font)

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

◆ setGuiTheme()

void setGuiTheme ( GuiTheme  theme)

Sets the gui theme for this widget.

◆ setHasFocus()

void setHasFocus ( bool  hasFocus)

Sets if widget has the focus.

◆ setHeight()

void setHeight ( int  height)

Set height of widget.

◆ setMinimumSize()

void setMinimumSize ( Point  size)

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

◆ setMousePointer()

void setMousePointer ( MousePointerFactory  mousePointer)

Set mouse pointer to use.

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

◆ setPadding()

void setPadding ( BorderSize  padding)

Set padding.

◆ setParent()

void setParent ( Container  parent)

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

◆ setPosition()

void setPosition ( Point  position)

Set position of widget.

◆ setProtectBackgroundCanvasCreator()

void setProtectBackgroundCanvasCreator ( bool  protect)

Set protect custom set background canvas creator.

◆ setProtectBorder()

void setProtectBorder ( bool  protect)

Set protect custom set border.

◆ setProtectFont()

void setProtectFont ( bool  protect)

Set protect custom set font.

◆ setProtectMinimumSize()

void setProtectMinimumSize ( bool  protect)

Set protect custom set minimumsize.

◆ setProtectMousePointer()

void setProtectMousePointer ( bool  protect)

Set protect custom set mouse pointer.

◆ setProtectPadding()

void setProtectPadding ( bool  protect)

Set protect custom set padding.

◆ setProtectTextColor()

void setProtectTextColor ( bool  protect)

Set protect custom set text color.

◆ setSize()

void setSize ( Point  size)

Set size of widget.

◆ setTextColor()

void setTextColor ( Color  color)

Set text color.

◆ setThemeSelector()

void setThemeSelector ( String  selector)

Set gui theme selector or null if not used.

◆ setTransformation()

void setTransformation ( TexMatrix2  transformation)

Set transformation or null if not set.

◆ setTransparency()

void setTransparency ( float  transparency)

Sets transparency of widget.

◆ setVisible()

void setVisible ( bool  visible)

Sets if widget is visible.

◆ setWidth()

void setWidth ( int  width)

Set width of widget.

◆ setX()

void setX ( int  x)

Set X position of widget.

◆ setY()

void setY ( int  y)

Set Y Position of widget.

◆ stopRepeatEventTimer()

void stopRepeatEventTimer ( )

Stops the repeat key event timer.

◆ updateCanvasBackground()

void updateCanvasBackground ( )

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.


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