image thumbnail

multiscroll

version 1.0.0.0 (2.59 KB) by Brett Shoelson
Link multiple scrolling listboxes for scrolling and selection.

2.4K Downloads

Updated 25 May 2005

View License

FUNCTION MULTISCROLL(varargin)

Automates the linking of multiple listboxes for simultaneous scrolling and selection.

Enter a comma-delimited list of handles to scrolling listboxes. Multiscroll will link them so that they scroll and are highlighted together. (All lists must have equal-lengthed strings.)

Multiple groupings are supported.

Note that this function uses timer objects and so requires ML R14.

Example:

tmp = dir;
a = uicontrol('style','listbox',...
'string',strvcat(a(:).name),...
'pos',[10 100 150 100]);
b = uicontrol('style','listbox',...
'string',strvcat(a(:).date),...
'pos',[140 100 150 100]);
c = uicontrol('style','listbox',...
'string',num2str([a(:).bytes]'),...
'pos',[270 100 150 100]);
d = uicontrol('style','listbox',...
'string',num2str([a(:).isdir]'),...
'pos',[400 100 150 100]);
multiscroll(a,b,c,d)

Example using multiple timers

a=uicontrol('style','listbox',...
'string',{1:100},...
'pos',[10 100 150 100]);
b=uicontrol('style','listbox',...
'string',{1:100},...
'pos',[140 100 150 100]);
c=uicontrol('style','listbox',...
'string',{1:100},...
'pos',[270 100 150 100]);
d=uicontrol('style','listbox',...
'string',{1:100},...
'pos',[400 100 150 100]);
multiscroll(a,c,d);
%(NOTE THE EXCLUSION OF b!!!)
a2=uicontrol('style','listbox',...
'string',{1:50},...
'pos',[10 250 150 100]);
b2=uicontrol('style','listbox',...
'string',{1:50},...
'pos',[140 250 150 100]);
c2=uicontrol('style','listbox',...
'string',{1:50},...
'pos',[270 250 150 100]);
d2=uicontrol('style','listbox',...
'string',{1:50},...
'pos',[400 250 150 100]);
multiscroll(a2,b2,c2,d2);

%(Note in the FEX image, all listboxes in the top cluster are linked, while only listboxes 1,3 and 4 in the bottom cluster are linked.)

Written by Brett Shoelson, PhD
shoelson@helix.nih.gov
4/26/05

Cite As

Brett Shoelson (2021). multiscroll (https://www.mathworks.com/matlabcentral/fileexchange/7535-multiscroll), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!