/// <summary> /// Constructor with a YnWidgetProperties. /// </summary> /// <param name="properties">the widget's properties</param> public YnTextButton(YnWidgetProperties properties) : this() { SetProperties(properties); // Button's width / height must be set on the label too if defined if (properties.Width != null) { _label.Width = (int)properties.Width; } if (properties.Height != null) { _label.Height = (int)properties.Height; } }
/// <summary> /// Initializes a bunch of common properties defined in the parameter. /// </summary> /// <param name="properties">The widget properties container</param> public void SetProperties(YnWidgetProperties properties) { if (properties.X != null) { Translate(properties.X.Value, 0); } if (properties.Y != null) { Translate(0, properties.Y.Value); } if (properties.Width != null) { Width = (int)properties.Width; } if (properties.Height != null) { Height = (int)properties.Height; } if (properties.SkinName != null) { SkinName = (string)properties.SkinName; } if (properties.HasBorders != null) { HasBorders = (bool)properties.HasBorders; } if (properties.HasBackground != null) { HasBackground = (bool)properties.HasBackground; } if (properties.Padding != null) { Padding = (int)properties.Padding; } }
/// <summary> /// Constructor with a YnWidgetProperties. /// </summary> /// <param name="properties">The properties</param> public YnCheckbox(YnWidgetProperties properties) { SetProperties(properties); }
/// <summary> /// Constructor with a YnWidgetProperties. /// </summary> /// <param name="properties">The properties</param> public YnSlider(YnWidgetProperties properties) : this() { SetProperties(properties); }
/// <summary> /// Constructor with a YnWidgetProperties. /// </summary> /// <param name="properties">The properties</param> public YnPanel(YnWidgetProperties properties) : this() { SetProperties(properties); }
/// <summary> /// Constructor with a YnWidgetProperties. /// </summary> /// <param name="properties">The properties</param> public YnProgressBar(YnWidgetProperties properties) { SetProperties(properties); }
/// <summary> /// Constructor with a YnWidgetProperties. /// </summary> /// <param name="properties">the widget's properties</param> public YnTextButton(YnWidgetProperties properties) : this() { SetProperties(properties); // Button's width / height must be set on the label too if defined if(properties.Width != null) { _label.Width = (int) properties.Width; } if (properties.Height != null) { _label.Height = (int)properties.Height; } }