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_area.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 '**************************************************************************************
41 '\*************************************************************************************
48 hNewDocument '/// New impress document ///'
49 hRechteckErstellen (20,20,60,60) '/// create rectangle ///'
50 Printlog " - Change Format" '/// change format for the rectangle ///'
53 active.SetPage TabArea
55 FillOptions.Select 5 '/// apply bitmap as texture ///'
56 BitmapList.Select 3 '/// Select "Water" ///'
57 Tile.Check '/// tile bitmap ///'
59 active.SetPage TabSchatten
61 Anzeigen.Check '/// apply shadow ///'
62 Entfernung.SetText "30" '/// set angle to 30���///'
63 Entf$=Entfernung.GetText '/// change distance ///'
64 Farbe.Select 15 '/// select color 15///'
65 TabSchatten.OK '/// close dialog ///'
68 Printlog " - Test various formats"
69 FormatArea '/// Format area, check if changes are saved for this object ///'
71 active.SetPage TabArea
73 if NOT FillOptions.GetSelIndex = 5 then
74 Warnlog "Bitmap is not checked"
76 if BitmapList.GetSelIndex <> 3 then Warnlog "Wrong bitmap used. "+ BitmapAuswahl.GetSelIndex
77 if NOT Tile.IsChecked then Warnlog "Tile is not checked"
78 ' if Original.IsChecked then Warnlog "Original is not checked"
79 ' if NOT Relativ.IsChecked then Warnlog "Relative is not checked"
80 ' if Breite.GetText <> "90 %" then Warnlog "Width is not 90%, it is: "+Breite.GetText
81 ' if XOffset.GetText <> "30 %" then Warnlog "XOffset is not 30%, it is: "+XOffset.GetText
82 ' if NOT Zeile.IsChecked then Warnlog "Line is not checked"
83 ' if Verschiebung.GetText <> "20 %" then Warnlog "Displace is not 20%, it is: " + Verschiebung.GetText
85 active.SetPage TabSchatten
87 if NOT Anzeigen.IsChecked then
88 Warnlog "Show shadows is not checked"
90 if Entfernung.GetText <> Entf$ then Warnlog "Distance is not " + Entf$ + " it is: "+ Entfernung.GetText
91 if Farbe.GetSelIndex <> 15 then Warnlog "Wrong color for shadow. It is: "+ Farbe.GetSelIndex
96 hCloseDocument '/// close document ///'
99 '--------------------------------------------------------
100 testcase tdFormatArea1
107 Dim Winkel_1 as string
113 ColorName$ = "Bullshit"
114 dim Zaehler as integer
116 Call hNewDocument '/// new document ///'
118 Call hRechteckErstellen (30,30,70,70) '/// create rectangle ///'
120 FormatArea '/// format area ///'
122 Active.SetPage TabArea
124 FillOptions.Select 1 '/// Select no fill ///'
130 Active.SetPage TabArea
132 sleep 1 '/// control if changes are still there after closing and reopening dialog ///'
133 FillOptions.Select 3'/// check gradient and select 1 ///'
134 ZaehlerVerlauf = GradientList.GetItemCount
136 GradientList.Select j
140 Active.SetPage TabArea
142 PrintLog GradientList.GetSelText
144 FillOptions.Select 4 '/// select hatching, control after closing and reopening dialog if changes are recognized ///'
145 HatchingList.GetItemCount
146 ZaehlerSchraffur = HatchingList.GetItemCount
147 for k=1 to 2'ZaehlerSchraffur
148 HatchingList.Select k
152 Active.SetPage TabArea
154 PrintLog HatchingList.GetSelText
157 FillOptions.Select 5 '/// check bitmap, control if changes are permanent after closing and reopening dialog ///'
158 BitmapList.GetItemCount
159 ZaehlerBitmap = BitmapList.GetItemCount
160 for n=1 to ZaehlerBitmap
166 Active.SetPage TabArea
168 PrintLog BitmapList.GetSelText
171 if Tile.IsChecked = False Then Tile.Check '/// check tile ///'
172 ' if Anpassen.IsEnabled = False Then PrintLog " Option Tile activated"
173 ' if Anpassen.IsEnabled = True Then WarnLog " Option Tile not activated"
174 ' if Relativ.IsChecked = False Then
175 ' SetClipboard Breite.GetText
177 ' If Breite.GetText = GetClipboardText Then
178 ' WarnLog " Relative isnt working"
180 ' PrintLog " Relative works"
184 ' if Kacheln.IsChecked = True Then Kacheln.UnCheck
186 ' if Relativ.IsEnabled = True Then WarnLog " Option Anpassen konnte nicht aktiviert werden"
187 ' if not Relativ.IsEnabled Then PrintLog " Option Anpassen funktioniert"
190 ' if Breite.IsEnabled And Hoehe.IsEnabled = True Then WarnLog " Button Original funktioniert nicht"
191 ' if Breite.IsEnabled And Hoehe.IsEnabled = False Then PrintLog " Button Original funktioniert"
193 ' setClipboard XOffset.GetText
195 ' if XOffset.GetText <> GetClipboardText Then PrintLog " Position XOffset funktioniert"
196 ' if XOffset.GetText = GetClipboardText Then WarnLog " Position XOffset funktioniert nicht"
197 ' SetClipboard YOffset.GetText
199 ' if YOffset.GetText <> GetClipboardText Then PrintLog " Position YOffset funktioniert"
200 ' if YOffset.GetText = GetClipboardText Then WarnLog " Position YOffset funktioniert nicht"
201 ' PrintLog " TabArea fertig"
203 Active.SetPage TabSchatten
204 Kontext "TabSchatten"
206 if Anzeigen.IsChecked = True Then Anzeigen.UnCheck '/// uncheck shadow ///'
208 if Entfernung.IsEnabled = False Then '/// check if shadow related controls are disabled with no shadow ///'
209 PrintLog " Show shadow works"
211 WarnLog " Show shadow does not work"
214 Anzeigen.Check '/// check shadow ///'
215 SetClipboard Entfernung.GetText '/// change distance ///'
217 if GetClipboardText = Entfernung.GetText Then
218 WarnLog " Distance does not work"
220 PrintLog " Distance does work"
222 Farbe.Select 5 '/// change shadow color ///'
225 Active.SetPage TabFarben
232 Farbname.SetText "Bullshit" '/// change color ///'
238 Active.SetPage TabArea
241 if ColourList.GetSelText = "Bullshit" Then
242 PrintLog " Color selection changed "
244 WarnLog " Color selection not changed"
247 Active.SetPage TabFarben
252 Active.SetPage TabFarben '/// test RGB color model ///'
254 Farbmodell.Select 1 '/// switch to RGB values ///' ' 33:RVB,CMJN
255 printlog " Selected colourmodel RGB?: "+Farbmodell.GetSelText
256 if left(Farbmodell.GetSelText,1) <> "R" then warnlog "not RGB selected ? :-("
262 warnlog "RGB text fields are not enabled :-("
266 Kontext "DocumentDraw"
269 Active.SetPage TabFarben
271 if (R.GetText = "50" And G.GetText = "10" And B.GetText = "90") Then
272 PrintLog "Changes in RGB done"
274 WarnLog " Chancges in RGB values not recognized, instead of R=50 , G=10 und B=90 it is " +R.GetText + " " + G.GetText + " " + B.GetText
277 FarbName.SetText "Brighter" '/// add a color ///'
279 Farbe.Select "Brighter"
280 Loeschen.Click '/// delete color ///'
284 Active.SetPage TabFarben
286 Bearbeiten.Click '/// edit color ///'
291 Active.SetPage TabFarben
296 Active.SetPage TabFarben
302 Active.SetPage TabFarbverlaeufe
303 Kontext "TabFarbverlaeufe"
310 Active.SetPage TabTransparenz
311 Kontext "TabTransparenz"
312 KeineTransparenz.Check '/// check if controls are disabled if transparence is disabled ///'
313 Printlog "- No transparency is checked, all controls should be disabled."
314 if MFLinTransparenz.IsEnabled Then Warnlog "- Transparency enabled"
315 if TransparenzverlaufTyp.IsEnabled Then Warnlog "- Graidient enabled"
316 if MFZentrumX.IsEnabled Then Warnlog "- Center X enabled"
317 if MFZentrumY.IsEnabled Then Warnlog "- Center Y enabled"
318 if MFWinkel.IsEnabled Then Warnlog "- Angle enabled"
319 if MFRand.IsEnabled Then Warnlog "- Border enabled"
320 if MFStartwert.IsEnabled Then Warnlog "- Start value enabled"
321 if MFEndwert.IsEnabled Then Warnlog "- End value enabled"
323 LineareTransparenz.Check '/// check linear tranparency ///'
324 Printlog "- Set transparency to linear, all controls should be enabled now" '/// control if related controls are now enabled ///'
326 MFLinTransparenz.ToMax '/// change values of controls ///'
327 if MFLinTransparenz.GetText <>"100%" Then Warnlog "- Maximum value not correct"
328 MFLinTransparenz.ToMin
329 if MFLinTransparenz.GetText <>"0%" Then Warnlog "- Minimum value not correct"
330 if TransparenzverlaufTyp.IsEnabled Then Warnlog "- Gradient enabled"
331 if MFZentrumX.IsEnabled Then Warnlog "- Centrum X enabled"
332 if MFZentrumY.IsEnabled Then Warnlog "- Centrum Y enabled"
333 if MFWinkel.IsEnabled Then Warnlog "- Angle enabled"
334 if MFRand.IsEnabled Then Warnlog "- Border enabled"
335 if MFStartwert.IsEnabled Then Warnlog "- Start value enabled"
336 if MFEndwert.IsEnabled Then Warnlog "- End value enabled"
338 Transparenzverlauf.Check
339 Printlog "- Gradient for transprency enabled"
340 if MFLinTransparenz.IsEnabled = "false" Then Warnlog "- Transparency disabled"
341 if TransparenzverlaufTyp.IsEnabled = "false" Then Warnlog "- Gradient disabled"
342 if MFZentrumX.IsEnabled = "false" Then Warnlog "- Center X disabled"
343 if MFZentrumY.IsEnabled = "false" Then Warnlog "- Center Y disabled"
344 if MFWinkel.IsEnabled = "false" Then Warnlog "- Anlge disabled"
345 if MFRand.IsEnabled = "false" Then Warnlog "- Border disabled"
346 if MFStartwert.IsEnabled = "false" Then Warnlog "- Start value disabled"
347 if MFEndwert.IsEnabled = "false" Then Warnlog "- End value disabled"
349 Printlog "- Check if changed values are saved"
351 Zaehler=TransparenzverlaufTyp.GetItemCount
353 TransparenzverlaufTyp.Select i
354 SetClipboard Transparenzverlauftyp.GetSelText
360 Active.SetPage TabTransparenz '/// check if values are saved after closing and reopening dialog ///'
361 Kontext "TabTransparenz"
362 if not Transparenzverlauftyp.GetSelIndex = i Then Warnlog "- Values are not correct for gradient transparency"
364 TransparenzverlaufTyp.Select 2
365 if MFZentrumX.IsEnabled Then Warnlog "- Center X should not be enabled"
366 if MFZentrumY.IsEnabled Then Warnlog "- Center Y should not be enabled"
367 MFWinkel.SetText "45"
368 Winkel_1 = MFWinkel.GetText
374 Active.SetPage TabTransparenz
375 Kontext "TabTransparenz"
376 if TransparenzverlaufTyp.GetSelIndex <>2 Then
377 Warnlog "- Second menu-item is not choosen"
379 TransparenzverlaufTyp.Select 3
380 if MFWinkel.GetText <> Winkel_1 then Warnlog "- The inserted value is not accepted"
381 if MFWinkel.GetText <> Winkel_1 Then TransparenzverlaufTyp.Select 3
382 if MFWinkel.IsEnabled Then Warnlog " - Angle should not be active when Radial is choosen"
384 MFZentrumX.SetText "30"
385 MFZentrumY.SetText "30"
391 Active.SetPage TabTransparenz
392 Kontext "TabTransparenz"
393 if MFZentrumX.GetText <> "30%" Then Warnlog "- Setted value for Center X is not applied."
394 if MFZentrumY.GetText <> "30%" Then Warnlog "- Setted value for Center Y is not applied."
396 MFStartwert.SetText "20"
397 MFEndwert.SetText "30"
403 Active.SetPage TabTransparenz
404 Kontext "TabTransparenz"
405 if MFRand.GetText <> "10%" Then Warnlog "- Border-value was not set."
406 if MFEndwert.GetText <> "30%" Then Warnlog "- End-value was not set."
407 if MFStartwert.GetText <> "20%" Then Warnlog "- Start-value was not set."
410 Call hCloseDocument '/// close document ///'
412 endcase 'tdFormatArea1