Mercurial > hg > ltpda
comparison m-toolbox/m/gui/constructor_helper/ltpda_constructor_helper.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 function varargout = ltpda_constructor_helper(varargin) | |
2 | |
3 % LTPDA_CONSTRUCTOR_HELPER allows the user to explore object constructors. | |
4 % | |
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
6 % | |
7 % DESCRIPTION: LTPDA_CONSTRUCTOR_HELPER allows the user to explore object constructors. | |
8 % | |
9 % CALL: ltpda_constructor_helper | |
10 % | |
11 % | |
12 % VERSION: $Id: ltpda_constructor_helper.m,v 1.4 2008/06/20 10:51:55 hewitson Exp $ | |
13 % | |
14 % HISTORY: 07-03-08 M Hewitson | |
15 % Creation | |
16 % | |
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
18 | |
19 | |
20 %% Check if I exist already | |
21 id = findobj('Tag', 'LTPDAconstructor_helper'); | |
22 if ~isempty(id) | |
23 figure(id) | |
24 return | |
25 end | |
26 | |
27 %% Some initial setup | |
28 | |
29 Gproperties.Gcol = [240 240 240]/255; | |
30 Gproperties.Gwidth = 500; | |
31 Gproperties.Gheight = 300; | |
32 Gproperties.Gborder = 10; | |
33 fontsize = getappdata(0, 'ltpda_repo_gui_fontsize'); | |
34 | |
35 Gproperties.Screen = get(0,'screensize'); | |
36 Gproperties.Gposition = [150 ... | |
37 150 ... | |
38 Gproperties.Gwidth... | |
39 Gproperties.Gheight]; | |
40 | |
41 % Initialize and hide the GUI as it is being constructed. | |
42 mainfig = figure('Name', 'LTPDA Constructor Helper',... | |
43 'NumberTitle', 'off',... | |
44 'Visible','off',... | |
45 'Position',Gproperties.Gposition,... | |
46 'Color', Gproperties.Gcol,... | |
47 'Resize', 'off',... | |
48 'ToolBar', 'none', ... | |
49 'NextPlot', 'new', ... | |
50 'MenuBar', 'none',... | |
51 'Tag', 'LTPDAconstructor_helper'); | |
52 | |
53 % Set mainfig callbacks | |
54 set(mainfig, 'CloseRequestFcn', {@ltpda_constructor_helper_close, mainfig}); | |
55 | |
56 % Set Application data | |
57 setappdata(mainfig, 'Gproperties', Gproperties); | |
58 | |
59 | |
60 %% GUI parts | |
61 | |
62 %--- Class selection | |
63 % text field | |
64 sth = uicontrol(mainfig,'Style','text',... | |
65 'String','Class',... | |
66 'HorizontalAlignment', 'left', ... | |
67 'BackgroundColor', Gproperties.Gcol, ... | |
68 'Position',[10 Gproperties.Gheight-40 50 25]); | |
69 | |
70 % pop-up dialog | |
71 pmh = uicontrol(mainfig,'Style','popupmenu',... | |
72 'String', utils.helper.ltpda_userclasses,... | |
73 'Value', 1, ... | |
74 'BackgroundColor', Gproperties.Gcol, ... | |
75 'Tag', 'LTPDA_constructor_helper_class', ... | |
76 'Callback', {'ltpda_constructor_helper_class', mainfig}, ... | |
77 'Position',[90 Gproperties.Gheight-40 120 25]); | |
78 | |
79 %--- Constructor set list | |
80 | |
81 | |
82 % text field | |
83 sth = uicontrol(mainfig,'Style','text',... | |
84 'String','Sets',... | |
85 'HorizontalAlignment', 'left', ... | |
86 'BackgroundColor', Gproperties.Gcol, ... | |
87 'Position',[10 Gproperties.Gheight-80 50 25]); | |
88 | |
89 % Set list | |
90 lbh = uicontrol(mainfig,'Style','listbox',... | |
91 'String', '',... | |
92 'Value', 1, ... | |
93 'BackgroundColor', 'w', ... | |
94 'Tag', 'LTPDA_constructor_helper_sets', ... | |
95 'Callback', {'ltpda_constructor_helper_sets', mainfig}, ... | |
96 'Position',[10 Gproperties.Gheight-270 200 200]); | |
97 | |
98 % Constructor view | |
99 eth = uicontrol(mainfig,'Style','edit',... | |
100 'String','',... | |
101 'BackgroundColor', 'w', ... | |
102 'Max', 100, ... | |
103 'HorizontalAlignment', 'left', ... | |
104 'FontSize', 14, ... | |
105 'Tag', 'LTPDA_constructor_helper_constructor', ... | |
106 'Position',[240 Gproperties.Gheight-210 250 200]); | |
107 | |
108 % Variable name | |
109 sth = uicontrol(mainfig,'Style','text',... | |
110 'String','Variable',... | |
111 'HorizontalAlignment', 'left', ... | |
112 'BackgroundColor', Gproperties.Gcol, ... | |
113 'Position',[240 Gproperties.Gheight-260 50 25]); | |
114 | |
115 eth = uicontrol(mainfig,'Style','edit',... | |
116 'String','obj',... | |
117 'BackgroundColor', 'w', ... | |
118 'HorizontalAlignment', 'center', ... | |
119 'Tag', 'LTPDA_constructor_helper_var', ... | |
120 'Position',[300 Gproperties.Gheight-260 50 25]); | |
121 | |
122 | |
123 % Build btn | |
124 pbh = uicontrol(mainfig,'Style','pushbutton','String','Build',... | |
125 'Position',[360 Gproperties.Gheight-260 60 25],... | |
126 'Tag', 'LTPDA_constructor_helper_buildBtn'); | |
127 set(pbh, 'Callback', {'ltpda_constructor_helper_build'}); | |
128 | |
129 %% Start the GUI | |
130 | |
131 % Make the GUI visible. | |
132 set(mainfig,'Visible','on') | |
133 | |
134 | |
135 %% Callbacks | |
136 | |
137 %--- Close | |
138 function ltpda_constructor_helper_close(varargin) | |
139 disp('* Goodbye from the LTPDA Constructor Helper *') | |
140 delete(varargin{end}) | |
141 end | |
142 end | |
143 | |
144 | |
145 |