User`s guide
A GUI That Manages List Data
Utility Function How Us e d
isguidirty
Returns logical state of the figure’s dirty flag
make_list_output_name
Converts the name of a list (obtained from the
figure
Name property) into a valid MATLAB
identifier, which serves as a default when
saving the GUI or exporting its data
List numbering works by adding five spaces before each list entry, then
substituting numerals for characters 3, 2, and 1 of these blanks ( as needed
to display the digits) and placing a period in character 4. The numbers are
stripped off the copy of the current item that displays in the text edit b ox, and
then prepended again when the edit is committed (if the Number list check
box is selected). This limits the size of lists that can be numbered to 999
items. You can modify
number_list to add characters to the number field if
you want the GUI to number lists longer than that.
Note You should turn off the numbering feature before importing list data
if the i tems on that list are already numbered. In such cases, the item
numbers display in the list, but moving list items up or down in the list does
not renumber them.
The guidi rty function sets the figure’s application d ata using setappdata
to indicate that it has been modified, as follows:
function guidir ty(f h,yes_no)
% Sets the "Dirty" flag of the figure to true or false
setappdata(fh,'Dirty',yes_no);
% Also disable or enable the File->Save it em according to yes _no
saveitem = findobj(fh,'Label',' Save');
if yes_no
set(saveitem,'Enable','on')
else
set(saveitem,'Enable','off')
end
The is guid irty function queries the application data with getappdata to
determine whether the figure needs to be saved in response to closing the GUI.
15-49