source: MML/trunk/machine/SOLEIL/StorageRing/TuneMovePanel/quad_table.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.4 KB
Line 
1function [handle] = quad_table(title, name, value, position)
2% [handle, b] =  quad_table(title, name, value) title is a string name is a
3% column of strings with the names of the quads value is a column of
4% strings with the values of the quads handle is handle to the mathworks
5% MWFrame b is a handle to mathworks MWListbox b.getSelectedRows => gets
6% you the index of the row currently selected by mouse, beginning with
7% zero!!! -- example: [handle, b] = gui_sheet('nice table', qualist,
8% vallist)
9%
10%
11% requires Java runtime environment installed and mathworks components ver.
12% 0.5
13
14% GPL License (www.google.com), feel free to modify it, if you have any
15% questions or interesting modifications, please send an email. there is a
16% problem with some screen resolutions, you can modify it according to your
17% needs, or add another input parameters you can access: cursor position,
18% data in the table, visibility of the listbox or frame data. this file is
19% far from complete, it is just an example on how to put a table into
20% matlab gui (in this case only external window) if you have any idea on
21% how to put a table into an existing gui window, i`ll be very thankful for
22% hints and tips.
23
24ncol=2;
25nrows=size(name,2);
26data = cell(nrows,2);
27
28for i=1:nrows,
29    data(i,:)=[name(i) value(i)] ;
30end
31
32t = uitable(data,[{'Name'} {'k'}]);
33set(t,'Editable',false);
34set(t,'Units','normalized')
35set(t,'Position',position);
36handle=t;
Note: See TracBrowser for help on using the repository browser.