WrapPanel
class cAlgo.API
Positions the child elements in sequential position from left to right, breaking content to the next line at the end of the containing box, from top to bottom, or from right to left.
Environment behaviour
CLI — not supported. Accepted without error but never displayed, so control events such as Click are never raised.
Cloud — not supported. Accepted without error but never displayed, so control events such as Click are never raised.
Definition
public class WrapPanel : Panel
Namespace: cAlgo.API · Group: Layout · Inherits: Panel, ControlBase
Examples
using cAlgo.API;
namespace cAlgo
{
// This sample shows how to use the WrapPanel
public partial class WrapPanelSample : Indicator
{
protected override void Initialize()
{
var wrapPanel = new WrapPanel
{
BackgroundColor = Color.Gold,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
Orientation = PanelOrientation,
Width = 150,
Height = 150
};
for (int i = 0; i < 10; i++)
{
wrapPanel.AddChild(new TextBlock
{
Text = "Text",
Margin = 5,
ForegroundColor = Color.Black,
FontWeight = FontWeight.ExtraBold
});
}
Chart.AddControl(wrapPanel);
}
public override void Calculate(int index)
{
}
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def initialize(self):
wrapPanel = WrapPanel()
wrapPanel.BackgroundColor = Color.Gold
wrapPanel.HorizontalAlignment = HorizontalAlignment.Center
wrapPanel.VerticalAlignment = VerticalAlignment.Center
wrapPanel.Orientation = api.PanelOrientation
for i in range(10):
textBlock = TextBlock()
textBlock.Text = "Text"
textBlock.Margin = Thickness(5)
textBlock.ForegroundColor = Color.Black
textBlock.FontWeight = FontWeight.ExtraBold
wrapPanel.AddChild(textBlock)
api.Chart.AddControl(wrapPanel)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true,
"Parameters": [
{
"Name": "PanelOrientation",
"DisplayName": "Panel Orientation",
"Type": "Enum",
"EnumTypeFullName": "cAlgo.API.Orientation",
"DefaultValue": "Vertical"
}
]
}
Constructors
| Name | Description |
|---|---|
| WrapPanelDesktopCLICloud | Initializes a new instance of the WrapPanel class. |
Properties
| Name | Description |
|---|---|
ItemHeightDesktopCLIClouddouble | Gets or sets the height of the item. |
ItemWidthDesktopCLIClouddouble | Gets or sets the width of the item. |
OrientationDesktopCLICloudOrientation | Gets or sets the orientation of the child element. |
Inherited members
From Panel: AddChild, RemoveChild, HasChild, BackgroundColor, Children, ChildCount
From ControlBase: ResetProperty, UniqueId, Style, Left, Top, Right, Bottom, Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight, IsEnabled, IsVisible, Opacity, Margin, VerticalAlignment, HorizontalAlignment, Dock, IsHitTestVisible