Class Panel
Panel UI control.
Inheritance
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorToolbox("GUI")]
public class Panel : ScrollableControl, IComparable, IDrawable
Constructors
Panel()
Panel(ScrollBars, Boolean)
Initializes a new instance of the Panel class.
Declaration
public Panel(ScrollBars scrollBars, bool autoFocus = false)
Parameters
ScrollBars
scrollBars
The scroll bars. |
System.Boolean
autoFocus
True if control can accept user focus |
Properties
AlwaysShowScrollbars
Gets or sets a value indicating whether always show scrollbars. Otherwise show them only if scrolling is available.
Declaration
[EditorDisplay("Scrollbar Style", null)]
[EditorOrder(1502)]
[Tooltip("Whether always show scrollbars. Otherwise show them only if scrolling is available.")]
public bool AlwaysShowScrollbars { get; set; }
Property Value
System.Boolean
|
ControlsBounds
Gets the cached scroll area bounds. Used to scroll contents of the panel control. Cached during performing layout.
Declaration
public Rectangle ControlsBounds { get; }
Property Value
Rectangle
|
ScrollBars
Gets or sets the scroll bars usage by this panel.
Declaration
[EditorDisplay("Scrollbar Style", null)]
[EditorOrder(1500)]
[Tooltip("The scroll bars usage.")]
public ScrollBars ScrollBars { get; set; }
Property Value
ScrollBars
|
ScrollBarsSize
Gets or sets the size of the scroll bars.
Declaration
[EditorDisplay("Scrollbar Style", null)]
[EditorOrder(1501)]
[Tooltip("Scroll bars size.")]
public float ScrollBarsSize { get; set; }
Property Value
System.Single
|
ScrollbarThumbColor
The color of the scroll bar thumb.
Declaration
[EditorDisplay("Scrollbar Style", null)]
[EditorOrder(1601)]
public Color ScrollbarThumbColor { get; set; }
Property Value
Color
|
ScrollbarThumbSelectedColor
The color of the scroll bar thumb when selected.
Declaration
[EditorDisplay("Scrollbar Style", null)]
[EditorOrder(1602)]
public Color ScrollbarThumbSelectedColor { get; set; }
Property Value
Color
|
ScrollbarTrackColor
The color of the scroll bar track.
Declaration
[EditorDisplay("Scrollbar Style", null)]
[EditorOrder(1600)]
[ExpandGroups]
public Color ScrollbarTrackColor { get; set; }
Property Value
Color
|
ScrollMargin
Gets or sets the scroll margin applies to the child controls area. Can be used to expand the scroll area bounds by adding a margin.
Declaration
[EditorDisplay("Scrollbar Style", null)]
[EditorOrder(1503)]
[Tooltip("Scroll margin applies to the child controls area. Can be used to expand the scroll area bounds by adding a margin.")]
public Margin ScrollMargin { get; set; }
Property Value
Margin
|
ViewBottom
Methods
Arrange()
Arranges the child controls.
Declaration
protected virtual void Arrange()
ArrangeAndGetBounds()
Arranges the child controls and gets their bounds.
Declaration
protected virtual void ArrangeAndGetBounds()
ContainsPoint(ref Float2, Boolean)
Checks if this control contains given point in local Control Space.
Declaration
public override bool ContainsPoint(ref Float2 location, bool precise = false)
Parameters
Float2
location
Point location in Control Space to check |
System.Boolean
precise
True if perform precise intersection test against the control content (eg. with hit mask or transparency threshold). Otherwise, only simple bounds-check will be performed. |
Returns
System.Boolean
True if point is inside control's area, otherwise false. |
Overrides
DisposeChildren()
Removes and disposes all the child controls
Declaration
public override void DisposeChildren()
Overrides
Draw()
Draw the control and the children.
Declaration
public override void Draw()
Overrides
FastScroll()
Cuts the scroll bars value smoothing and imminently goes to the target scroll value.
Declaration
public void FastScroll()
GetDesireClientArea(out Rectangle)
Gets the desire client area rectangle for all the controls.
Declaration
public override void GetDesireClientArea(out Rectangle rect)
Parameters
Rectangle
rect
The client area rectangle for child controls. |
Overrides
IntersectsChildContent(Control, Float2, out Float2)
Declaration
public override bool IntersectsChildContent(Control child, Float2 location, out Float2 childSpaceLocation)
Parameters
Control
child
|
Float2
location
|
Float2
childSpaceLocation
|
Returns
System.Boolean
|
Overrides
OnChildResized(Control)
Called when child control gets resized.
Declaration
public override void OnChildResized(Control control)
Parameters
Control
control
The resized control. |
Overrides
OnDragMove(ref Float2, DragData)
When mouse dragging moves over control's area
Declaration
public override DragDropEffect OnDragMove(ref Float2 location, DragData data)
Parameters
Float2
location
Mouse location in Control Space |
DragData
data
The data. See DragDataText and DragDataFiles. |
Returns
DragDropEffect
The drag event result effect. |
Overrides
OnMouseDown(Float2, MouseButton)
When mouse goes down over control's area
Declaration
public override bool OnMouseDown(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
MouseButton
button
Mouse buttons state (flags) |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnMouseWheel(Float2, Single)
When mouse wheel moves
Declaration
public override bool OnMouseWheel(Float2 location, float delta)
Parameters
Float2
location
Mouse location in Control Space |
System.Single
delta
Mouse wheel move delta. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. Normalized to [-1;1] range. |
Returns
System.Boolean
True if event has been handled |
Overrides
PerformLayout(Boolean)
Update control layout
Declaration
public override void PerformLayout(bool force = false)
Parameters
System.Boolean
force
True if perform layout by force even if cached state wants to skip it due to optimization. |
Overrides
PerformLayoutBeforeChildren()
Perform layout for that container control before performing it for child controls.
Declaration
protected override void PerformLayoutBeforeChildren()
Overrides
RemoveChildren()
Unlinks all the child controls.
Declaration
public override void RemoveChildren()
Overrides
ScrollViewTo(Float2, Boolean)
Scrolls the view to the given location.
Declaration
public void ScrollViewTo(Float2 location, bool fastScroll = false)
Parameters
Float2
location
The location. |
System.Boolean
fastScroll
True of scroll to the item quickly without smoothing. |
ScrollViewTo(Control, Boolean)
Scrolls the view to the given control area.
Declaration
public void ScrollViewTo(Control c, bool fastScroll = false)
Parameters
Control
c
The control. |
System.Boolean
fastScroll
True of scroll to the item quickly without smoothing. |
ScrollViewTo(Rectangle, Boolean)
Scrolls the view to the given area.
Declaration
public void ScrollViewTo(Rectangle bounds, bool fastScroll = false)
Parameters
Rectangle
bounds
The bounds. |
System.Boolean
fastScroll
True of scroll to the item quickly without smoothing. |
SetViewOffset(ref Float2)
Declaration
protected override void SetViewOffset(ref Float2 value)
Parameters
Float2
value
|