s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
Get s&box
Sign in with Steam
Api
Editor Classes
Widget
chevron_left
Editor Classes
class
Widget
Constructors
functions
Widget
Fields
crop_din
MouseClick
crop_din
MouseLeftPress
crop_din
MouseMiddlePress
crop_din
MouseMove
crop_din
MouseRelease
crop_din
MouseRightClick
crop_din
MouseRightPress
crop_din
OnPaintOverride
Properties
data_object
AcceptDrops
data_object
Children
data_object
ContentMargins
data_object
ContentRect
data_object
ContextMenuEnabled
data_object
Cursor
data_object
DebugModeEnabled
data_object
DeleteOnClose
data_object
DpiScale
data_object
Enabled
data_object
FixedHeight
data_object
FixedSize
data_object
FixedWidth
data_object
FocusMode
data_object
FocusProxy
data_object
HasMaximizeButton
data_object
Height
data_object
Hidden
data_object
HorizontalSizeMode
data_object
IsActiveWindow
data_object
IsBeingDroppedOn
data_object
IsDraggable
data_object
IsFocused
data_object
IsFramelessWindow
data_object
IsMaximized
data_object
IsMinimized
data_object
IsPopup
data_object
IsPressed
data_object
IsTooltip
data_object
IsUnderMouse
data_object
IsWindow
data_object
Layout
data_object
LocalRect
data_object
MaximumHeight
data_object
MaximumSize
data_object
MaximumWidth
data_object
MinimumHeight
data_object
MinimumSize
data_object
MinimumWidth
data_object
MouseTracking
data_object
Name
data_object
NoSystemBackground
data_object
Parent
data_object
PixmapCursor
data_object
Position
data_object
ProvidesDebugMode
data_object
ReadOnly
data_object
ScreenGeometry
data_object
ScreenPosition
data_object
ScreenRect
data_object
ShowWithoutActivating
data_object
Size
data_object
StatusTip
data_object
ToolTip
data_object
TranslucentBackground
data_object
TransparentForMouseEvents
data_object
UpdatesEnabled
data_object
VerticalSizeMode
data_object
Visible
data_object
Width
data_object
WindowFlags
data_object
WindowOpacity
data_object
WindowTitle
Methods
functions
AdjustSize
functions
AlignToParent
functions
Blur
functions
ChildValuesChanged
functions
ClearContext
functions
Close
functions
ConstrainTo
functions
ConstrainToScreen
functions
DestroyChildren
functions
DisableWindowActivation
lock
DoLayout
functions
Focus
lock
FocusNext
lock
FocusPrevious
functions
FromScreen
functions
GetAncestor
functions
GetContext
functions
GetDescendants
functions
GetWindow
functions
Hide
functions
IsAncestorOf
functions
IsDescendantOf
functions
IsModal
functions
Lower
functions
MakeMaximized
functions
MakeMinimized
functions
MakeSignal
functions
MakeWindowed
lock
MinimumSizeHint
lock
OnBlur
lock
OnClose
lock
OnClosed
lock
OnContextMenu
lock
OnDoubleClick
functions
OnDragDrop
functions
OnDragHover
functions
OnDragLeave
lock
OnDragStart
lock
OnFocus
lock
OnKeyPress
lock
OnKeyRelease
lock
OnMouseClick
lock
OnMouseEnter
lock
OnMouseLeave
lock
OnMouseMove
lock
OnMousePress
lock
OnMouseReleased
lock
OnMouseRightClick
lock
OnMouseWheel
lock
OnMoved
lock
OnPaint
lock
OnResize
lock
OnShortcutPressed
lock
OnVisibilityChanged
remove_circle
OnWheel
functions
PostKeyEvent
functions
Raise
functions
RestoreGeometry
functions
SaveGeometry
functions
SetContentHash
functions
SetContext
functions
SetEffectOpacity
functions
SetMaximized
functions
SetModal
functions
SetSizeMode
functions
SetStyles
functions
SetStylesheetFile
functions
SetWindowIcon
functions
Show
lock
Signal
lock
SignalValuesChanged
lock
SizeHint
functions
ToScreen
functions
Update
functions
UpdateGeometry
Widget
A generic widget.
class
Editor
.
account_tree
extends
QObject
Sandbox.Tools
build
Constructors
1
Widget
(
)
crop_din
Fields
8
MouseClick
Action
MouseLeftPress
Action
Called when this widget is left clicked (on mouse press).
MouseMiddlePress
Action
Called when this widget is clicked with the mouse wheel (on mouse press).
MouseMove
Action`1
MouseRelease
Action
MouseRightClick
Action
MouseRightPress
Action
Called when this widget is right clicked (on mouse press).
OnPaintOverride
Func`1
Override the widget's paint process. Return
to prevent the default paint action, which is to call Editor.Widget.OnPaint.
data_object
Properties
63
AcceptDrops
bool
Accept drag and dropping shit on us
Children
IEnumerable`1
Child widgets of this widget.
ContentMargins
Margin
ContentRect
Rect
ContextMenuEnabled
bool
Enables or disables the context menu on this widget.
Cursor
CursorShape
Cursor override for this widget.
DebugModeEnabled
bool
Enable debug mode on this widget.
DeleteOnClose
bool
Delete this widget when close is pressed
DpiScale
float
The scale this widget is using (multiplying Size by this value gives the actual native size)
Enabled
bool
Makes the widget not interactable. This is also usually be reflected visually by the widget. The widget will not process any keyboard or mouse inputs. Applies retroactively to all children.
FixedHeight
float
Sets the fixed height for this widget
FixedSize
Vector2
FixedWidth
float
Sets the fixed width for this widget
FocusMode
FocusMode
Sets the focus mode for this widget. This determines both how it will get focus and whether it will receive keyboard input.
FocusProxy
Widget
HasMaximizeButton
bool
Height
float
Utility to interact with a widget's width - use Size where possible
Hidden
bool
Whether this widget is hidden. This differs from Visible because this will return the state for this particular widget, where as Visible returns false if a parent is hidden etc.
HorizontalSizeMode
SizeMode
IsActiveWindow
bool
IsBeingDroppedOn
bool
Whether something is being dragged over this widget.
IsDraggable
bool
Whether this widget can be drag and dropped onto other widgets.
IsFocused
bool
Whether this widget has keyboard focus.
IsFramelessWindow
bool
IsMaximized
bool
IsMinimized
bool
IsPopup
bool
IsPressed
bool
Whether this widget is currently being pressed down or not.
IsTooltip
bool
IsUnderMouse
bool
IsWindow
bool
Layout
Layout
The widget's internal layout, if any
LocalRect
Rect
This panel's rect at 0,0
MaximumHeight
float
This widgets height should never be larger than the given value.
MaximumSize
Vector2
Sets Editor.Widget.MaximumWidth and Editor.Widget.MaximumHeight simultaneously.
MaximumWidth
float
This widgets width should never be larger than the given value.
MinimumHeight
float
This widgets height should never be smaller than the given value.
MinimumSize
Vector2
Sets Editor.Widget.MinimumWidth and Editor.Widget.MinimumHeight simultaneously.
MinimumWidth
float
This widgets width should never be smaller than the given value.
MouseTracking
bool
Name
string
Name of the widget, usually for debugging purposes.
NoSystemBackground
bool
Parent
Widget
Parent widget. If non null, position of this widget will be relative to the parent widget. Certain events will also propagate to the parent widget if unhandled.
PixmapCursor
Pixmap
Custom cursor override for this widget. Will override Editor.Widget.Cursor with Editor.CursorShape.CustomCursor.
Position
Vector2
Position of this widget, relative to its parent if it has one.
ProvidesDebugMode
bool
If true then this widget has a debug mode that can be activated
ReadOnly
bool
Makes the widget read only. I.e. You can copy text of a text entry, but can't edit it. Applies retroactively to all children.
ScreenGeometry
Rect
Returns the geometry of the screen this widget is currently on.
ScreenPosition
Vector2
Position of the widget relative to the monitor's top left corner.
ScreenRect
Rect
This panel's rect in screen coordinates
ShowWithoutActivating
bool
Size
Vector2
Size of this widget.
StatusTip
string
If set, hovering over this widget will set the text of a Editor.StatusBar of the window the widget belongs to.
ToolTip
string
If set, this text will be displayed after a certain delay of hovering this widget with the mouse cursor.
TranslucentBackground
bool
TransparentForMouseEvents
bool
UpdatesEnabled
bool
If true, Update will call
VerticalSizeMode
SizeMode
Visible
bool
Whether this widget is visible or not, in the tree. This will return false if a parent is hidden. You might want to set Hidden if you're looking to check local visible status on a widget.
Width
float
Utility to interact with a widget's width - use Size where possible
WindowFlags
WindowFlags
WindowOpacity
float
WindowTitle
string
functions
Methods
75
AdjustSize
(
)
Adjusts the size of the widget to fit its contents.
AlignToParent
(
alignment
,
offset
)
Align this widget to its parents edge, with an offset.
Blur
(
)
Clear keyboard focus from this widget.
ChildValuesChanged
(
source
)
ClearContext
(
key
)
Remove a context on this widget. This will NOT remove contexts set from parent objects.
Close
(
)
If a window - will close
ConstrainTo
(
parentRect
)
Reposition this widget to ensure it is within the given rectangle.
ConstrainToScreen
(
)
Constrain this widget to the screen it's currently on.
DestroyChildren
(
)
Destroys all child widgets of this widget.
DisableWindowActivation
(
)
Calling this will set the WS_EX_NOACTIVATE flag on the window internally, which will stop it taking focus away from other windows.
DoLayout
(
)
Called to make sure all child panels are in correct positions and have correct sizes. This is typically called when the size of this widget changes, but there are other cases as well.
Focus
(
activateWindow
)
FocusNext
(
)
bool
Called when Tab is pressed to find the next widget to focus. Return true to prevent focusing.
FocusPrevious
(
)
bool
Called when Shift + Tab is pressed to find the next widget to focus. Return true to prevent focusing.
FromScreen
(
p
)
Vector2
Transform coordinates relative to the monitors's top left corner, to coordinates relative to panel's top left corner.
GetAncestor
(
)
T
Find the closest ancestor widget of type
GetContext
(
key
,
defaultIfMissing
)
T
Find a context on this widget. If not found, look at the parent. If not found, look at the parent. This is useful for passing information down to child widgets without any effort.
GetDescendants
(
)
IEnumerable`1
Get all descendants of type T
GetWindow
(
)
Widget
Get the top level window widget
Hide
(
)
Make this widget not visible.
IsAncestorOf
(
child
)
bool
Returns whether or not the specified Widget is an ancestor of this Widget.
IsDescendantOf
(
parent
)
bool
Returns whether or not the specified Widget is a descendent of this Widget.
IsModal
(
)
bool
Returns true if this is a modal window. This means it will appear on top of everything and block input to everything else.
Lower
(
)
Lowers the widget to the bottom of the parent widget's stack. After this call the widget will be visually behind (and therefore obscured by) any overlapping sibling widgets.
MakeMaximized
(
)
MakeMinimized
(
)
MakeSignal
(
name
)
MakeWindowed
(
)
MinimumSizeHint
(
)
Vector2
Return the minimum size this widget wants to be
OnBlur
(
reason
)
Called when the widget loses keyboard focus.
OnClose
(
)
bool
Called when a window is about to be closed.
OnClosed
(
)
Called when a window is closed.
OnContextMenu
(
e
)
Called after Editor.Widget.OnMouseRightClick(Editor.MouseEvent), for the purposes of opening a context menu.
OnDoubleClick
(
e
)
Called when the widget was double clicked with any mouse button.
OnDragDrop
(
ev
)
Something was dragged and dropped on this widget. Apply the data here, if its valid.
Requires Editor.Widget.AcceptDrops to function.
OnDragHover
(
ev
)
Cursor with drag and drop data moved on this widget.
Requires Editor.Widget.AcceptDrops to function.
OnDragLeave
(
)
Cursor with drag and drop data left the bounds of this widget.
Requires Editor.Widget.AcceptDrops to function.
OnDragStart
(
)
Called when dragging. Editor.Widget.IsDraggable should be true.
OnFocus
(
reason
)
Called when the widget gains keyboard focus.
OnKeyPress
(
e
)
A key has been pressed. Your widget needs keyboard focus for this to be called - see FocusMode.
OnKeyRelease
(
e
)
A key has been released.
OnMouseClick
(
e
)
Called when this widget is left clicked (on mouse release).
OnMouseEnter
(
)
Mouse cursor entered the bounds of this widget.
OnMouseLeave
(
)
Mouse cursor exited the bounds of this widget.
OnMouseMove
(
e
)
Called when the mouse cursor is moved while being over this widget.
OnMousePress
(
e
)
Called when mouse is pressed over this widget.
OnMouseReleased
(
e
)
Called when mouse is released over this widget.
OnMouseRightClick
(
e
)
Called when this widget is right clicked (on mouse release).
OnMouseWheel
(
e
)
Mouse wheel was scrolled while the mouse cursor was over this widget.
OnMoved
(
)
Called when the widget was moved to a new position relative to it's parent.
OnPaint
(
)
Override to custom paint your widget, for example using Editor.Paint. Can be overwritten by Editor.Widget.OnPaintOverride.
OnResize
(
)
Called when the widgets' size was changed.
OnShortcutPressed
(
e
)
A shortcut has been activated. This is called on the focused control so they can override it.
OnVisibilityChanged
(
visible
)
Called when the visibility of this widget changes.
OnWheel
(
e
)
obsolete
Mouse wheel was scrolled while the mouse cursor was over this widget.
PostKeyEvent
(
key
)
Raise
(
)
Raises this widget to the top of the parent widget's stack. After this call the widget will be visually in front of any overlapping sibling widgets.
RestoreGeometry
(
state
)
bool
Restore position and size previously stored via Editor.Widget.SaveGeometry. Returns false if the state is empty or no longer valid, e.g. after monitor or DPI changes.
SaveGeometry
(
)
string
Serialize position and size of this widget to a string, which can then be passed to Editor.Widget.RestoreGeometry(System.String).
SetContentHash
(
hash
,
secondsDebounce
)
bool
Call every frame/tick to redraw this Widget on content change
SetContext
(
key
,
value
)
Set a context value on this widget. This context will be available to its children via FindContext.
SetEffectOpacity
(
f
)
SetMaximized
(
maximized
)
Set the maximized window state without showing the window, unlike Editor.Widget.MakeMaximized.
SetModal
(
on
,
application
)
Set this window to be modal. This means it will appear on top of everything and block input to everything else.
SetSizeMode
(
horizontal
,
vertical
)
SetStyles
(
sheet
)
Directly set CSS style sheet(s) for this widget. Same format as a .css file.
SetStylesheetFile
(
filename
)
Set a file to load CSS for this widget from.
SetWindowIcon
(
name
)
Show
(
)
Make this widget visible.
Signal
(
signal
)
SignalValuesChanged
(
)
When a value on this widget changed due to user input (ie, checking a box, editing a form) this is called, which sends a signal up the parent widgets.
SizeHint
(
)
Vector2
Should return the size this widget really wants to be if it can its way. The default is that you don't care - and just to return whatever the base value is.
ToScreen
(
p
)
Vector2
Transform coordinates relative to the panel's top left corner, to coordinates relative to monitors's top left corner.
Update
(
)
Tell this widget that shit changed and it needs to redraw
UpdateGeometry
(
)
Tell everything that the geometry of this has changed
Inheritance
QObject
Widget
AdvancedDropdownPanel
AdvancedDropdownWidget
BaseWindow
AboutWidget
Button
Clear
Danger
Primary
CategoryEntry
Checkbox
ComboBox
ComponentEditorWidget
ControlWidget
AnglesControlWidget
BBoxControlWidget
BoolControlWidget
DropdownControlWidget
EnumControlWidget
GamePackageControlWidget
GroupButtonControlWidget
HoldTypeControlWidget
MarginControlWidget
ModelDeformerOperationControlWidget
ModelDeformerShapeControlWidget
RectControlWidget
RotationControlWidget
SphereControlWidget
SpriteAnimationControlWidget
StringControlWidget
FloatControlWidget
IntegerControlWidget
TextAreaControlWidget
TransformControlWidget
VariantControlWidget
VectorControlWidget
VectorIntControlWidget
CreateModelFromMeshDialog
CreateSingleModelFromMeshDialog
DevToolsDock
Dialog
PackageSelector
ScenePasteSpecialDialog
DockManager
FileDialog
FloatSlider
Frame
BaseScrollWidget
BaseItemWidget
ListView
DockWidget
SceneRenderingWidget
ScrollArea
Splitter
LinkableSplitter
StackRow
GameScenePicker
GraphicsView
HammerManagedInspector
IconButton
WithCornerIcon
WithNumber
IconLabel
InspectorWidget
ItemEntry
Label
Body
Header
Small
Subtitle
Title
LineEdit
FolderEdit
Menu
AutoComplete
ContextMenu
MenuBar
PopupDialogWidget
PopupWidget
AdvancedDropdownPopup
ScrollBar
SegmentedControl
Separator
StatusBar
TabBar
TextEdit
TitleBarButtons
ToolBar
ToolButton
Window
DockWindow
EditorMainWindow
HammerMainWindow
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.