File Exchange

image thumbnail

uibar: Colored bar indicator (like a waitbar) that can be placed in a figure.

version 2.0.0.0 (17.3 KB) by Douglas Schwarz
Multi-purpose variable-length colored bar indicator.

2 Downloads

Updated 11 Jul 2017

View License

This is a class that implements a colored bar indicator, very much like a waitbar, that you can embed in any figure. It mimics built-in MATLAB UI elements with the following properties and their default values:
BackgroundColor = [1 1 1]
BorderColor = [0 0 0]
CurrentMouseValue (Read-only)
Direction = 'east' or 'north' depending on Position and DirectionMode
DirectionMode = 'auto'
ForegroundColor = [1 0 0]
LineWidth = 0.5
Max = 1
Min = 0
Position = [20 20 200 15]
Units = 'pixels'
Value = 0
ButtonDownFcn
DeleteFcn
HitTest = 'on'
Parent
Selected = 'off'
SelectionHighlight = 'on'
Type = 'uibar' (Read-only)
UIContextMenu
UserData
Visible = 'on'
You change the length of the bar simply by setting the Value property of the instantiated object.
mybar = uibar;
mybar.Value = 0.5;

Comments and Ratings (2)

Of course! A simple one is given in the description:
mybar = uibar;
mybar.Value = 0.5;
A little more complicated:
mybar = uibar('Position',[50 50 300 20],'Min',0,'Max',100,'ForegroundColor','g');
for i = 1:100
mybar.Value = i;
end

apple

Dear Douglas Schwarz,

Could you give an example to use uibar.m?

Thank you very much!
HL

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags