source: trunk/src/uvmat_doc/FUNCTIONS_DOC/update_menu.html @ 37

Last change on this file since 37 was 37, checked in by sommeria, 14 years ago

create_grid.fig ,
uvmat_doc and all the included files added

File size: 4.8 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2                "http://www.w3.org/TR/REC-html40/loose.dtd">
3<html>
4<head>
5  <title>Description of update_menu</title>
6  <meta name="keywords" content="update_menu">
7  <meta name="description" content="'update_menu': find an input string in a menu, add it to the menu at the penultimate position if it does not exist">
8  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
10  <meta name="robots" content="index, follow">
11  <link type="text/css" rel="stylesheet" href="../m2html.css">
12</head>
13<body>
14<a name="_top"></a>
15<div><a href="../index.html">Home</a> &gt;  <a href="index.html">.</a> &gt; update_menu.m</div>
16
17<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
18<td align="right"><a href="index.html">Index for .&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
19
20<h1>update_menu
21</h1>
22
23<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
24<div class="box"><strong>'update_menu': find an input string in a menu, add it to the menu at the penultimate position if it does not exist</strong></div>
25
26<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
27<div class="box"><strong>function menu_str=update_menu(handle,strinput) </strong></div>
28
29<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
30<div class="fragment"><pre class="comment">'update_menu': find an input string in a menu, add it to the menu at the penultimate position if it does not exist
31-----------------------------------------------
32 function menu_str=update_menu(handle,strinput)
33
34 OUTPUT:
35 menu_str: new menu; cell of strings
36
37 INPUT:
38 handle: handle of the menu to modify (listbox uicontrol)
39 strinput: char string to detect or add in the menu</pre></div>
40
41<!-- crossreference -->
42<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
43This function calls:
44<ul style="list-style-image:url(../matlabicon.gif)">
45</ul>
46This function is called by:
47<ul style="list-style-image:url(../matlabicon.gif)">
48<li><a href="get_field.html" class="code" title="function varargout = get_field(varargin)">get_field</a>        'get_field': display variables and attributes from a Netcdf file, and plot selected fields</li><li><a href="series.html" class="code" title="function varargout = series(varargin)">series</a>  'series': master function associated to the GUI series.m for analysis field series</li><li><a href="uvmat.html" class="code" title="function varargout = uvmat(varargin)">uvmat</a>     'uvmat': function associated with the GUI 'uvmat.fig' for images and data field visualization</li></ul>
49<!-- crossreference -->
50
51
52<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
53<div class="fragment"><pre>0001 <span class="comment">%'update_menu': find an input string in a menu, add it to the menu at the penultimate position if it does not exist</span>
540002 <span class="comment">%-----------------------------------------------</span>
550003 <span class="comment">% function menu_str=update_menu(handle,strinput)</span>
560004 <span class="comment">%</span>
570005 <span class="comment">% OUTPUT:</span>
580006 <span class="comment">% menu_str: new menu; cell of strings</span>
590007 <span class="comment">%</span>
600008 <span class="comment">% INPUT:</span>
610009 <span class="comment">% handle: handle of the menu to modify (listbox uicontrol)</span>
620010 <span class="comment">% strinput: char string to detect or add in the menu</span>
630011
640012 <a name="_sub0" href="#_subfunctions" class="code">function menu_str=update_menu(handle,strinput)</a>
650013 menu_str=get(handle,<span class="string">'String'</span>);
660014 nbmenu=length(menu_str);
670015 ichoice=0;<span class="comment">%default</span>
680016 <span class="keyword">for</span> imenu=1:nbmenu
690017     <span class="keyword">if</span> isequal(menu_str{imenu},strinput)
700018        ichoice=imenu;
710019     <span class="keyword">end</span>
720020 <span class="keyword">end</span>
730021 <span class="keyword">if</span> ichoice==0<span class="comment">%the input string does not exist in the menu</span>
740022     menu_str{nbmenu+1}=menu_str{nbmenu};<span class="comment">%shift  the last item ('more...')</span>
750023     menu_str{nbmenu}=strinput;
760024     set(handle,<span class="string">'String'</span>,menu_str)
770025     ichoice=nbmenu;
780026 <span class="keyword">end</span>
790027 set(handle,<span class="string">'Value'</span>,ichoice)</pre></div>
80<hr><address>Generated on Fri 13-Nov-2009 11:17:03 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
81</body>
82</html>
Note: See TracBrowser for help on using the repository browser.