i would like to add an Eto.Forms.CheckBox to the Header of an Eto.Forms.GroupBox but have no idea how to do it. The purpose is that the CheckBox then enables/disables some content of the GroupBox. Is it possible with Eto any Python ?
The panel uses an Eto.Forms.CheckBox and a Rhino.UI.Controls.Divider.
I’ll let you do the Python port.
class CheckBoxSeparator : Panel
{
/// <summary>
/// Public constructor
/// </summary>
public CheckBoxSeparator()
{
CheckBox = new CheckBox();
m_divider = new Divider();
Content = new StackLayout
{
Orientation = Orientation.Horizontal,
VerticalContentAlignment = VerticalAlignment.Stretch,
Spacing = 2,
Items =
{
CheckBox,
new StackLayoutItem(m_divider, true)
}
};
}
// The divider or separator
readonly Divider m_divider;
/// <summary>
/// Gets the checkbox
/// </summary>
public CheckBox CheckBox { get; }
/// <summary>
/// Gets or sets the text of the checkbox
/// </summary>
public string Text
{
get => CheckBox.Text;
set => CheckBox.Text = value;
}
/// <summary>
/// Gets or sets the color of the line separator
/// </summary>
public Color Color
{
get => m_divider.Color;
set => m_divider.Color = value;
}
}
Hi @dale, thank you. That is a possible workaround but i still would like to know if it is doable with a GroupBox header. I managed to access the header of a GroupBox and it kind of “accepts” a CheckBox like this:
but it doesn’t show the CheckBox instead of the header (label), instead it justs writes out “Eto.Forms.CheckBox”. There seems to be a way with wpf but i have no clue how to do the same in pyhon.