Class DropPanel
Drop Panel arranges control vertically and provides feature to collapse contents.
Implements
Namespace: FlaxEngine.GUI
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorToolbox("GUI")]
public class DropPanel : ContainerControl, IComparable, IDrawable
Constructors
DropPanel()
Fields
_animationProgress
The animation progress (normalized).
Declaration
protected float _animationProgress
Field Value
System.Single
|
_cachedHeight
The cached height of the control.
Declaration
protected float _cachedHeight
Field Value
System.Single
|
_headerHeight
The header height.
Declaration
protected float _headerHeight
Field Value
System.Single
|
_headerTextMargin
_isClosed
The 'is closed' flag.
Declaration
protected bool _isClosed
Field Value
System.Boolean
|
_itemsMargin
_mouseButtonLeftDown
The 'mouse down' flag (over header) for the left mouse button.
Declaration
protected bool _mouseButtonLeftDown
Field Value
System.Boolean
|
_mouseButtonRightDown
The 'mouse down' flag (over header) for the right mouse button.
Declaration
protected bool _mouseButtonRightDown
Field Value
System.Boolean
|
_mouseOverHeader
The 'mouse over header' flag (over header).
Declaration
protected bool _mouseOverHeader
Field Value
System.Boolean
|
HeaderTextColor
Gets or sets the color used to draw header text.
Declaration
[EditorDisplay("Header Style", null)]
[EditorOrder(2010)]
[ExpandGroups]
public Color HeaderTextColor
Field Value
Color
|
Properties
ArrowImageClosed
Gets or sets the image used to render drop panel drop arrow icon when panel is closed.
Declaration
[EditorDisplay("Icon Style", null)]
[EditorOrder(2031)]
[Tooltip("The image used to render drop panel drop arrow icon when panel is closed.")]
public IBrush ArrowImageClosed { get; set; }
Property Value
IBrush
|
ArrowImageOpened
Gets or sets the image used to render drop panel drop arrow icon when panel is opened.
Declaration
[EditorDisplay("Icon Style", null)]
[EditorOrder(2030)]
[Tooltip("The image used to render drop panel drop arrow icon when panel is opened.")]
[ExpandGroups]
public IBrush ArrowImageOpened { get; set; }
Property Value
IBrush
|
CloseAnimationTime
Gets or sets the panel close/open animation duration (in seconds).
Declaration
[EditorOrder(10)]
[Limit(0F, 100F, 0.01F)]
[Tooltip("The panel close/open animation duration (in seconds).")]
public float CloseAnimationTime { get; set; }
Property Value
System.Single
|
EnableContainmentLines
Gets or sets a value indicating whether to enable containment line drawing,
Declaration
[EditorOrder(2)]
public bool EnableContainmentLines { get; set; }
Property Value
System.Boolean
|
EnableDropDownIcon
Gets or sets a value indicating whether enable drop down icon drawing.
Declaration
[EditorOrder(1)]
public bool EnableDropDownIcon { get; set; }
Property Value
System.Boolean
|
HeaderColor
Gets or sets the color of the header.
Declaration
[EditorDisplay("Header Style", null)]
[EditorOrder(2011)]
public Color HeaderColor { get; set; }
Property Value
Color
|
HeaderColorMouseOver
Gets or sets the color of the header when mouse is over.
Declaration
[EditorDisplay("Header Style", null)]
[EditorOrder(2012)]
public Color HeaderColorMouseOver { get; set; }
Property Value
Color
|
HeaderHeight
Gets or sets the height of the header.
Declaration
[EditorOrder(20)]
[Limit(1F, 10000F, 0.1F)]
[Tooltip("The height of the panel header.")]
public float HeaderHeight { get; set; }
Property Value
System.Single
|
HeaderRectangle
Gets the header rectangle.
Declaration
protected Rectangle HeaderRectangle { get; }
Property Value
Rectangle
|
HeaderText
Gets or sets the header text.
Declaration
[EditorOrder(10)]
[Tooltip("The text to show on a panel header.")]
public string HeaderText { get; set; }
Property Value
System.String
|
HeaderTextFont
Gets or sets the font used to render panel header text.
Declaration
[EditorDisplay("Header Text Style", null)]
[EditorOrder(2020)]
[ExpandGroups]
public FontReference HeaderTextFont { get; set; }
Property Value
FontReference
|
HeaderTextMargin
Gets or sets the header margin.
Declaration
[EditorOrder(30)]
[Tooltip("The margin of the header text area.")]
public Margin HeaderTextMargin { get; set; }
Property Value
Margin
|
HeaderTextMaterial
Gets or sets the custom material used to render the text. It must has domain set to GUI and have a public texture parameter named Font used to sample font atlas texture with font characters data.
Declaration
[EditorDisplay("Header Text Style", null)]
[EditorOrder(2021)]
[Tooltip("Custom material used to render the header text. It must has domain set to GUI and have a public texture parameter named Font used to sample font atlas texture with font characters data.")]
public MaterialBase HeaderTextMaterial { get; set; }
Property Value
MaterialBase
|
IsClosed
Gets or sets a value indicating whether this panel is closed.
Declaration
[EditorOrder(0)]
[Tooltip("If checked, the panel is closed, otherwise is open.")]
public bool IsClosed { get; set; }
Property Value
System.Boolean
|
ItemsMargin
Gets or sets the item slots margin (the space between items).
Declaration
[EditorOrder(10)]
[Tooltip("The item slots margin (the space between items).")]
public Margin ItemsMargin { get; set; }
Property Value
Margin
|
ShowTooltip
Gets a value indicating whether show control tooltip (control is in a proper state, tooltip text is valid, etc.). Can be used to implement custom conditions for showing tooltips (eg. based on current mouse location within the control bounds).
Declaration
protected override bool ShowTooltip { get; }
Property Value
System.Boolean
|
Overrides
Remarks
Tooltip can be only visible if mouse is over the control area (see IsMouseOver).
Methods
CanNavigateChild(Control)
Close(Boolean)
Closes the group.
Declaration
public void Close(bool animate = false)
Parameters
System.Boolean
animate
Enable/disable animation feature. |
Draw()
Draw the control and the children.
Declaration
public override void Draw()
Overrides
DrawChildren()
Draws the children. Can be overridden to provide some customizations. Draw is performed with applied clipping mask for the client area.
Declaration
protected override void DrawChildren()
Overrides
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
OnChildResized(Control)
Called when child control gets resized.
Declaration
public override void OnChildResized(Control control)
Parameters
Control
control
The resized control. |
Overrides
OnMouseDoubleClick(Float2, MouseButton)
When mouse double clicks over control's area
Declaration
public override bool OnMouseDoubleClick(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
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
OnMouseLeave()
When mouse leaves control's area
Declaration
public override void OnMouseLeave()
Overrides
OnMouseMove(Float2)
When mouse moves over control's area
Declaration
public override void OnMouseMove(Float2 location)
Parameters
Float2
location
Mouse location in Control Space |
Overrides
OnMouseUp(Float2, MouseButton)
When mouse goes up over control's area
Declaration
public override bool OnMouseUp(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
OnShowTooltip(out String, out Float2, out Rectangle)
Called when tooltip wants to be shown. Allows modifying its appearance.
Declaration
public override bool OnShowTooltip(out string text, out Float2 location, out Rectangle area)
Parameters
System.String
text
The tooltip text to show. |
Float2
location
The popup start location (in this control local space). |
Rectangle
area
The allowed area of mouse movement to show tooltip (in this control local space). |
Returns
System.Boolean
True if can show tooltip, otherwise false to skip. |
Overrides
OnTestTooltipOverControl(ref Float2)
Called when tooltip is visible and tests if the given mouse location (in control space) is valid (is over the content).
Declaration
public override bool OnTestTooltipOverControl(ref Float2 location)
Parameters
Float2
location
The location. |
Returns
System.Boolean
True if tooltip can be still visible, otherwise false. |
Overrides
Open(Boolean)
Opens the group.
Declaration
public void Open(bool animate = false)
Parameters
System.Boolean
animate
Enable/disable animation feature. |
PerformLayoutAfterChildren()
Perform layout for that container control after performing it for child controls.
Declaration
protected override void PerformLayoutAfterChildren()
Overrides
PerformLayoutBeforeChildren()
Perform layout for that container control before performing it for child controls.
Declaration
protected override void PerformLayoutBeforeChildren()
Overrides
Toggle()
Toggles open state
Declaration
public void Toggle()
Update(Single)
Perform control update and all its children
Declaration
public override void Update(float deltaTime)
Parameters
System.Single
deltaTime
Delta time in seconds |
Overrides
Events
IsClosedChanged
Occurs when drop panel is opened or closed.
Declaration
public event Action<DropPanel> IsClosedChanged
Event Type
System.Action<DropPanel>
|
MouseButtonRightClicked
Occurs when mouse right-clicks over the header.
Declaration
public event Action<DropPanel, Float2> MouseButtonRightClicked
Event Type
System.Action<DropPanel, Float2>
|