Orientation
enum cAlgo.API
DesktopCLICloud
Defines the different orientations that panel layout can have.
Definition
public enum Orientation
Namespace: cAlgo.API · Group: Controls
Examples
using cAlgo.API;
namespace cAlgo
{
// This sample indicator shows how to set stack and wrap panels orientation
public partial class OrientationSample : Indicator
{
protected override void Initialize()
{
var stackPanel = new StackPanel
{
Orientation = Orientation,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
BackgroundColor = Color.Gold,
Opacity = 0.7,
};
stackPanel.AddChild(new TextBlock { Text = "First TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
stackPanel.AddChild(new TextBlock { Text = "Second TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
stackPanel.AddChild(new TextBlock { Text = "Third TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
stackPanel.AddChild(new TextBlock { Text = "Fourth TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black });
Chart.AddControl(stackPanel);
}
public override void Calculate(int index)
{
}
}
}
import clr
clr.AddReference("cAlgo.API")
from cAlgo.API import *
class Test():
def get_text_block(self, text):
textBlock = TextBlock()
textBlock.Text = text
textBlock.FontWeight = FontWeight.ExtraBold
textBlock.ForegroundColor = Color.Black
textBlock.Margin = Thickness(5)
return textBlock
def initialize(self):
stackPanel = StackPanel()
stackPanel.Orientation = api.Orientation
stackPanel.HorizontalAlignment = HorizontalAlignment.Center
stackPanel.VerticalAlignment = VerticalAlignment.Center
stackPanel.BackgroundColor = Color.Gold
stackPanel.Opacity = 0.7
stackPanel.AddChild(self.get_text_block("First TextBlock"))
stackPanel.AddChild(self.get_text_block("Second TextBlock"))
stackPanel.AddChild(self.get_text_block("Third TextBlock"))
stackPanel.AddChild(self.get_text_block("Fourth TextBlock"))
api.Chart.AddControl(stackPanel)
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true,
"Parameters": [
{
"Name": "Orientation",
"Type": "Enum",
"EnumTypeFullName": "cAlgo.API.Orientation",
"DefaultValue": "Vertical"
}
]
}
Values
| Name | Value | Description |
|---|---|---|
Horizontal | 0 | Elements in the panel layout should be horizontally oriented. |
Vertical | 1 | Elements in the panel layout should be vertically oriented. |