/// <summary> /// Handles sample slider changes. /// </summary> /// <param name="slider"></param> public virtual void SliderMoved( Slider slider ) { // format the caption to be fraction style String denom = "/" + this.SampleMenu.ItemsCount; slider.ValueCaption = slider.ValueCaption + denom; // tell the sample menu to change if it hasn't already if ( this.SampleMenu.SelectionIndex != -1 && this.SampleMenu.SelectionIndex != slider.Value - 1 ) { this.SampleMenu.SelectItem( (int)slider.Value - 1 ); } }
/// <summary> /// Sets up main page for browsing samples. /// </summary> protected virtual void SetupWidgets() { this.TrayManager.DestroyAllWidgets(); // create main navigation tray this.TrayManager.ShowLogo( TrayLocation.Right ); this.TrayManager.CreateSeparator( TrayLocation.Right, "LogoSep" ); this.TrayManager.CreateButton( TrayLocation.Right, "StartStop", "Start Sample" ); this.TrayManager.CreateButton( TrayLocation.Right, "UnloadReload", this.LoadedSamples.Count == 0 ? "Reload Samples" : "Unload Samples" ); this.TrayManager.CreateButton( TrayLocation.Right, "Configure", "Configure" ); this.TrayManager.CreateButton( TrayLocation.Right, "Quit", "Quit" ); // // create sample viewing controls this.TitleLabel = this.TrayManager.CreateLabel( TrayLocation.Left, "SampleTitle", "" ); this.DescBox = this.TrayManager.CreateTextBox( TrayLocation.Left, "SampleInfo", "Sample Info", 250, 208 ); this.CategoryMenu = this.TrayManager.CreateThickSelectMenu( TrayLocation.Left, "CategoryMenu", "Select Category", 250, 10 ); this.SampleMenu = this.TrayManager.CreateThickSelectMenu( TrayLocation.Left, "SampleMenu", "Select Sample", 250, 10 ); this.SampleSlider = this.TrayManager.CreateThickSlider( TrayLocation.Left, "SampleSlider", "Slide Samples", 250, 80, 0, 0, 0 ); /* Sliders do not notify their listeners on creation, so we manually call the callback here to format the slider value correctly. */ SliderMoved( this.SampleSlider ); // create configuration screen button tray this.TrayManager.CreateButton( TrayLocation.None, "Apply", "Apply Changes" ); this.TrayManager.CreateButton( TrayLocation.None, "Back", "Go Back" ); // create configuration screen label and renderer menu this.TrayManager.CreateLabel( TrayLocation.None, "ConfigLabel", "Configuration" ); this.RendererMenu = this.TrayManager.CreateLongSelectMenu( TrayLocation.None, "RendererMenu", "Render System", 450, 240, 10 ); this.TrayManager.CreateSeparator( TrayLocation.None, "ConfigSeparator" ); // populate render system names var rsNames = from rs in Root.RenderSystems.Values select rs.Name; this.RendererMenu.Items = rsNames.ToList(); PopulateSampleMenus(); }
void slider_SliderMoved( object sender, Slider slider ) { patch.Subdivision = slider.Value; }
/// <summary> /// /// </summary> protected override void Shutdown() { if ( this.TrayManager != null ) { this.TrayManager = null; } if ( CurrentSample == null ) { DestroyDummyScene(); } this.CategoryMenu = null; this.SampleMenu = null; this.SampleSlider = null; this.TitleLabel = null; this.DescBox = null; this.RendererMenu = null; this.HiddenOverlays.Clear(); this.Thumbs.Clear(); this.CarouselPlace = 0; base.Shutdown(); UnloadSamples(); }
/// <summary> /// /// </summary> /// <param name="slider"></param> public void SliderMoved( Slider slider ) { }
/// <summary> /// /// </summary> /// <param name="trayLoc"></param> /// <param name="name"></param> /// <param name="caption"></param> /// <param name="width"></param> /// <param name="trackWidth"></param> /// <param name="valueBoxWidth"></param> /// <param name="minValue"></param> /// <param name="maxValue"></param> /// <param name="snaps"></param> /// <returns></returns> public Slider CreateLongSlider( TrayLocation trayLoc, String name, DisplayString caption, Real width, Real trackWidth, Real valueBoxWidth, Real minValue, Real maxValue, int snaps ) { if ( trackWidth <= 0 ) { trackWidth = 1; } var s = new Slider( name, caption, width, trackWidth, valueBoxWidth, minValue, maxValue, snaps ); MoveWidgetToTray( s, trayLoc ); s.AssignedTrayListener = this.listener; return s; }
/// <summary> /// /// </summary> public virtual void OnSliderMoved( object sender, Slider slider ) { if ( SliderMoved != null ) { SliderMoved( sender, slider ); } }
private void slider_SliderMoved( object sender, Slider slider ) { this.patch.Subdivision = slider.Value; }
/// <summary> /// /// </summary> /// <param name="trayLoc"></param> /// <param name="name"></param> /// <param name="caption"></param> /// <param name="width"></param> /// <param name="valueBoxWidth"></param> /// <param name="minValue"></param> /// <param name="maxValue"></param> /// <param name="snaps"></param> /// <returns></returns> public Slider CreateThickSlider( TrayLocation trayLoc, String name, DisplayString caption, Real width, Real valueBoxWidth, Real minValue, Real maxValue, int snaps ) { Slider s = new Slider( name, caption, width, 0, valueBoxWidth, minValue, maxValue, snaps ); MoveWidgetToTray( s, trayLoc ); s.AssignedTrayListener = listener; return s; }