Difference between revisions of "GUIWindow"
From Virtual World Web Wiki
(Documentation for the GUIWindow class) |
(Documentation for the GUIWindow class) |
||
Line 72: | Line 72: | ||
:: | :: | ||
::Event fired when the user starts dragging the window | ::Event fired when the user starts dragging the window | ||
+ | |||
+ | :{{CSharp|OnFocusChanged(EventHandler<FlexibleEventArgs<bool>>)}} | ||
:{{CSharp|OnResizeEnd()}} | :{{CSharp|OnResizeEnd()}} | ||
Line 89: | Line 91: | ||
:{{CSharp|void SetDockStyle(DockStyle dockStyle)}} | :{{CSharp|void SetDockStyle(DockStyle dockStyle)}} | ||
+ | |||
+ | :{{CSharp|void SetFocus()}} | ||
__NOTOC____NOEDITSECTION__ | __NOTOC____NOEDITSECTION__ |
Latest revision as of 12:11, 30 April 2019
A "standard" window that includes a draggable area, resize features, and a close button
- Inherits class: GUIBaseWindow
- This is a JavaScript visible object
Remarks [edit]
Properties
- bool AutoDock {get; set;}
- bool CanResize {get; set;}
- Can the user resize the window?
- GUIButton CloseButton {get;}
- Reference to the Close Button
- bool DestroyOnClose {get; set;}
- Should this window destoy itself when the close button is pressed (or just hide)?
- int DockStyle {get;}
- float DragAreaHeight {get; set;}
- The height of the area at the top of the window that allows for dragging
- TODO: Replace this with a proper RectTransform
- bool Draggable {get; set;}
- Allow this window to be dragged
- int EdgeSnap {get; set;}
- Distance (in pixels) to snap onto the edge of the screen
- bool KeepOnscreen {get; set;}
- Prevent the user from dragging the window off screen by keeping all 4 corners within the visible area
- JSVector2 MaxSize {get; set;}
- Specifies a maximum size the window can be resized to
- JSVector2 MinSize {get; set;}
- Specifies a minimum size the window can be resized to
- bool ShowMoveCursor {get; set;}
- Should we show the four-way move cursor when the user is over the draggable area?
- GUILabel Title {get;}
- Reference to the title text of the window
Events
- OnClose()
- Event fired when the Close button is pressed
- OnDragEnd()
- Event fired when the user releases the mouse to finish dragging the window
- OnDragMove()
- Event fired when the user is dragging the window
- OnDragStart()
- Event fired when the user starts dragging the window
- OnFocusChanged(EventHandler<FlexibleEventArgs<bool>>)
- OnResizeEnd()
- Event fired when the user releases the mouse to end a resize
Methods
- void Close()
- Trigger the close button's click function (to destroy or hide the window)
- void EnsureVisible()
- Make sure the window is inside the screen's viewing area
- void MoveToScreen(bool snap = false, int? edgeSnap = NULL)
- void SetDockStyle(DockStyle dockStyle)
- void SetFocus()