% Creation of a scroll bar (slider)

clear all


hfig = figure(1);


VMin = -10;
VMax = 10;
VInit = -10;

hAsc = uicontrol(hfig, ...		% 
	'style', 'slider', ...		% 
	'position', [200 2 150 20],...	% 
	'min', VMin,...			% 
	'max', VMax,...			% 
	'value', VInit, ...		% 
	'callback', [...		%  	
 		 'VAsc =  num2str(get(hAsc,''value''));'...
		 'set(hVal,''string'',VAsc);'...
		 'inter32']);

% display value
hVal = uicontrol(hfig, ...		% 
	'style', 'text', ...		% 
	'position', [200 22 150 15]);	% 

% display minimum value
TxtMin = uicontrol(hfig, ...		% 
	'style', 'text', ...		% 
	'position', [180 2 20 20],...	% 
	'string',num2str(VMin));
    
% display maximum value
TxtMax = uicontrol(hfig, ...		% 
	'style', 'text', ...		% 
	'position', [350 2 20 20],...	% 
	'string',num2str(VMax));


% Initialisations
set(hVal,'string',num2str(VInit));


% "Complex and Chaotic Nonlinear Dynamics. 
% Advances in Economics and Finance, 
% Mathematics and Statistics" 
% T.Vialar, Springer 2009.
% Copyright(c).