summaryrefslogtreecommitdiff
path: root/testautomation/graphics/optional/includes/global/g_arrangealign.inc
blob: 29557214638b7f34e04178f0bde3bce1e64ab536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
'encoding UTF-8  Do not remove or change this line!
'**************************************************************************
' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'
' Copyright 2000, 2010 Oracle and/or its affiliates.
'
' OpenOffice.org - a multi-platform office productivity suite
'
' This file is part of OpenOffice.org.
'
' OpenOffice.org is free software: you can redistribute it and/or modify
' it under the terms of the GNU Lesser General Public License version 3
' only, as published by the Free Software Foundation.
'
' OpenOffice.org is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Lesser General Public License version 3 for more details
' (a copy is included in the LICENSE file that accompanied this code).
'
' You should have received a copy of the GNU Lesser General Public License
' version 3 along with OpenOffice.org.  If not, see
' <http://www.openoffice.org/license.html>
' for a copy of the LGPLv3 License.
'
'/************************************************************************
'*
'* Owner : wolfram.garten@oracle.com
'*
'* short description :
'*
'\******************************************************************************
testcase tiDatei_Fuer_Anordnen_Erstellen

    dim sTemp as string
    dim i as integer
    dim zaehler as integer
    '/// This function creates the document, that will be used as reference and working object inthe following cases :-) ///'
    '///'Dim Datei ' somewhere global :-) defined in calling sub! :sub im_107c_ ///
    call hNewDocument
    if gApplication = "DRAW" then
        kontext "DocumentDraw"
        DocumentDraw.UseMenu
    else
        kontext "DocumentImpress"
        DocumentImpress.UseMenu
    end if
    
    hMenuSelectNr(4)
    hMenuSelectNr(13)
    call sSelectEmptyLayout								'/// new document  ///'
   if Dir(Datei)<>"" then app.Kill(Datei) ' kill old file
   for Zaehler = 1 to 3									'/// create 3 overlapping objects  ///'
    Kontext
    Select Case Zaehler
        Case 1:	WL_SD_Wuerfel
            gMouseMove (20,5, 80,60) '/// cubicel 20,5, 80,60 ///
            Printlog " Object start ---------------------- "+ Zaehler +" cubicel "
        Case 2:	WL_SD_RechteckVoll
            gMouseMove (40,35, 90,90) '/// rectangel 40,35, 90,90 ///
            Printlog " Object start ---------------------- "+ Zaehler +" rectangel "
        Case 3: WL_SD_Torus
            gMouseMove (1,35, 60,95) '/// donut ;-) 1,35, 60,95 ///
            Printlog " Object start ---------------------- "+ Zaehler +" donut "
    End Select
      sleep (1)
      FormatArea										'/// assign different area properties for created objects (use rnd function)///'
      sleep (1)
      kontext
    Select Case Zaehler
        Case 1:	active.SetPage TabFarbverlaeufe
                    kontext "TabFarbverlaeufe"
                    Tabelle.Select Int((Tabelle.GetItemCount * Rnd) + 1)
                printlog "test tbo-------------------------------------------------color of object : "+Tabelle.GetSelText
                    TabFarbverlaeufe.OK
        Case 2:	active.SetPage TabSchraffuren
                    kontext "TabSchraffuren"
                    Tabelle.Select Int((Tabelle.GetItemCount * Rnd) + 1)
                printlog "test tbo-------------------------------------------------color of object : "+Tabelle.GetSelText
                    TabSchraffuren.OK
        Case 3:	active.SetPage TabFarben
                    kontext "TabFarben"
                    Farbe.Select Int((Farbe.GetItemCount * Rnd) + 1)
                printlog "test tbo-------------------------------------------------color of object : "+Farbe.GetSelText
                    TabFarben.OK
    End Select
    sleep 1
    ContextPositionAndSize							'/// save position and size values into varialbes  ///'
    sleep (1)
    kontext
    active.SetPage TabPositionAndSize
    kontext "TabPositionAndSize"
    '/// the variables : Ueber_Text_[1-3] get set here ! with x position of object///
        Select Case Zaehler
            Case 1:	Ueber_Text_1 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
            Case 2:	Ueber_Text_2 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
            Case 3:	Ueber_Text_3 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
        End Select
    TabPositionAndSize.OK
      gMouseClick 96,5
   next Zaehler
   sleep 1
   call hFileSaveAsKill (Datei)							'/// save document  ///'
   printlog "OK   saved at ", Datei
   sleep 1
   '/// select in default order and take Position X in mind ;-) ///'
   '///+ has to be from bottom to top: cubicel, rectangel, donut ///'
    sPrintCheckOrder (TRUE)
    call hCloseDocument									'/// close document  ///'
    
endcase 'tiDatei_Fuer_Anordnen_Erstellen
'-------------------------------------------------------------------------------
testcase tdContextSendBackward

   dim sTemp as string
   '/// open created document 'with 3 figures' ///'
   if (hFileOpen (Datei)) then
      sleep 10
     sPrintCheckOrder (TRUE)
      '/// select the middle object: rectangle, with keys: [TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB>")
      '/// Send Backward / [Strg]+[-] -> one level more to the back ///'
      WL_TB_ANORDNUNG_WeiterNachHinten
      '///+ has to be from bottom to top: rectangel cubicel donut ///'
      sleep 2
     sPrintCheckOrder
      '/// deselect all ///'
      hTypeKeys ("<escape><escape>")
      sleep 2
      '/// select the middle object: cubical, with keys: [TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB>")
      sleep 2
      sTemp = fGetPositionX
      if sTemp <> Ueber_Text_1 then
          warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_1+";"
      end if
      '/// close document ///'
      Call hCloseDocument
   endif
   sleep 2
   
endcase 'tdContextSendBackward
'-------------------------------------------------------------------------------
testcase tdContextBringForward

   dim sTemp as string
   '/// open created document 'with 3 figures' ///'
   if (hFileOpen (Datei)) then
      sleep 10
     sPrintCheckOrder (TRUE)
      '/// select the middle object: rectangle, with keys: [TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB>")
      '/// Bring Forward / [Strg]+[+] -> one level more to the front ///'
      WL_TB_ANORDNUNG_WeiterNachVorn
      '/// has to be from bottom to top: cubicel donut rectangel ///'
      sleep 1
     sPrintCheckOrder
      '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB>")
      sleep 2
      sTemp = fGetPositionX
      if sTemp <> Ueber_Text_3 then
          warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
      end if
      sleep 1
      '/// close document ///'
      Call hCloseDocument
   endif
   
endcase 'tdContextBringForward
'-------------------------------------------------------------------------------
testcase tdContextSendToBack

   dim sTemp as string
   '/// open created document 'with 3 figures' ///'
   if (hFileOpen (Datei)) then
      sleep 10
     sPrintCheckOrder (TRUE)
      '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB><TAB>")
      '/// Send to Back / [Strg]+[Shift]+[-] -> backmost object ///'
      OL_DRAW_GanzNachHinten
      '/// has to be from bottom to top: rectangel cubicel donut ///'
      sleep 3
     sPrintCheckOrder
      '/// select the middle object: cubical, with keys: [TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB>")
      sleep 1
      sTemp = fGetPositionX
      if sTemp <> Ueber_Text_1 then
          warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_1+";"
      end if
      sleep 3
      '/// close document ///'
     Call hCloseDocument
   endif
   
endcase 'tdContextSendToBack
'-------------------------------------------------------------------------------
testcase tdContextBringToFront

   dim sTemp as string
   '/// open created document 'with 3 figures' ///'
   if (hFileOpen (Datei)) then
      sleep 10
     sPrintCheckOrder (TRUE)
      '/// select the bottom object: cubical, with keys: [TAB] ///'
      hTypeKeys ("<TAB>")
      '/// Bring to Front / [Strg]+[Shift]+[+] -> frontmost object ///'
      OL_DRAW_GanzNachVorn
      '/// has to be from bottom to top: rectangel, donut, cubicel ///'
     sPrintCheckOrder
      '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB>")
      sleep 1
      sTemp = fGetPositionX
      if sTemp <> Ueber_Text_3 then
          warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
      end if
      sleep 3
      '/// close document ///'
     Call hCloseDocument
   endif
   
endcase 'tdContextBringToFront
'-------------------------------------------------------------------------------
testcase tdContextInFrontOfObject

   dim sTemp as string
   '/// open created document 'with 3 figures' ///'
   if (hFileOpen (Datei)) then
      sleep 10
     sPrintCheckOrder (TRUE)
      '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB><TAB>")
      '/// In Front of object ///'
      OL_DRAW_VorDasObjekt
      '/// left click the cubicel with the mouse ///'
      gMouseClick 50,5
      '/// has to be from bottom to top: cubicel, donut, rectangel ///'
     sPrintCheckOrder
      sleep 1
      '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB>")
      sTemp = fGetPositionX
      if sTemp <> Ueber_Text_3 then
          printlog "DISABLED the WARNLOG, because mouseaction is not always the same :-( : Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
      end if
      '/// close document ///'
      Call hCloseDocument
   endif
   
endcase 'tdContextInFrontOfObject
'-------------------------------------------------------------------------------
testcase tdContextBehindObject

   dim sTemp as string
   '/// open created document 'with 3 figures' ///'
   if (hFileOpen (Datei)) then
      sleep 10
     sPrintCheckOrder (TRUE)
      '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
      hTypeKeys ("<TAB><TAB><TAB>")
      '/// Behind object ///'
      OL_DRAW_HinterDasObjekt
      sleep 1
      '/// left click the cubicel with the mouse ///'
      gMouseClick 50,5
      '/// has to be from bottom to top: donut, cubicel, rectangel ///'
     sPrintCheckOrder
      sleep 1
      '/// select the bottom object: donut, with keys: [TAB] ///'
      hTypeKeys ("<TAB>")
      sTemp = fGetPositionX
      if sTemp <> Ueber_Text_3 then
          printlog "DISABLED the WARNLOG, because mouseaction is not always tthe same  Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
      end if
      '/// close document ///'
      Call hCloseDocument
   endif
   
endcase 'tdContextBehindObject
'-------------------------------------------------------------------------------
testcase tdContextReverse

   dim sTemp as string
   dim sTemp2 as string
   dim i as integer
   '/// open created document 'with 3 figures' ///'
   if (hFileOpen (Datei)) then
      sleep 10
     sPrintCheckOrder (TRUE)
      '/// Edit->Select All ///'
      EditSelectAll
      sleep 3
      '/// Reverse ///'
      WL_TB_ANORDNUNG_Vertauschen
     sPrintCheckOrder
      '/// select in default order and take Position X in mind ;-) ///'
      hTypeKeys ("<escape><escape>")
      for i = 1 to 3
         hTypeKeys ("<TAB>")
         sTemp = fGetPositionX
            Select Case i
                Case 1:	sTemp2 = Ueber_Text_3
                Case 2:	sTemp2 = Ueber_Text_2
                Case 3:	sTemp2 = Ueber_Text_1
            End Select
         if sTemp <> sTemp2 then
            warnlog " - " + i + " Arrangement is wrong; is: "+sTemp+"; should: "+sTemp2+";"
         end if
      next i
      '/// close document ///'
      Call hCloseDocument									'/// close document  ///'
   endif
   
endcase 'tdContextReverse
'-------------------------------------------------------------------------------