/// <summary> /// Initializes a new instance of the <see cref="NumericUpDown"/> class. /// </summary> /// <param name="parent">Parent control.</param> public NumericUpDown(ControlBase parent) : base(parent) { SetSize(100, 20); splitter = new Splitter(this); splitter.Dock = Pos.Right; splitter.SetSize(13, 13); up = new UpDownButton_Up(splitter); up.Clicked += onButtonUp; up.IsTabable = false; splitter.SetPanel(0, up, false); down = new UpDownButton_Down(splitter); down.Clicked += onButtonDown; down.IsTabable = false; down.Padding = new Padding(0, 1, 1, 0); splitter.SetPanel(1, down, false); max = 100; min = 0; value = 0f; Text = "0"; }
/// <summary> /// Initializes a new instance of the <see cref="NumericUpDown"/> class. /// </summary> /// <param name="parent">Parent control.</param> public NumericUpDown(Base parent) : base(parent) { SetSize(100, 20); m_Splitter = new Splitter(this); m_Splitter.Dock = Pos.Right; m_Splitter.SetSize(13, 13); m_Up = new UpDownButton_Up(m_Splitter); m_Up.Clicked += OnButtonUp; m_Up.IsTabable = false; m_Splitter.SetPanel(0, m_Up, false); m_Down = new UpDownButton_Down(m_Splitter); m_Down.Clicked += OnButtonDown; m_Down.IsTabable = false; m_Down.Padding = new Padding(0, 1, 1, 0); m_Splitter.SetPanel(1, m_Down, false); m_Max = 100; m_Min = 0; m_Value = 0f; Text = "0"; }
/// <summary> /// Initializes a new instance of the <see cref="Spinner"/> class. /// </summary> /// <param name="parent">Parent control.</param> public Spinner(ControlBase parent) : base(parent) { // Padding = Padding.One; m_Textbox = new NumericUpDownTextbox(this); m_Textbox.ShouldDrawBackground = false; // m_Textbox.TextPadding = new Padding(m_Textbox.TextPadding.Left, m_Textbox.TextPadding.Top, m_BtnContainer.Width, m_Textbox.TextPadding.Bottom); SetSize(m_Textbox.Height * 3, m_Textbox.Height); m_Textbox.Dock = Dock.Fill; m_BtnContainer = new Panel(this); m_BtnContainer.Padding = Padding.Zero; m_BtnContainer.Margin = new Margin(0, 1, 1, 1);; m_BtnContainer.Dock = Dock.Right; m_BtnContainer.AutoSizeToContents = true; // m_BtnContainer.DrawDebugOutlines = true; m_Up = new UpDownButton_Up(m_BtnContainer); m_Up.Clicked += OnButtonUp; m_Up.IsTabable = false; m_Up.Dock = Dock.Top; m_Down = new UpDownButton_Down(m_BtnContainer); m_Down.Clicked += OnButtonDown; m_Down.IsTabable = false; m_Down.Dock = Dock.Bottom; m_Max = 100; m_Min = 0; m_Value = 0f; m_Textbox.Value = 0; }
/// <summary> /// Initializes a new instance of the <see cref="NumericUpDown"/> class. /// </summary> /// <param name="parent">Parent control.</param> public NumericUpDown(ControlBase parent) : base(parent) { m_Splitter = new Splitter(this); m_Splitter.Dock = Dock.Right; m_Up = new UpDownButton_Up(m_Splitter); m_Up.Clicked += OnButtonUp; m_Up.IsTabable = false; m_Splitter.SetPanel(0, m_Up, false); m_Down = new UpDownButton_Down(m_Splitter); m_Down.Clicked += OnButtonDown; m_Down.IsTabable = false; m_Down.Padding = new Padding(0, 1, 1, 0); m_Splitter.SetPanel(1, m_Down, false); m_Max = 100f; m_Min = 0f; m_Value = 0f; m_Step = 1f; Text = "0"; }