using cAlgo.API;
namespace cAlgo
{
// このサンプルは、ラジオボタンチャートコントロールの使用方法を示しています。
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class RadioButtonSample : Indicator
{
protected override void Initialize()
{
var stackPanel = new StackPanel
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
BackgroundColor = Color.Gold,
Opacity = 0.7
};
var firstRadioButton = new RadioButton
{
Text = "未チェック"
};
firstRadioButton.Checked += RadioButton_Checked;
firstRadioButton.Unchecked += RadioButton_Unchecked;
stackPanel.AddChild(firstRadioButton);
var secondRadioButton = new RadioButton
{
Text = "未チェック"
};
secondRadioButton.Checked += RadioButton_Checked;
secondRadioButton.Unchecked += RadioButton_Unchecked;
stackPanel.AddChild(secondRadioButton);
Chart.AddControl(stackPanel);
}
private void RadioButton_Unchecked(RadioButtonEventArgs obj)
{
var radioButton = obj.RadioButton;
radioButton.Text = "未チェック";
}
private void RadioButton_Checked(RadioButtonEventArgs obj)
{
var radioButton = obj.RadioButton;
radioButton.Text = "チェック済み";
}
public override void Calculate(int index)
{
}
}
}