3 # Test shell for FvwmButtons.
5 # If you don't have the FvwmCommand server running, first start it:
9 # Then, run this shell.
12 # -d debug by echoing commands instead of issuing them.
13 # -k do not kill FvwmButtons if script is interrupted with ctrl-c
15 # -s run slowly. Needed on very slow connections.
16 # -S specify a delay between the test steps. -S 1 is the default, -S 20 is
18 # -o just operate the 4 button setup once.
19 # -c just create the window, don't operate it or kill it.
21 # Modification History
23 # Created on 03/02/01 by Dan Espen (dane):
24 # - Tests for FvwmButtons.
27 # Base unit in seconds for delay
29 DEFAULT_SLOWNESS_FACTOR
=20
31 # Function for running an Fvwm command:
33 $DEBUG FvwmCommand
"$*"
34 $TALK "`date '+%m/%d/%y %H:%M:%S'` FvwmCommand $*"
37 # This doesn't really do it for me...comment out for now
38 # was being used at the beginning of Operate.
39 # Draw attention to the pointer
41 # # Can't use FC here, tracing destroys the effect.
43 # while [ $x -lt 40 ] ; do
44 # FvwmCommand "WindowId root WarpToWindow $x $x"
47 # while [ $x -gt 10 ] ; do
48 # FvwmCommand "WindowId root WarpToWindow $x $x"
54 FC KillModule FvwmButtons FButt
58 # Function to insert a pause
65 sleep `expr $DELAY \* $SLOW`
71 # global button_size gives multiplier
74 FC
'Next (FButt) WarpToWindow 20p 20p'
75 FC
"CursorMove `expr $button_size \* $1`p `expr $button_size \* $2`p"
76 FC
'FakeClick Depth 4 press 1 wait 300 release 1'
78 # Push all the buttons,
80 # button_size for distance to move
81 # rows for number of rows of buttons
82 # cols for number of cols of buttons
86 while [ $rowc -lt $rows -a $colc -lt $cols ] ; do
89 if [ $rowc -eq $rows ] ; then
101 while getopts cdkosS
:t1234 arg
; do
125 SLOW
=$DEFAULT_SLOWNESS_FACTOR;;
131 # usage would be nice here...
136 if [ $KILL = 1 ] ; then
140 # Create shortcut function to create a window
143 FC AddToFunc W I Exec xterm
-font 10x20
-name '\$0' -g 10x10-20000-20000
144 # On my system, the window width is 104, the border width is 6
147 # Setup window style for FvwmButtons
148 FC Style FButt CirculateHit
, neverfocus
, mousefocusclickraisesoff
, HandleWidth
6
149 FC Style FButt NoTitle
150 # Setup window styles for the 4 slideout panels:
151 FC
'Style b* HandleWidth 6, NoTitle'
153 if [ "$DO_SOME" = "n" -o "$DO_1" = "y" ] ; then
154 # Create a button box with 4 panels, one for each direction
158 FC destroymoduleconfig FButt
: \'*\'
159 # Somewhere near the middle of the screen:
160 FC
'*FButt: Geometry +300+300'
161 FC
'*FButt: ButtonGeometry '"${button_size}x${button_size}"
162 FC
'*FButt: Back gray'
163 FC
'*FButt: Fore white'
164 FC
'*FButt: BoxSize smart'
165 FC
'*FButt: Columns '"$cols"
166 FC
'*FButt: Rows '"$rows"
167 FC
'*FButt: Font 9x15bold'
168 FC
'*FButt: (Panel(up, indicator) bu "W bu")'
169 FC
'Style br HandleWidth 0'
170 FC
'*FButt: (Panel(right, indicator, noborder) br "W br")'
171 FC
'*FButt: (Title "<<", Panel(left) bl "W bl")'
172 FC
'*FButt: (Padding 1 1, Panel(down, indicator) bd "W bd")'
173 FC Module FvwmButtons FButt
175 if [ $CREATE_ONLY != 'y' ] ; then
178 # Need a long delay here, or the window just goes away
181 FC KillModule FvwmButtons FButt
182 FC
'Style br HandleWidth 6'
187 # The test with 1 step doesn't work, the window doesn't appear, sometimes
188 # I see just piece of the frame. 2 steps works.
190 if [ "$DO_SOME" = "n" -o "$DO_2" = "y" ] ; then
194 # Create a button box with 4 panels, one for each direction
195 FC destroymoduleconfig FButt
: \'*\'
196 FC
'*FButt: Geometry +400+400'
197 FC
'*FButt: ButtonGeometry '"${button_size}x${button_size}"
198 FC
'*FButt: Back cornflowerblue'
199 FC
'*FButt: Fore white'
200 FC
'*FButt: BoxSize fixed'
201 FC
'*FButt: Columns '"$cols"
202 FC
'*FButt: Rows '"$rows"
203 FC
'*FButt: Font 9x15bold'
204 FC
'*FButt: (Panel(up, indicator, delay 250, smooth, steps 3) bu "W bu")'
205 FC
'*FButt: (Panel(right, indicator, hints) br "W br")'
206 FC
'*FButt: (Panel(left, indicator 16, steps 2) bl "W bl")'
207 FC
'*FButt: (Panel(down, indicator 33, steps 1) bd "W bd")'
208 FC Module FvwmButtons FButt
210 if [ $CREATE_ONLY != 'y' ] ; then
213 # Need a long delay here, or the window just goes away
216 FC KillModule FvwmButtons FButt
221 # Panel bul doesn't seem to be where it should be, or is it panel bur?
222 # Panel brc, and the bottom panels seem to come out from the wrong place,
225 # Test 3, use a 3x3 panel, test positioning.
226 # Make sure no panel is positioned over FvwmButtons itself, you can't push
227 # a button if somethings in the way.
229 if [ "$DO_SOME" = "n" -o "$DO_3" = "y" ] ; then
233 # Create a button box with 4 panels, one for each direction
234 FC destroymoduleconfig FButt
: \'*\'
235 FC
'*FButt: Geometry +500+500'
236 FC
'*FButt: ButtonGeometry '"${button_size}x${button_size}"
237 FC
'*FButt: Back wheat'
238 FC
'*FButt: Fore black'
239 FC
'*FButt: BoxSize fixed'
240 FC
'*FButt: Columns '"$cols"
241 FC
'*FButt: Rows '"$rows"
242 FC
'*FButt: Font 10x20'
243 FC
'*FButt: Padding 12'
244 base
='indicator, smooth, delay 30, steps 3, position'
245 FC
'*FButt: (Panel(up, '"$base "'Module top -'"$ww"'p 0 mlr mtb) bul "W bul")'
246 FC
'*FButt: (Panel(up, '"$base"' Button top center mlr mtb) buc "W buc")'
247 FC
'*FButt: (Panel(up, '"$base"' Module top 100 0 mlr mtb) bur "W bur")'
248 # Root right 0 50 put brl down a page in the middle. isn't that 100?
249 # This goes to the bottom right. why?
250 FC
'*FButt: (Panel(left, '"$base"' Root right 0 0) brl "W brl")'
251 FC
'*FButt: (Panel(right, '"$base"' Module right) brc "W brc")'
252 # This ends up on the left bottom, -10p off screen, 20p up from the bottom
253 FC
'*FButt: (Panel(right, '"$base"' Root right -5p -100p) brr "W brr")'
254 FC
'*FButt: (Panel(down, '"$base"' Module bottom) bdl "W bdl")'
255 FC
'*FButt: (Panel(down, '"$base"' Button bottom) bdc "W bdc")'
256 FC
'*FButt: (Panel(down, '"$base"' Module bottom) bdr "W bdr")'
257 FC Module FvwmButtons FButt
259 if [ $CREATE_ONLY != 'y' ] ; then
262 # Need a long delay here, or the window just goes away
265 FC KillModule FvwmButtons FButt
270 if [ "$DO_SOME" = "n" -o "$DO_4" = "y" ] ; then
274 # Create a button box with 1 button
275 FC destroymoduleconfig FButt
: \'*\'
276 FC
'*FButt: Geometry +600+600'
277 FC
'*FButt: ButtonGeometry '"${button_size}x${button_size}"
278 FC
'*FButt: Back lightblue'
279 FC
'*FButt: Fore black'
280 FC
'*FButt: BoxSize smart'
281 FC
'*FButt: Columns '"$cols"
282 FC
'*FButt: Rows '"$rows"
283 FC
'*FButt: Font 9x15bold'
284 FC
'*FButt: Padding 12'
285 FC
'*FButt: (Title "OneButton", Panel(up) bd "W bd")'
286 FC
'Module FvwmButtons FButt'
287 if [ $CREATE_ONLY != 'y' ] ; then
290 # Need a long delay here, or the window just goes away
293 FC KillModule FvwmButtons FButt