Code covered by the BSD License  

Highlights from
sliderPanel

5.0

5.0 | 1 rating Rate this file 31 Downloads (last 30 days) File Size: 5.58 KB File ID: #13845
image thumbnail

sliderPanel

by Brett Shoelson

 

02 Feb 2007 (Updated 21 Jun 2010)

A new UICONTROL object with a slider as a child of a uipanel, with auto-linked edit box and labels.

Editor's Notes:

This file was a File Exchange Pick of the Week

| Watch this File

File Information
Description

My new favorite uitool...this is quickly becoming an indispensable tool in my uicontrol arsenal.

FUNCTION:
sliderHandle,panelHandle,editHandle] = sliderPanel(parent, PanelPVs, SliderPVs, EditPVs, LabelPVs, numFormat)
 
Creates a slider in a separate uipanel, with an associated interactive EditBox, and left and right labels showing the minimum and maximum values of the slider, respectively.

Moving the slider automatically updates the textbox, and vice versa. Both slider movement and text edits will trigger (non-recursively) the callback of the slider.
 
The EditBox automatically disallows the entry of non-numeric values, or of values outside of [min,max]. Attempts to enter disallowed values will be ignored.
 
Two syntaxes are supported. One gives FULL control over all elements of the sliderPanel, and a second provides easier access to a subset of the functionality.

MATLAB release MATLAB 7.3 (R2006b)
Other requirements Created with 2006b and 2007a. I think it's platform-independent. I'm not sure how recent ML needs to be.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
05 Feb 2007 John D'Errico

Since most of the sliders I've ever generated also had exactly these uicontrols attached to them, this makes great sense. Thanks for posting it.

I tested it out in both R2006b and in R14SP1 (both on a Mac.) It worked nicely in R2006b, but in the older release, the slider bar would not move properly, and when the figure was resized, the slider bar moved to a different place in the figure. So there appear to be definite problems in older releases.

Please login to add a comment or rating.
Updates
06 Feb 2007

This is a bug fix; in adding simplified syntax, I broke support for structs. Also, no 'Parent' arg now needed in simplified syntax.

04 May 2010

added copyright

21 Jun 2010

Updated M file and license text file copyright to The MathWorks, Inc.

Tag Activity for this File
Tag Applied By Date/Time
gui tools Brett Shoelson 22 Oct 2008 08:59:19
example Brett Shoelson 22 Oct 2008 08:59:19
uicontrol slider panel linked edit Brett Shoelson 22 Oct 2008 08:59:19

Contact us at files@mathworks.com