protected override NWidget CreateExampleContent() { NStackPanel stack = new NStackPanel(); m_HSlider = new NRangeSlider(); m_HSlider.BeginValue = 20; m_HSlider.EndValue = 40; m_HSlider.HorizontalPlacement = ENHorizontalPlacement.Left; m_HSlider.PreferredWidth = 300; m_HSlider.BeginValueChanged += new Function <NValueChangeEventArgs>(OnSliderValueChanged); m_HSlider.EndValueChanged += new Function <NValueChangeEventArgs>(OnSliderValueChanged); stack.Add(new NGroupBox("Horizontal", m_HSlider)); m_VSlider = new NRangeSlider(); m_VSlider.BeginValue = 20; m_VSlider.EndValue = 40; m_VSlider.Orientation = ENHVOrientation.Vertical; m_VSlider.PreferredHeight = 300; m_VSlider.HorizontalPlacement = ENHorizontalPlacement.Left; m_VSlider.BeginValueChanged += new Function <NValueChangeEventArgs>(OnSliderValueChanged); m_VSlider.EndValueChanged += new Function <NValueChangeEventArgs>(OnSliderValueChanged); stack.Add(new NGroupBox("Vertical", m_VSlider)); return(stack); }
private void OnSliderValueChanged(NValueChangeEventArgs args) { NRangeSlider slider = (NRangeSlider)args.TargetNode; string text = slider == m_HSlider ? "Horizontal Range: " : "Vertical Range: "; text += slider.BeginValue.ToString("0.###") + " - " + slider.EndValue.ToString("0.###"); m_EventsLog.LogEvent(text); }