merge the formfield patch from ooo-build
[ooovba.git] / testautomation / graphics / optional / includes / impress / options.inc
blob9addf3f45ed2e13ec0dc0773f85c27a0c9e198d2
1 'encoding UTF-8  Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* 
5 '* Copyright 2008 by Sun Microsystems, Inc.
6 '*
7 '* OpenOffice.org - a multi-platform office productivity suite
8 '*
9 '* $RCSfile: options.inc,v $
11 '* $Revision: 1.1 $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:42 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org.  If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : wolfram.garten@sun.com
36 '* short description : Tests the Presentation-Engines effects
38 '*******************************************************************
40 ' #1 tiPEngineOptionsTest
41 ' #1 tiPEngineOptionsTest2
43 '\*******************************************************************
45 function tiPEngineOptionsTest
46     dim filedialogue as boolean
47     dim lala, optsound, os, oa, odc, ota, ets, etspeed, etrep, etshap, etgt as integer
49      Kontext "Tasks"
50 '     if (NOT bError) then
51         '/// CLick on button '...' (Options) ///'
52         EffectOptions.Click
53         kontext "TabEffect"
54         if TabEffect.Exists(5) then
55            optsound = Sound.GetItemCount
56            for os = 1 to optsound
57                Sound.Select os
58                kontext "OeffnenDlg"
59                if OeffnenDlg.Exists (5) then
60                   filedialogue = TRUE
61                   OeffnenDlg.Close
62                   kontext "TabEffect"
63                else
64                   kontext "TabEffect"
65 '                  if play.isEnabled then
66 '                     try
67 '                        play.click
68 '                     catch
69 '                        warnlog Sound.GetSelText + " wasn't played correctly."
70 '                     endcatch
71 '                  endif
72                endif
73            next os
74            if AfterAnimation.isEnabled AND AfterAnimation.isVisible then
75               for oa = 1 to AfterAnimation.GetItemCount
76                   AfterAnimation.Select oa
77                   if DimColor.isEnabled then
78                      for odc = 1 to DimColor.GetItemCount
79                          DimColor.Select odc
80                      next odc
81                   endif
82                   if DelayBetweenCharacters.isEnabled then
83                      for odc = 1 to DelayBetweenCharacters.GetItemCount
84                          DelayBetweenCharacters.Select odc
85                      next odc
86                   endif
87               next oa
88            else
89               if DelayBetweenCharacters.isEnabled then
90                  for odc = 1 to DelayBetweenCharacters.GetItemCount
91                      DelayBetweenCharacters.Select odc
92                  next odc
93               endif
94            endif
95            for ota = 1 to TextAnimation.GetItemCount
96                TextAnimation.Select ota
97            next ota
98            '/// switch to TabPage 'Timing' ///'
99            Kontext
100            Active.SetPage TabTiming
101            kontext "TabTiming"
102            if TabTiming.Exists(5) then
103               for ets = 1 to TimingStart.GetItemCount
104                   TimingStart.Select ets
105               next ets
106               if Delay.isVisible AND Delay.isEnabled then
107                  Delay.GetText
108               else
109                  Warnlog "Delay in Effect Options were not to be found."
110               endif
111               if Speed.isVisible AND Speed.isEnabled then
112                  for etspeed = 1 to Speed.GetItemCount
113                      Speed.Select etspeed
114                  next etspeed
115               else
116                  printlog " No Speed-entry for this effect."
117               endif
118               if Repeat.isVisible AND Repeat.isEnabled then
119                  for etrep = 1 to Speed.GetItemCount
120                  Repeat.Select etrep
121                  next etrep
122               else
123                  Printlog "Repeat in Effect Options were not to be found."
124               endif
125               Rewind.Check
126               Rewind.UnCheck
127               TriggerAnimate.IsChecked
128               TriggerStart.IsChecked
129               if Shape.isVisible AND Shape.isEnabled then
130                  for etshap = 1 to Shape.GetItemCount
131                  Shape.Select etshap
132                  next etshap
133               else
134                  Warnlog "Shape in Effect Options were not to be found."
135               endif
136            else
137               warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: Timing TabPage didn't work."
138            endif
139            '/// switch to TabPage 'Timing' ///'
140            Kontext
141            active.setPage TabTextAnimation
142            kontext "TabTextAnimation"
143            if TabTextAnimation.Exists(5) then
144               lala = GroupText.GetItemCount
145               for etgt = 1 to lala
146                   GroupText.Select etgt
147                   if AutomaticallyAfter.IsEnabled then
148                      AutomaticallyAfter.Check
149                      AutomaticallyAfter.TypeKeys "<UP>"
150                   endif
151                   if AnimateAttachedShape.IsEnabled then
152                      AnimateAttachedShape.Check
153                      if AnimateAttachedShape.IsChecked = FALSE then
154                         Warnlog "AnimateAttachedShape should have been checked"
155                      endif
156                   endif
157                   if InreverseOrder.IsEnabled then
158                      InreverseOrder.Check
159                      if InreverseOrder.IsChecked = FALSE then
160                         Warnlog "InreverseOrder should have been checked"
161                      endif
162                   endif
163               next etgt
164               TabTextAnimation.Cancel
165            else
166               warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: TextAnimation TabPage didn't work."
167            endif
168         else
169            warnlog "Impress:Tasks Pane:Custom Animation:... button didn't work."
170         endif
171         Kontext "Tasks"
172 end function
176 function optionstest2
177     dim filedialogue as boolean
178     dim lala, optsound, os, oa, odc, ota, ets, etspeed, etrep, etshap, etgt as integer
180      Kontext "Tasks"
181         EffectOptions.Click
182         kontext "TabEffect"
183         if TabEffect.Exists(5) then
184            Sound.Select 5
185            AfterAnimation.Select 2
186            if DimColor.isEnabled then
187               DimColor.Select 5
188            else
189               Warnlog "DimColor should have been enabled"
190            endif
191            TextAnimation.Select 3
192            if DelayBetweenCharacters.isEnabled then
193               DelayBetweenCharacters.More 5
194            else
195               Warnlog "DelayBetweenCharacters should have been enabled"
196            endif
197            '/// switch to TabPage 'Timing' ///'
198            Kontext
199            Active.SetPage TabTiming
200            kontext "TabTiming"
201            if TabTiming.Exists(5) then
202               TimingStart.Select 2
203               if Delay.isVisible AND Delay.isEnabled then
204                  Delay.More 5
205               else
206                  Warnlog "Delay in Effect Options were not to be found."
207               endif
208               if Speed.isVisible AND Speed.isEnabled then
209                  Speed.Select 3
210               else
211                  Printlog "Speed in Effect Options were not to be found."
212               endif
213               if Repeat.isVisible AND Repeat.isEnabled then
214                  for etrep = 1 to Speed.GetItemCount
215                  Repeat.Select etrep
216                  next etrep
217               else
218                  Warnlog "Repeat in Effect Options were not to be found."
219               endif
220               if Rewind.isVisible AND Rewind.isEnabled then
221                  Rewind.Check
222               else
223                  Printlog "Rewind in Effect Options were not to be found."
224               endif
225               if Rewind.isVisible AND Rewind.isEnabled then
226                  Rewind.Check
227                  Rewind.UnCheck
228               else
229                  Warnlog "Rewind in Effect Options were not to be found."
230               endif
231               TriggerAnimate.IsChecked
232               TriggerStart.IsChecked
233               if Shape.isVisible AND Shape.isEnabled then
234                  for etshap = 1 to Shape.GetItemCount
235                  Shape.Select etshap
236                  next etshap
237               else
238                  Warnlog "Shape in Effect Options were not to be found."
239               endif
240            else
241               warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: Timing TabPage didn't work."
242            endif
243            '/// switch to TabPage 'Timing' ///'
244            Kontext
245            active.setPage TabTextAnimation
246            kontext "TabTextAnimation"
247            if TabTextAnimation.Exists(5) then
248               lala = GroupText.GetItemCount
249               for etgt = 1 to lala
250                   GroupText.Select etgt
251                   if AutomaticallyAfter.IsEnabled then
252                      AutomaticallyAfter.Check
253                      AutomaticallyAfter.TypeKeys "<UP>"
254                   endif
255                   if AnimateAttachedShape.IsEnabled then
256                      AnimateAttachedShape.Check
257                      if AnimateAttachedShape.IsChecked = FALSE then
258                         Warnlog "AnimateAttachedShape should have been checked"
259                      endif
260                   endif
261                   if InreverseOrder.IsEnabled then
262                      InreverseOrder.Check
263                      if InreverseOrder.IsChecked = FALSE then
264                         Warnlog "InreverseOrder should have been checked"
265                      endif
266                   endif
267               next etgt
268               TabTextAnimation.Cancel
269            else
270               warnlog "Impress:Tasks Pane:Custom Animation:Effect Options: TextAnimation TabPage didn't work."
271            endif
272         else
273            warnlog "Impress:Tasks Pane:Custom Animation:... button didn't work."
274         endif
275         Kontext "Tasks"
276 end function