Debian Codegraph @

demos/unsupported/dogs/dogs.uil

raw
1 !
2 ! Motif
3 !
4 ! Copyright (c) 1987-2012, The Open Group. All rights reserved.
5 !
6 ! These libraries and programs are free software; you can
7 ! redistribute them and/or modify them under the terms of the GNU
8 ! Lesser General Public License as published by the Free Software
9 ! Foundation; either version 2 of the License, or (at your option)
10 ! any later version.
11 !
12 ! These libraries and programs are distributed in the hope that
13 ! they will be useful, but WITHOUT ANY WARRANTY; without even the
14 ! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 ! PURPOSE. See the GNU Lesser General Public License for more
16 ! details.
17 !
18 ! You should have received a copy of the GNU Lesser General Public
19 ! License along with these librararies and programs; if not, write
20 ! to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 ! Floor, Boston, MA 02110-1301 USA
22 !
23 !
24 ! HISTORY
25 !
26 ! $XConsortium: dogs.uil /main/5 1995/07/14 10:07:35 drk $
27 !******************************************************************************
28
29 !******************************************************************************
30 !*
31 !* dogs.uil - Square & Dog widget demo, application UIL file.
32 !*
33 !******************************************************************************
34
35 module squares
36 version = 'v1.0'
37 names = case_sensitive
38 character_set=iso_latin1
39 objects = { XmPushButton = gadget; XmToggleButton = gadget; }
40
41 include file 'Square.uil';
42 include file 'Dog.uil';
43
44 procedure
45 create_cb(integer);
46 bark_cb(integer);
47 tb_cb(integer);
48 scale_cb(integer);
49 help_cb(compound_string);
50 exit_cb();
51
52 value
53 k_dog1_id : 1;
54 k_dog2_id : 2;
55 k_dog3_id : 3;
56 k_help_id : 4;
57
58 value
59 dog1_bark_volume : 90;
60 dog1_bark_time : 1100;
61 dog1_wag_time : 100;
62 dog1_square : false;
63
64 dog2_bark_volume : 40;
65 dog2_bark_time : 400;
66 dog2_wag_time : 100;
67 dog2_square : false;
68
69 dog3_bark_volume : 70;
70 dog3_bark_time : 700;
71 dog3_wag_time : 100;
72 dog3_square : false;
73
74 value help_text :
75 compound_string(" ", separate=true) &
76 compound_string(" ", separate=true) &
77 compound_string("osfActivate/MB1 = Bark.", separate=true) &
78 compound_string("W/MB2 = Wag tail.", separate=true) &
79 compound_string("S/Shift-MB2 = Stop.", separate=true) &
80 compound_string("osfHelp = Help.", separate=true) &
81 compound_string("");
82
83
84 object app_main : XmMainWindow {
85 controls {
86 XmMenuBar bar;
87 XmForm work;
88 unmanaged XmInformationDialog help_box;
89 };
90 callbacks {
91 XmNhelpCallback=procedure help_cb(compound_string("Dogs") & help_text);
92 };
93 };
94
95 object help_box : XmInformationDialog {
96 arguments {
97 XmNmessageAlignment = XmALIGNMENT_BEGINNING;
98 XmNdialogTitle = "Help";
99 XmNokLabelString = "Dismiss";
100 };
101 callbacks {
102 MrmNcreateCallback = procedure create_cb(k_help_id);
103 };
104 };
105
106 object bar : XmMenuBar {
107 arguments {
108 XmNmenuHelpWidget = XmCascadeButton help;
109 };
110 controls {
111 XmCascadeButton file;
112 XmCascadeButton help;
113 };
114 };
115
116 object file : XmCascadeButton {
117 arguments { XmNlabelString = "File"; XmNmnemonic = keysym('F'); };
118 controls { XmPulldownMenu file_pd; };
119 };
120 object file_pd : XmPulldownMenu {
121 controls {
122 XmPushButton exit_pb;
123 };
124 };
125 object exit_pb : XmPushButton {
126 arguments { XmNlabelString = "Exit"; XmNmnemonic = keysym('E');};
127 callbacks { XmNactivateCallback = procedure exit_cb(); };
128 };
129
130 object help : XmCascadeButton {
131 arguments { XmNlabelString = "Help"; XmNmnemonic = keysym('H'); };
132 controls { XmPulldownMenu help_pd; };
133 };
134 object help_pd : XmPulldownMenu {
135 arguments { XmNtearOffModel = XmTEAR_OFF_ENABLED; };
136 controls {
137 XmPushButton help_pb;
138 };
139 };
140 object help_pb : XmPushButton {
141 arguments { XmNlabelString = "On Dogs"; XmNmnemonic = keysym('D');};
142 callbacks { XmNactivateCallback = procedure help_cb
143 (compound_string("Dogs") & help_text); };
144 };
145
146
147 object work : XmForm {
148 controls {
149 XmFrame frame;
150 XmScale scale1;
151 XmScale scale2;
152 XmScale scale3;
153 XmSeparator sep;
154 XmToggleButton tb1;
155 XmToggleButton tb2;
156 XmToggleButton tb3;
157 };
158 };
159
160 object frame : XmFrame {
161 arguments {
162 XmNrightAttachment = XmATTACH_FORM; XmNrightOffset = 5;
163 XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 5;
164 XmNtopAttachment = XmATTACH_FORM; XmNtopOffset = 5;
165 XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 10;
166 XmNbottomWidget = XmScale scale1;
167 };
168 controls {
169 user_defined square;
170 };
171 };
172
173 object square : user_defined procedure SquareCreate {
174 arguments {
175 XmNwidth = 600;
176 XmNheight = 220;
177 XmNresizePolicy = XmRESIZE_GROW;
178 SquareNmajorDimension = SquareWIDTH;
179 };
180 controls {
181 user_defined dog1;
182 user_defined dog2;
183 user_defined dog3;
184 };
185 };
186
187 object dog1 : user_defined procedure DogCreate {
188 arguments {
189 SquareNmakeSquare = dog1_square;
190 XmNx = 20;
191 XmNy = 20;
192 XmNforeground = color('red', foreground);
193 XmNbackground = color('lightblue', background);
194 XmNshadowThickness = 12;
195 DogNwagTime = dog1_wag_time;
196 DogNbarkTime = dog1_bark_time;
197 };
198 callbacks {
199 MrmNcreateCallback = procedure create_cb(k_dog1_id);
200 DogNbarkCallback = procedure bark_cb(dog1_bark_volume);
201 XmNhelpCallback = procedure help_cb
202 (compound_string("Rover") & help_text);
203 };
204 };
205
206 object dog2 : user_defined procedure DogCreate {
207 arguments {
208 SquareNmakeSquare = dog2_square;
209 XmNx = 220;
210 XmNy = 20;
211 XmNforeground = color('black', foreground);
212 XmNbackground = color('lightblue', background);
213 XmNshadowThickness = 4;
214 DogNwagTime = dog2_wag_time;
215 DogNbarkTime = dog2_bark_time;
216 };
217 callbacks {
218 MrmNcreateCallback = procedure create_cb(k_dog2_id);
219 DogNbarkCallback = procedure bark_cb(dog2_bark_volume);
220 XmNhelpCallback = procedure help_cb
221 (compound_string("Spot") & help_text);
222 };
223 };
224
225 object dog3 : user_defined procedure DogCreate {
226 arguments {
227 SquareNmakeSquare = dog3_square;
228 XmNx = 420;
229 XmNy = 20;
230 XmNforeground = color('Brown', foreground);
231 XmNbackground = color('lightblue', background);
232 XmNshadowThickness = 10;
233 DogNwagTime = dog3_wag_time;
234 DogNbarkTime = dog3_bark_time;
235 };
236 callbacks {
237 MrmNcreateCallback = procedure create_cb(k_dog3_id);
238 DogNbarkCallback = procedure bark_cb(dog3_bark_volume);
239 XmNhelpCallback = procedure help_cb
240 (compound_string("Fido") & help_text);
241 };
242 };
243
244 object scale1 : XmScale {
245 arguments {
246 XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 5;
247 XmNrightAttachment = XmATTACH_POSITION; XmNrightPosition = 30;
248 XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5;
249 XmNbottomWidget = XmSeparator sep;
250 XmNminimum = 1;
251 XmNmaximum = 200;
252 XmNtitleString = 'Wag Rate';
253 XmNorientation = XmHORIZONTAL;
254 XmNprocessingDirection = XmMAX_ON_LEFT;
255 XmNvalue = dog1_wag_time;
256 };
257 callbacks {
258 XmNvalueChangedCallback = procedure scale_cb(1);
259 XmNdragCallback = procedure scale_cb(1);
260 };
261 };
262
263 object scale2 : XmScale {
264 arguments {
265 XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 36;
266 XmNrightAttachment = XmATTACH_POSITION; XmNrightPosition = 63;
267 XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5;
268 XmNbottomWidget = XmSeparator sep;
269 XmNminimum = 1;
270 XmNmaximum = 200;
271 XmNtitleString = 'Wag Rate';
272 XmNorientation = XmHORIZONTAL;
273 XmNprocessingDirection = XmMAX_ON_LEFT;
274 XmNvalue = dog2_wag_time;
275 };
276 callbacks {
277 XmNvalueChangedCallback = procedure scale_cb(2);
278 XmNdragCallback = procedure scale_cb(2);
279 };
280 };
281
282 object scale3 : XmScale {
283 arguments {
284 XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 69;
285 XmNrightAttachment = XmATTACH_FORM; XmNrightOffset = 5;
286 XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5;
287 XmNbottomWidget = XmSeparator sep;
288 XmNminimum = 1;
289 XmNmaximum = 200;
290 XmNtitleString = 'Wag Rate';
291 XmNorientation = XmHORIZONTAL;
292 XmNprocessingDirection = XmMAX_ON_LEFT;
293 XmNvalue = dog3_wag_time;
294 };
295 callbacks {
296 XmNvalueChangedCallback = procedure scale_cb(3);
297 XmNdragCallback = procedure scale_cb(3);
298 };
299 };
300
301 object sep : XmSeparator {
302 arguments {
303 XmNleftAttachment = XmATTACH_FORM;
304 XmNrightAttachment = XmATTACH_FORM;
305 XmNbottomAttachment = XmATTACH_WIDGET; XmNbottomOffset = 5;
306 XmNbottomWidget = XmToggleButton tb1;
307 };
308 };
309
310 object tb1 : XmToggleButton {
311 arguments {
312 XmNleftAttachment = XmATTACH_FORM; XmNleftOffset = 5;
313 XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 5;
314
315 XmNset = dog1_square;
316 XmNlabelString = 'Make Square';
317 };
318 callbacks {
319 XmNvalueChangedCallback = procedure tb_cb(1);
320 };
321 };
322
323 object tb2 : XmToggleButton {
324 arguments {
325 XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 36;
326 XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 5;
327
328 XmNset = dog2_square;
329 XmNlabelString = 'Make Square';
330 };
331 callbacks {
332 XmNvalueChangedCallback = procedure tb_cb(2);
333 };
334 };
335
336 object tb3 : XmToggleButton {
337 arguments {
338 XmNleftAttachment = XmATTACH_POSITION; XmNleftPosition = 69;
339 XmNbottomAttachment = XmATTACH_FORM; XmNbottomOffset = 5;
340
341 XmNset = dog3_square;
342 XmNlabelString = 'Make Square';
343 };
344 callbacks {
345 XmNvalueChangedCallback = procedure tb_cb(3);
346 };
347 };
348
349 end module;
350