1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: g_arrangealign.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 10:42:39 $
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 :
38 '**************************************************************************************
39 ' #1 tiDatei_Fuer_Anordnen_Erstellen
40 ' #1 tdContextSendBackward
41 ' #1 tdContextBringForward
42 ' #1 tdContextSendToBack
43 ' #1 tdContextBringToFront
45 ' #1 tdContextInFrontOfObject
46 ' #1 tdContextBehindObject
47 '\*************************************************************************************
48 testcase tiDatei_Fuer_Anordnen_Erstellen
52 dim zaehler as integer
53 '/// This function creates the document, that will be used as reference and working object inthe following cases :-) ///'
54 '///'Dim Datei ' somewhere global :-) defined in calling sub! :sub im_107c_ ///
55 call hNewDocument '/// new document ///'
56 if Dir(Datei)<>"" then app.Kill(Datei) ' kill old file
57 for Zaehler = 1 to 3 '/// create 3 overlapping objects ///'
61 gMouseMove (20,5, 80,60) '/// cubicel 20,5, 80,60 ///
62 Printlog " Object start ---------------------- "+ Zaehler +" cubicel "
63 Case 2: WL_SD_RechteckVoll
64 gMouseMove (40,35, 90,90) '/// rectangel 40,35, 90,90 ///
65 Printlog " Object start ---------------------- "+ Zaehler +" rectangel "
67 gMouseMove (1,35, 60,95) '/// donut ;-) 1,35, 60,95 ///
68 Printlog " Object start ---------------------- "+ Zaehler +" donut "
71 FormatArea '/// assign different area properties for created objects (use rnd function)///'
75 Case 1: active.SetPage TabFarbverlaeufe
76 kontext "TabFarbverlaeufe"
77 Tabelle.Select Int((Tabelle.GetItemCount * Rnd) + 1)
78 printlog "test tbo-------------------------------------------------color of object : "+Tabelle.GetSelText
80 Case 2: active.SetPage TabSchraffuren
81 kontext "TabSchraffuren"
82 Tabelle.Select Int((Tabelle.GetItemCount * Rnd) + 1)
83 printlog "test tbo-------------------------------------------------color of object : "+Tabelle.GetSelText
85 Case 3: active.SetPage TabFarben
87 Farbe.Select Int((Farbe.GetItemCount * Rnd) + 1)
88 printlog "test tbo-------------------------------------------------color of object : "+Farbe.GetSelText
92 ContextPositionAndSize '/// save position and size values into varialbes ///'
95 active.SetPage TabPositionAndSize
96 kontext "TabPositionAndSize"
97 '/// the variables : Ueber_Text_[1-3] get set here ! with x position of object///
99 Case 1: Ueber_Text_1 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
100 Case 2: Ueber_Text_2 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
101 Case 3: Ueber_Text_3 = PositionX.GetText : printlog "xpos: "+zaehler+": "+PositionX.GetText
103 TabPositionAndSize.OK
107 call hFileSaveAsKill (Datei) '/// save document ///'
108 printlog "OK saved at ", Datei
110 '/// select in default order and take Position X in mind ;-) ///'
111 '///+ has to be from bottom to top: cubicel, rectangel, donut ///'
112 sPrintCheckOrder (TRUE)
113 call hCloseDocument '/// close document ///'
115 endcase 'tiDatei_Fuer_Anordnen_Erstellen
116 '-------------------------------------------------------------------------------
117 testcase tdContextSendBackward
120 '/// open created document 'with 3 figures' ///'
121 if (hFileOpen (Datei)) then
123 sPrintCheckOrder (TRUE)
124 '/// select the middle object: rectangle, with keys: [TAB],[TAB] ///'
125 hTypeKeys ("<TAB><TAB>")
126 '/// Send Backward / [Strg]+[-] -> one level more to the back ///'
127 WL_TB_ANORDNUNG_WeiterNachHinten
128 '///+ has to be from bottom to top: rectangel cubicel donut ///'
131 '/// deselect all ///'
132 hTypeKeys ("<escape><escape>")
134 '/// select the middle object: cubical, with keys: [TAB],[TAB] ///'
135 hTypeKeys ("<TAB><TAB>")
137 sTemp = fGetPositionX
138 if sTemp <> Ueber_Text_1 then
139 warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_1+";"
141 '/// close document ///'
146 endcase 'tdContextSendBackward
147 '-------------------------------------------------------------------------------
148 testcase tdContextBringForward
151 '/// open created document 'with 3 figures' ///'
152 if (hFileOpen (Datei)) then
154 sPrintCheckOrder (TRUE)
155 '/// select the middle object: rectangle, with keys: [TAB],[TAB] ///'
156 hTypeKeys ("<TAB><TAB>")
157 '/// Bring Forward / [Strg]+[+] -> one level more to the front ///'
158 WL_TB_ANORDNUNG_WeiterNachVorn
159 '/// has to be from bottom to top: cubicel donut rectangel ///'
162 '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
163 hTypeKeys ("<TAB><TAB>")
165 sTemp = fGetPositionX
166 if sTemp <> Ueber_Text_3 then
167 warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
170 '/// close document ///'
174 endcase 'tdContextBringForward
175 '-------------------------------------------------------------------------------
176 testcase tdContextSendToBack
179 '/// open created document 'with 3 figures' ///'
180 if (hFileOpen (Datei)) then
182 sPrintCheckOrder (TRUE)
183 '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
184 hTypeKeys ("<TAB><TAB><TAB>")
185 '/// Send to Back / [Strg]+[Shift]+[-] -> backmost object ///'
186 OL_DRAW_GanzNachHinten
187 '/// has to be from bottom to top: rectangel cubicel donut ///'
190 '/// select the middle object: cubical, with keys: [TAB],[TAB] ///'
191 hTypeKeys ("<TAB><TAB>")
193 sTemp = fGetPositionX
194 if sTemp <> Ueber_Text_1 then
195 warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_1+";"
198 '/// close document ///'
202 endcase 'tdContextSendToBack
203 '-------------------------------------------------------------------------------
204 testcase tdContextBringToFront
207 '/// open created document 'with 3 figures' ///'
208 if (hFileOpen (Datei)) then
210 sPrintCheckOrder (TRUE)
211 '/// select the bottom object: cubical, with keys: [TAB] ///'
213 '/// Bring to Front / [Strg]+[Shift]+[+] -> frontmost object ///'
215 '/// has to be from bottom to top: rectangel, donut, cubicel ///'
217 '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
218 hTypeKeys ("<TAB><TAB>")
220 sTemp = fGetPositionX
221 if sTemp <> Ueber_Text_3 then
222 warnlog "Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
225 '/// close document ///'
229 endcase 'tdContextBringToFront
230 '-------------------------------------------------------------------------------
231 testcase tdContextInFrontOfObject
234 '/// open created document 'with 3 figures' ///'
235 if (hFileOpen (Datei)) then
237 sPrintCheckOrder (TRUE)
238 '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
239 hTypeKeys ("<TAB><TAB><TAB>")
240 '/// In Front of object ///'
242 '/// left click the cubicel with the mouse ///'
244 '/// has to be from bottom to top: cubicel, donut, rectangel ///'
247 '/// select the middle object: donut, with keys: [TAB],[TAB] ///'
248 hTypeKeys ("<TAB><TAB>")
249 sTemp = fGetPositionX
250 if sTemp <> Ueber_Text_3 then
251 printlog "DISABLED the WARNLOG, because mouseaction is not always the same :-( : Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
253 '/// close document ///'
257 endcase 'tdContextInFrontOfObject
258 '-------------------------------------------------------------------------------
259 testcase tdContextBehindObject
262 '/// open created document 'with 3 figures' ///'
263 if (hFileOpen (Datei)) then
265 sPrintCheckOrder (TRUE)
266 '/// select the top object: donut, with keys: [TAB],[TAB],[TAB] ///'
267 hTypeKeys ("<TAB><TAB><TAB>")
268 '/// Behind object ///'
269 OL_DRAW_HinterDasObjekt
271 '/// left click the cubicel with the mouse ///'
273 '/// has to be from bottom to top: donut, cubicel, rectangel ///'
276 '/// select the bottom object: donut, with keys: [TAB] ///'
278 sTemp = fGetPositionX
279 if sTemp <> Ueber_Text_3 then
280 printlog "DISABLED the WARNLOG, because mouseaction is not always tthe same Arrangement is wrong; is: "+sTemp+"; should: "+Ueber_Text_3+";"
282 '/// close document ///'
286 endcase 'tdContextBehindObject
287 '-------------------------------------------------------------------------------
288 testcase tdContextReverse
293 '/// open created document 'with 3 figures' ///'
294 if (hFileOpen (Datei)) then
296 sPrintCheckOrder (TRUE)
297 '/// Edit->Select All ///'
301 WL_TB_ANORDNUNG_Vertauschen
303 '/// select in default order and take Position X in mind ;-) ///'
304 hTypeKeys ("<escape><escape>")
307 sTemp = fGetPositionX
309 Case 1: sTemp2 = Ueber_Text_3
310 Case 2: sTemp2 = Ueber_Text_2
311 Case 3: sTemp2 = Ueber_Text_1
313 if sTemp <> sTemp2 then
314 warnlog " - " + i + " Arrangement is wrong; is: "+sTemp+"; should: "+sTemp2+";"
317 '/// close document ///'
318 Call hCloseDocument '/// close document ///'
321 endcase 'tdContextReverse
322 '-------------------------------------------------------------------------------