Home > Objects > @struct > uitable.m

iFit/uitable

PURPOSE ^

struct/uitable: a dialogue which allows to modify structure(s) in a table

SYNOPSIS ^

function structure = uitable(structure,options)

DESCRIPTION ^

 struct/uitable: a dialogue which allows to modify structure(s) in a table

 In modal (default) creation mode, the updated structure is returned upon
   closing the window. A modal dialog box prevents a user from interacting 
   with other windows before responding to the modal dialog box.
 In non-modal creation mode, the window is displayed, and remains visible
   while the execution is resumed. The call to uitable returns a
   configuration which should be used as follows to retrieve the modified 
   structure later:
     ad = uitable(a, struct('CreateMode','non-modal'));
     % continue execution, and actually edit and close the window
     % ...
     % get the modified structure (when closing window)
     Data = getappdata(0,ad.tmp_storage);
     a    = cell2struct(reshape(Data(:,2:end), ad.size), Data(:,1), 1);
     rmappdata(0, ad.tmp_storage);

 input:
   structure: the initial struct to edit
   options:   a set of options, namely:
     options.Name: the name of the dialogue (string)
     options.FontSize: the FontSize used to display the table
       default: use the system FontSize.
     options.ListString: the labels to be used for each structure field (cell).
       the cell must have items 'fieldname description...'
       default: use the structure member names.
     options.TooltipString: a string to display (as help)
     options.CreateMode: can be 'modal' (default) or 'non-modal'.
     options.Tag: a tag for the dialogue.
     options.CloseRequestFcn: a function handle or expresion to execute when 
       closing the dialogue in 'non-modal' mode.
     options.ColumnFormat: a cell which specifies how to handle the structure field
       values. The 'auto' mode 
       'char' all values can be anything.
       'auto' protects scalar numeric values from being changed to something else (default).

 output:
   structure: the modified structure in 'modal' mode (default),
     or the dialogue information structure in 'non-modal' mode.
     In non-modal mode, the dialogue information can be obtained from
       Data = getappdata(0,structure.tmp_storage);

 Example: 
   a.Test=1; a.Second='blah'; uitable(a)
   options.ListString={'Test This is the test field','Second 2nd'};
   uitable([a a], options);

 Version: Nov. 26, 2018
 (c) E.Farhi, ILL. License: BSD. <ifit.mccode.org>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Mon 26-Nov-2018 15:08:42 by m2html © 2005. iFit (c) E.Farhi/ILL EUPL 1.1