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
live now
Game Jam III
Ends
Fri 25 Sep
Theme
One More Round
The jam is running. Build something, or play the entries.
£
50,000
prizepool
View the jam
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
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
BaseTreeView
chevron_left
Classes
class
BaseTreeView
Constructors
lock
BaseTreeView
Properties
data_object
ActiveRowCount
data_object
AnchorRow
data_object
BindCount
data_object
CursorRow
data_object
HighlightFadeTime
data_object
HighlightTime
data_object
IndentWidth
data_object
IsDragging
data_object
NeedsRebuild
data_object
OverscanRows
data_object
PooledRowCount
data_object
RowCount
data_object
RowHeight
Methods
lock
AddRow
functions
BeginRename
lock
BindRow
lock
BuildRows
lock
CanRenameRow
lock
CheckForChanges
functions
ClearSelection
lock
ClearSelectionInternal
lock
FinalLayoutChildren
functions
GetParentRow
lock
GetRow
functions
GetRowDepth
functions
GetRowPanel
functions
GetSubtreeEnd
functions
HighlightRow
lock
IsRowSelected
functions
MoveCursor
functions
OnButtonEvent
lock
OnClick
lock
OnDrop
functions
OnHotloaded
lock
OnRowActivated
lock
OnRowContextMenu
lock
OnRowDropped
lock
OnRowRenamed
lock
OnSelectionFinished
functions
RebindRows
functions
Rebuild
lock
RefreshRowStates
functions
ScrollToRow
functions
SelectRow
lock
SetRowOpen
lock
SetRowSelected
functions
Tick
functions
ToggleRow
BaseTreeView
A virtualized tree. Holds the flat list of visible rows, a pool of Sandbox.UI.TreeRow panels that are rebound as it scrolls, and all the index-based input handling. Knows nothing about the items themselves - Sandbox.UI.TreeView`1 supplies those.
class
Sandbox.UI
.
account_tree
extends
Panel
abstract
Sandbox.Engine
build
Constructors
1
BaseTreeView
(
)
data_object
Properties
13
ActiveRowCount
int
Number of row panels currently bound to a row.
AnchorRow
int
Where a shift-selection ranges from, or -1.
BindCount
int
How many times a row panel has been bound. Goes up on scroll and rebuild, never per frame.
CursorRow
int
The row keyboard navigation moves from, or -1.
HighlightFadeTime
float
How long the highlight takes to fade out, in seconds. Styled by the
highlight-fade
class.
HighlightTime
float
How long Sandbox.UI.BaseTreeView.HighlightRow(System.Int32) holds before it fades, in seconds.
IndentWidth
float
Extra left padding per level of depth.
IsDragging
bool
True while one of our rows is being dragged. The tree carries the
dragging
class.
NeedsRebuild
bool
Rebuild the flat row list on the next tick.
OverscanRows
int
Rows above and below the viewport that stay bound, so fast scrolls don't flash empty.
PooledRowCount
int
Number of row panels alive, bound or pooled.
RowCount
int
Number of rows currently reachable through open parents.
RowHeight
float
Height of a row when the tree has no per-item height.
functions
Methods
35
AddRow
(
height
,
depth
,
hasChildren
,
isOpen
)
Append a row during Sandbox.UI.BaseTreeView.BuildRows.
BeginRename
(
row
)
Start renaming a row's label in place, scrolling it into view first if needed.
BindRow
(
row
,
panel
)
Fill a pooled row panel with the item at this row.
BuildRows
(
)
Walk the data and call Sandbox.UI.BaseTreeView.AddRow(System.Single,System.Int32,System.Boolean,System.Boolean) for every reachable row, in order.
CanRenameRow
(
row
)
bool
CheckForChanges
(
)
Cheap per-tick check for data that changed underneath us. Set Sandbox.UI.BaseTreeView.NeedsRebuild if so.
ClearSelection
(
)
Drop the selection, keeping the cursor.
ClearSelectionInternal
(
)
FinalLayoutChildren
(
offset
)
GetParentRow
(
row
)
int
The nearest row above with one less depth, or -1 for a root.
GetRow
(
row
)
RowLayout
Layout of a row.
GetRowDepth
(
row
)
int
Depth of a row, roots being zero.
GetRowPanel
(
row
)
TreeRow
The bound panel for a row, or null if it isn't in the viewport.
GetSubtreeEnd
(
row
)
int
One past the last row inside this row's subtree.
HighlightRow
(
row
)
Flash a row so the eye finds it: the
highlight
class for Sandbox.UI.BaseTreeView.HighlightTime, then
highlight-fade
for Sandbox.UI.BaseTreeView.HighlightFadeTime.
IsRowSelected
(
row
)
bool
MoveCursor
(
delta
,
range
)
Move the cursor by some rows, selecting (or range-selecting with shift) where it lands.
OnButtonEvent
(
e
)
OnClick
(
e
)
OnDrop
(
e
)
OnHotloaded
(
)
OnRowActivated
(
row
)
OnRowContextMenu
(
row
)
OnRowDropped
(
targetRow
,
sourceRow
)
OnRowRenamed
(
row
,
text
)
OnSelectionFinished
(
)
RebindRows
(
)
Re-run Sandbox.UI.BaseTreeView.BindRow(System.Int32,Sandbox.UI.TreeRow) on every bound row without rebuilding the row list.
Rebuild
(
)
Rebuild everything now instead of waiting for the next tick.
RefreshRowStates
(
)
Push selection and open state into every bound row.
ScrollToRow
(
row
)
Scroll the least amount that brings this row fully into view.
SelectRow
(
row
,
toggle
,
range
)
Select a row the way a click would: plain replaces, ctrl toggles, shift ranges from the anchor.
SetRowOpen
(
row
,
open
,
recursive
)
SetRowSelected
(
row
,
selected
)
Tick
(
)
ToggleRow
(
row
,
recursive
)
Open or close a row. Shift-click on the expander does it recursively.
Inheritance
Panel
BaseTreeView
TreeView<T>
TreeView
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.