2 # Menu layout testing script
7 # Tested menu styles and parameters
11 # - SeparatorsLong / SeparatorsShort
12 # - TitleUnderlines0 / TitleUnderlines1 / TitleUnderlines2
13 # - VerticalItemSpacing
14 # - VerticalTitleSpacing
17 # - Hilight3DThickness / Hilight3DThick / Hilight3DThin / Hilight3DOff
19 # %l %c %r %i %| %< %> %s %(left).(right)(...) [%](space) [%](tab) %p
20 # - Empty menus, items, formats and missing parts in the menus, separators
22 # - Continuation menus
27 # $0 = itemformat string
28 # $1 = more menu styles beginning with ","
30 # $3 = test description
32 + I DestroyMenu TestMenu
33 + I DestroyMenuStyle TestMS
34 + I MenuStyle TestMS ItemFormat "$0" $1
35 + I DestroyFunc DoTest
36 + I AddToFunc DoTest I Echo $3
37 + I AddToFunc DoTest I Menu TestMenu
38 + I AddToMenu TestMenu "$2" Title
39 + I ChangeMenuStyle TestMS TestMenu
46 Echo *** VERTICAL LAYOUT TESTS ***
49 DestroyFunc UseDefaultItems
50 AddToFunc UseDefaultItems
51 + I AddToMenu TestMenu "" nop
52 + I AddToMenu TestMenu "" nop
53 + I AddToMenu TestMenu "1 2 3" beep
54 + I AddToMenu TestMenu "" nop
55 + I AddToMenu TestMenu "" nop
56 + I AddToMenu TestMenu "title" title
57 + I AddToMenu TestMenu "1 2 3" beep
58 + I AddToMenu TestMenu "title" title
59 + I AddToMenu TestMenu "" nop
60 + I AddToMenu TestMenu "title" title
61 + I AddToMenu TestMenu "title" title
62 + I AddToMenu TestMenu "1 2 3" beep
63 + I AddToMenu TestMenu "1 2 3" beep
64 + I AddToMenu TestMenu "" nop
65 + I AddToMenu TestMenu "" nop
66 + I AddToMenu TestMenu "*/tmp/icon1.xpm*1 2 3" beep
67 + I AddToMenu TestMenu "*/tmp/icon2.xpm*1 2 3" beep
68 + I AddToMenu TestMenu "" nop
69 + I AddToMenu TestMenu "" nop
70 + I AddToMenu TestMenu "" nop
72 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", borderwidth 50, hilight3dthickness 50 50" "bw 50, ht 50" "bw 50, ht 50"
75 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", borderwidth 1, hilight3dthin" "bw 1, hthin" "bw 1, hthin"
78 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", borderwidth 0, hilight3doff" "bw 0, hoff" "bw 0, hoff"
81 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", borderwidth 2, hilight3dthick" "bw 2, hthick" "bw 2, hhick"
84 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", borderwidth -1, hilight3dthickness -10" "bw -1, ht -10" "bw -1, ht -10"
87 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", separatorslong" "separatorslong" "separatorslong"
90 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", separatorsshort" "separatorsshort" "separatorsshort"
93 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines0" "titleunderlines0" "titleunderlines0"
96 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1" "titleunderlines1" "titleunderlines1"
99 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines2" "titleunderlines2" "titleunderlines2"
102 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing 10 20" "vis 10 20" "vis 10 20"
105 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing 10 -10" "vis 10 -10" "vis 10 -10"
108 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing -10 10" "vis -10 10" "vis -10 10"
111 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing -24 0" "vis -24 0" "vis -24 0"
114 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing -5 -5" "vis -5 -5" "vis -5 -5"
117 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing 1 2" "vis 1 2" "vis 1 2"
120 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing 0 2" "vis 0 2" "vis 0 2"
123 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing -1 2" "vis -1 2" "vis -1 2"
126 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing 1 1" "vis 1 1" "vis 1 1"
129 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing 1 0" "vis 1 0" "vis 1 0"
132 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalitemspacing 1 -1" "vis 1 -1" "vis 1 -1"
135 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalmargins 10 20" "vis 10 20" "vis 10 20"
138 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines2, verticalmargins 0 0" "vis 10 20" "vis 10 20"
141 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalmargins" "vis 10 20" "vis 10 20"
144 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines2, verticalmargins -10 -20" "vis 10 20" "vis 10 20"
147 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines1, verticalmargins -10 20" "vis 10 20" "vis 10 20"
150 NewTest "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|" ", titleunderlines2, verticalmargins 10 -20" "vis 10 20" "vis 10 20"
158 Echo *** SUBMENU TESTS ***
161 DestroyFunc UseDefaultItems
162 AddToFunc UseDefaultItems
163 + I AddToMenu TestMenu
164 + I AddToMenu TestMenu "1 222 popup non-exist" Popup non-exist
165 + I AddToMenu TestMenu "1 222 popup self" Popup TestMenu
166 + I AddToMenu TestMenu "1 222 menu non-exist" Menu non-exist
167 + I AddToMenu TestMenu "1 222 menu self" Menu TestMenu
168 + I AddToMenu TestMenu "" Popup TestMenu
169 + I AddToMenu TestMenu "" menu TestMenu
170 + I AddToMenu TestMenu " " Popup TestMenu
171 + I AddToMenu TestMenu " " menu TestMenu
173 NewTest "%l%c%r%>" "" "%%l%%c%%r%%>" "%l%c%r%>"
176 NewTest "%l%c%r%<" "" "%%l%%c%%r%%<" "%l%c%r%<"
179 NewTest "%l%<%c%>%r" "" "%%l%%<%%c%%>%%r" "%l%<%c%>%r"
182 NewTest "%l%c%r" "" "%%l%%c%%r" "%l%c%r"
185 NewTest "%>" "" "%%>" "%>"
193 Echo *** SPACING TESTS ***
196 DestroyFunc UseDefaultItems
197 AddToFunc UseDefaultItems
198 + I AddToMenu TestMenu
199 + I AddToMenu TestMenu "11111111111 22222222222 33333333333" Beep
201 NewTest "%10l%r%.l" "" "%%10l%%r%%.l" "%10l%r%.l"
204 NewTest "%-10l%r%10.l" "" "%%-10l%%r%%10.l" "%-10l%r%10.l"
207 NewTest "%.-10l%r %l% " "" "%%.-10l%%r(space)%%l%%(space)" "%.-10l%r(space)%l%(space)"
210 NewTest "%.10l%r %l% " "" "%%.10l%%r(tab)%%l%%(tab)" "%.10l%r(tab)%l%(tab)"
213 NewTest "%10.-10l%r%20p%l" "" "%%10.-10l%%r%%20p%%l" "%10.-10l%r%20p%l"
218 # Hilighting and sidepic tests
221 Echo *** HILIGHTING AND SIDEPIC TESTS ***
224 DestroyFunc UseDefaultItems
225 AddToFunc UseDefaultItems
226 + I AddToMenu TestMenu
227 + I AddToMenu TestMenu "1 2 3" Beep
228 + I AddToMenu TestMenu "1111111111 2222222222222 33333333333" Beep
229 + I AddToMenu TestMenu " 2 3" Beep
230 + I AddToMenu TestMenu "1 3" Beep
231 + I AddToMenu TestMenu "1 2+ " Beep
232 + I AddToMenu TestMenu "1 2 3" Title
233 + I AddToMenu TestMenu "1 2" Beep
234 + I AddToMenu TestMenu "1 2 3" Beep
235 + I AddToMenu TestMenu "1 2 3" Beep
236 + I AddToMenu TestMenu "1++" Beep
237 + I AddToMenu TestMenu " 2+" Beep
238 + I AddToMenu TestMenu " 3" Beep
239 + I AddToMenu TestMenu " " Beep
240 + I AddToMenu TestMenu " 4" Beep
241 + I AddToMenu TestMenu "1 2 3 4" Beep
242 + I AddToMenu TestMenu "final title" Title
244 NewTest "%s%r%|%l%|%i%c" ", SidePic sidepic.xpm, SideColor blue" "%%s%%r%%|%%l%%|%%i%%c" "%s%r%|%l%|%i%c"
247 NewTest "%r%|%s%l%|%i%c" ", SidePic sidepic.xpm, SideColor blue" "%%r%%|%%s%%l%%|%%i%%c" "%r%|%s%l%|%i%c"
250 NewTest "%r%|%l%|%i%c%s" ", SidePic sidepic.xpm, SideColor blue" "%%r%%|%%l%%|%%i%%c%%s" "%r%|%l%|%i%c%s"
253 NewTest "%s%r%|%l%i%c" ", SidePic sidepic.xpm, SideColor blue" "%%s%%r%%|%%l%%i%%c" "%s%r%|%l%i%c"
256 NewTest "%r%|%l%i%c%s" ", SidePic sidepic.xpm, SideColor blue" "%%r%%|%%l%%i%%c%%s" "%r%|%l%i%c%s"
259 NewTest "%s%r%l%i%c" ", SidePic sidepic.xpm, SideColor blue" "%%s%%r%%l%%i%%c" "%s%r%l%i%c"
262 NewTest "%r%l%i%c%s" ", SidePic sidepic.xpm, SideColor blue" "%%r%%l%%i%%c%%s" "%r%l%i%c%s"
265 NewTest "%s%r%|%l%|%i%c" "" "%%s%%r%%|%%l%%|%%i%%c" "%s%r%|%l%|%i%c"
268 NewTest "%r%|%l%|%i%c%s" "" "%%r%%|%%l%%|%%i%%c%%s" "%r%|%l%|%i%c%s"
271 NewTest "%0|%.0|" "" "%%|%%| placement" "%|%|"
274 NewTest "%l%10.1|%1.10|%r" "" "%%l%%10.1|%%1.10|%%r" "%l%10.1|%1.10|%r"
277 NewTest "%|%|" "" "" "%|%|"
280 NewTest "%|%-20|" "" "" "%|%-20|"
283 NewTest "%500|%c%-500|" "" "%%500|%%c%%-500|" "%500|%c%-500|"
286 NewTest "%100|%c%-100|" "" "%%100|%%c%%-100|" "%100|%c%-100|"
289 NewTest "%-100|%c%100|" "" "%%-100|%%c%%100|" "%-100|%c%100|"
292 NewTest "%r%|%l%|%i%|%c%|" "" "%%r%%|%%l%%|%%i%%|%%c%%|" "%r%|%l%|%i%|%c%|"
295 NewTest "%r%|%l%i%c" "" "%%r%%|%%l%%i%%c" "%r%|%l%i%c"
298 NewTest "%r%l%i%c" "" "%%r%%l%%i%%c" "%rl%i%c"
306 Echo *** ICON PLACEMENT TESTS ***
309 DestroyFunc UseDefaultItems
310 AddToFunc UseDefaultItems
311 + I AddToMenu TestMenu
312 + I AddToMenu TestMenu "%/tmp/icon1.xpm%%/tmp/icon2.xpm%%/tmp/icon3.xpm%%sidepic.xpm%" Beep
313 + I AddToMenu TestMenu "%/tmp/icon1.xpm%%/tmp/icon2.xpm%%/tmp/icon3.xpm%" Beep
314 + I AddToMenu TestMenu "%/tmp/icon1.xpm%%/tmp/icon2.xpm%" Beep
315 + I AddToMenu TestMenu "%/tmp/icon1.xpm%" Beep
316 + I AddToMenu TestMenu " " Beep
317 + I AddToMenu TestMenu "%/tmp/icon1.xpm%%sidepic.xpm%" Beep
318 + I AddToMenu TestMenu "1abc%/tmp/icon1.xpm%1def%/tmp/icon2.xpm%1ghi" Beep
319 + I AddToMenu TestMenu "1 %/tmp/icon1.xpm%2%/tmp/icon2.xpm% 3" Beep
320 + I AddToMenu TestMenu "111%/tmp/icon1.xpm% 22222 %/tmp/icon2.xpm%3333333" Beep
322 NewTest "%i%i" "" "%%i%%i placement" "%i%i icon placement"
325 NewTest "%i %i" "" "%%i(tab)%%i placement" "%i(tab)%i icon placement"
328 NewTest " %i %i " "" "(tab)%%i(tab)%%i(tab) placement" "(tab)%i(tab)%i(tab) icon placement"
331 NewTest " %i %i " "" "(space)%%i(space)%%i(space) placement" "(space)%i(space)%i(space) icon placement"
334 NewTest "%l%l%l%i%i" "" "%%l%%l%%l%%i%%i placement" "%l%l%l%i%i icon placement"
337 NewTest "%i%r%r%i%r" "" "%%i%%r%%r%%i%%r placement" "%i%r%r%i%r icon placement"
340 NewTest "%i%i%i%i%i%i" "" "%%i%%i%%i%%i%%i%%i placement" "%i%i%i%i%i%i icon placement"
343 NewTest "%i" "" "%%i placement" "%i icon placement"
346 NewTest " " "" "(empty) placement" "(empty) icon placement"
352 Echo *** LABEL PLACEMENT TESTS ***
355 DestroyFunc UseDefaultItems
356 AddToFunc UseDefaultItems
357 + I AddToMenu TestMenu
358 + I AddToMenu TestMenu "1 2 3" Beep
359 + I AddToMenu TestMenu "1111111111 2222222222222 33333333333" Beep
360 + I AddToMenu TestMenu " 2 3" Beep
361 + I AddToMenu TestMenu "1 3" Beep
362 + I AddToMenu TestMenu "1 2+ " Beep
363 + I AddToMenu TestMenu "1 2 3" Title
364 + I AddToMenu TestMenu "1 2" Beep
365 + I AddToMenu TestMenu "1 2 3" Beep
366 + I AddToMenu TestMenu "1 2 3" Beep
367 + I AddToMenu TestMenu "1++" Beep
368 + I AddToMenu TestMenu " 2+" Beep
369 + I AddToMenu TestMenu " 3" Beep
370 + I AddToMenu TestMenu " " Beep
371 + I AddToMenu TestMenu " 4" Beep
372 + I AddToMenu TestMenu "1 2 3 4" Beep
373 + I AddToMenu TestMenu "final title" Title
375 NewTest "%l%l%l" "" "%%l%%l%%l placement" "%l%l%l label placement"
378 NewTest "%c%c%c" "" "%%c%%c%%c placement" "%c%c%c label placement"
381 NewTest "%r%r%r" "" "%%r%%r%%r placement" "%r%r%r label placement"
384 NewTest "%r%c%l" "" "%%r%%c%%l placement" "%r%c%l label placement"
387 NewTest "%l%c%r" "" "%%l%%c%%r placement" "%l%c%r label placement"
390 NewTest "%r%l%c" "" "%%r%%l%%c placement" "%r%l%c label placement"
393 NewTest "%c%r%l" "" "%%c%%r%%l placement" "%c%r%l label placement"
396 NewTest "%l%l%l" "" "%%l%%l%%l placement with a veeeeeeeeeeeeeeerrrrrrrrrrrryyyy long title" "%l%l%l label placement with a very long long title"
399 NewTest "%c%c%c" "" "%%c%%c%%c placement with a veeeeeeeeeeeeeeerrrrrrrrrrrryyyy long title" "%c%c%c label placement with a very long long title"
402 NewTest "%r%r%r" "" "%%r%%r%%r placement with a veeeeeeeeeeeeeeerrrrrrrrrrrryyyy long title" "%r%r%r label placement with a very long long title"
405 NewTest "%r%c%l" "" "%%r%%c%%l placement with a veeeeeeeeeeeeeeerrrrrrrrrrrryyyy long title" "%r%c%l label placement with a very long long title"
408 NewTest "%l%c%r" "" "%%l%%c%%r placement with a veeeeeeeeeeeeeeerrrrrrrrrrrryyyy long title" "%l%c%r label placement with a very long long title"
411 NewTest "%r%l%r" "" "%%r%%l%%r placement with a veeeeeeeeeeeeeeerrrrrrrrrrrryyyy long title" "%r%l%r label placement with a very long long title"
414 NewTest "%l%l" "" "%%l%%l placement" "%l%l label placement"
417 NewTest "%c%c" "" "%%c%%c placement" "%c%c label placement"
420 NewTest "%r%r" "" "%%r%%r placement" "%r%r label placement"
423 NewTest "%r%l" "" "%%r%%l placement" "%r%l label placement"
426 NewTest "%l%r" "" "%%l%%r placement" "%l%r label placement"
429 NewTest "%c%r" "" "%%c%%r placement" "%c%r label placement"
432 NewTest "%l%c" "" "%%l%%c placement" "%l%c label placement"
435 NewTest "%l" "" "%%l placement" "%l label placement"
438 NewTest "%c" "" "%%c placement" "%c label placement"
441 NewTest " " "" "(empty) placement" "(empty) label placement"
444 NewTest "%l%l%l%l%r%c%l%c%r%r" "" "%%l%%l%%l%%l%%r%%c%%l%%c%%r%%r placement" "%l%l%l%l%r%c%l%c%r%r label placement"