Interactive knob style slider Class-Object type

MATLAB Class designed for make knob style slider on MATLAB GUI application.
142 téléchargements
Mise à jour 31 mai 2018

Afficher la licence

Title: Knob style slider Class-Object type
This class was developed by Seonghee Cho., shcho89@postech.ac.kr (2018-04-01)
This class was designed for make knob style slider on MATLAB GUI application. User can use their own image for slider. To use this class, axes object is required. This work is extended work of original work which do not using class definition.
(URL: https://www.mathworks.com/matlabcentral/fileexchange/66631-interactive-knob-style-slider)
Copyright (c) 2018, Bio optics and acoustics lab, POSTECH
All rights reserved.
Last revision data 2018-03-26
How to use.
Syntax
handle=knobslider(axeshandle, GUIhandle, 'Property',Value);
Description
Examples of using all variables are provided in GUI_slider.m and figureslider.m. The following explains the use of variables.
axeshandle is handle name of axes object you want to use as a slide.
GUI handle is input variable for GUIDE handle struct variable. If you want to use figure object only without GUIDE, just insert 0 or other dummy value.

knobslider have 6 properties.
1. value, 2. knobratio, 3. callback, 4. direction, 5.slotimg, 6. knobimg, 7.interactivity
1. value
'value' is a property that defines the position of the knob in the slider. The default value is 0. The 'value' is determined between 0 and 1. You can use this property to initialize the knob position or set the knob position to the desired position. An example of initializing or setting a specific position of the knob position is provided in GUI_slider.m. See Opening GUI Functions and Button Callback Functions in Example Code.

2. knobratio
The knob ratio defines the aspect ratio of the knob image. The ratio is determined by 'sliderlength dimension / slider width dimension'. The example is provided in GUI_slider.m.

3. callback
A custom function is required for the input. You can define the slider's response when you click the knob or move the knob. The required variables of the callback function are value and handle. For example, you can write as follows.
function callback_example(value, handles)
Contents what you want
End
The value is determined by the knob position. (0 -1) handle is the handle input used in the initialization step.

4. direction
This property determines the orientation of the slider. You can use 'H' for the horizontal slider and 'V' for the vertical slider. The default value is 'H'.

5-6. slotimg, knobimg
You can use these properties to customize the slider using a custom image. These properties must use the file name string. Only PNG images are allowed. The default values are 'slot.png' and 'knob.png'. Please, work your image in horizontal direction orientation.(Which is default option) The class will adjust your image direction automatically.

7. interactivity
This property determine interactivity of a slide object. If you set 1 for this property, slider will change its value every time when you click the object or moving the knob. If you set 0, value will be update when your mouse button is up. You can check example of interactivity from figureslider.m. Default value for this property is 1.

Citation pour cette source

Seonghee Cho (2024). Interactive knob style slider Class-Object type (https://www.mathworks.com/matlabcentral/fileexchange/66701-interactive-knob-style-slider-class-object-type), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2015a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0.0

Bug fix in initializing mouse callback function.