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_clipexport2.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 '*******************************************************************
40 ' #1 MakeTextSquare :Inserts a text frame with content
41 ' #1 MakeRectangle :Inserts a Rectangle
42 ' #1 MakeCircle :Inserts a circle if not Writer or Calc
43 ' #1 Make3dObject :Inserts a 3DObject if not Writer or Calc
44 ' #1 MakeCurveObject :Inserts Curve Object if not Writer or Calc
45 ' #1 MakeLineObject :Inserts line object if not writer or calc
46 ' #1 MakeConnectorObject :Inserts Connector object if not wirter or calc
47 ' #1 MakeFormattedTextLine :Insert a formatted text line
48 ' #1 Formfunctions :Inserts a push button
49 ' #1 Objectplugin :Inserting a Plugin
51 '\*******************************************************************
55 printlog "--------- Testing: TextSquare ---------"
56 Call hTextRahmenErstellen ("This is a text-frame",15,20,40,30)
61 '-------------------------------------------------------------------------------
64 printlog "we run rectangle"
65 Call hRechteckErstellen (15,15,30,30)
69 '-------------------------------------------------------------------------------
72 printlog "Create Circle"
73 if gApplication = "WRITER" then
74 Warnlog "Cant make circle in this application"
77 if gApplication = "CALC" then
78 Warnlog "Cant make circle in this application"
81 printlog "we run Circle"
86 gMouseMove (15,15,30,30)
92 '-------------------------------------------------------------------------------
95 printlog "Create 3dObject"
96 if (Ucase(gApplication) = "CALC") then
97 warnlog "Cant make circle in this application"
100 if (Ucase(gApplication) = "WRITER") then
101 warnlog "Cant make circle in this application"
105 printlog "we run 3d-Object"
107 if Drei_D_Objekte.exists then
108 Drei_D_Objekte.tearoff
109 Kontext "ThreeDObjectsbar"
113 gMouseMove (15,15,35,35)
115 Kontext "ThreeDObjectsbar"
116 ThreeDObjectsbar.close
118 if (gApplication = "DRAW") then
124 Drei_D_Objekte.tearoff
125 Kontext "ThreeDObjectsbar"
130 gMouseMove (15,15,35,35)
132 Kontext "ThreeDObjectsbar"
133 ThreeDObjectsbar.close
139 hMenuItemUnCheck (11)
147 Drei_D_Objekte.tearoff
148 Kontext "ThreeDObjectsbar"
153 gMouseMove (15,15,35,35)
155 Kontext "ThreeDObjectsbar"
156 ThreeDObjectsbar.close
162 hMenuItemUnCheck (11)
169 '-------------------------------------------------------------------------------
172 if (Ucase(gApplication) = "WRITER") then
173 warnlog "Cant make circle in this application"
176 if (Ucase(gApplication) = "CALC") then
177 warnlog "Cant make circle in this application"
181 printlog "we run Curve-object"
183 Toolbar.OpenContextMenu
192 gMouseMove (10,25,30,35)
197 Toolbar.OpenContextMenu
206 '-------------------------------------------------------------------------------
209 if gApplication = "WRITER" then
210 warnlog "Currently no support for line-object in this application"
213 if gApplication = "CALC" then
214 warnlog "Currently no support for line-object in this application"
217 printlog "we run Line-object"
221 Kontext "Arrowshapes"
225 SetKontextApplication
227 gMouseMove 10,15,20,27
230 Kontext "Arrowshapes"
235 '-------------------------------------------------------------------------------
236 sub MakeConnectorObject
238 if gApplication = "WRITER" then
239 warnlog "Cant make connector in this application"
242 if gApplication = "CALC" then
243 warnlog "Cant make connector in this application"
246 printlog "we run Connector-object"
247 if gApplication = "DRAW" then
251 Verbinder.TearOff ' Insert connector
252 kontext "Connectorsbar"
257 SetKontextApplication
259 gMouseMove (10,17,30,37)
262 if gApplication = "IMPRESS" then
265 Verbinder.TearOff ' Insert connector
266 kontext "Connectorsbar"
271 SetKontextApplication
273 gMouseMove (10,17,30,37)
279 '-------------------------------------------------------------------------------
280 sub MakeFormattedTextLine
282 dim Zufall, iWaitIndex as integer
283 Kontext "TextObjectbar"
284 if TextObjectbar.Exists then
285 printlog " TextObjectbar.Exists = " + TextObjectbar.Exists
287 ViewToolbarsTextFormatting
291 hTypeKeys "This is a text which we will format in some different ways."
292 hTypeKeys "<SHIFT HOME>" 'Marked the inserted text. (= now ready for formatting)
293 Kontext "TextObjectbar"
294 Printlog " - choose random font"
297 'Schriftart.GetItemcount
298 Text1 = Schriftart.GetSelText
299 Printlog " -Font: '" + Schriftart.GetSelText + "' selected."
301 Kontext "TextObjectbar"
303 Printlog " - Change size of Font"
304 Schriftgroesse.Select (Zufall)
305 Printlog " - Fontsize set to '" + Schriftgroesse.GetSelText + "'."
306 Text2 = Schriftgroesse.GetSelText
307 Kontext "TextObjectbar"
310 Printlog " - Font attribute set to bold."
311 Text4 = Fett.GetState(2)
313 Kontext "TextObjectbar"
316 Printlog " - Font attribute set to cursive."
317 Text5 = Kursiv.GetState(2)
319 Kontext "TextObjectbar"
322 Printlog " - Font attribute set to underlined."
323 Text6 = Unterstrichen.GetState(2)
325 Kontext "TextObjectbar"
328 Printlog " - Text set to Justified."
329 Text7 = Blocksatz.GetState(2)
331 SetKontextApplication
333 end sub 'MakeFormattedTextLine
335 '--------------------------------------------------------------------------------------------------------
338 if (Ucase(gApplication) = "IMPRESS") then
341 Toolbar.OpenContextMenu ' enable forms button in menuebar
347 WL_WRITER_Formular.TearOff ' use fromsbutton
351 Toolbar.OpenContextMenu ' enable forms button in menuebar
357 WL_WRITER_Formular.TearOff ' use fromsbutton
359 printlog " enabled 'forms' button and clicked it"
361 kontext "FormControls"
362 if (Pushbutton.IsEnabled = FALSE) then
363 DesigneModus.click ' use forms menue, go into design mode
365 Pushbutton.Click ' use a pushbutton
368 gMouseMove (50, 20,70, 40)' create a pushbutton
372 Kontext "ControlPropertiesDialog"
374 ControlPropertiesDialog.Close
376 Kontext "ControlPropertiesDialog"
378 ControlPropertiesDialog.Close
380 sleep 5 ' needed, otherwise the context menue will get closed...
382 if (Ucase(gApplication) = "IMPRESS") then
384 Toolbar.OpenContextMenu ' disable forms button in menuebar
389 Toolbar.OpenContextMenu ' disable forms button in menuebar
395 '--------------------------------------------------------------------------------------------------------
398 printlog "Insert Object-plugin"
402 Kontext "PlugInEinfuegen"
403 'DialogTest ( PlugInEinfuegen)
406 'Call DialogTest ( OeffnenDlg )
407 if OeffnenDlg.exists (5) then
410 warnlog "Open file dialog didn't come up"
413 Kontext "PlugInEinfuegen"
414 if PlugInEinfuegen.exists then
415 DateiUrl.SetText (ConvertPath ( gTesttoolpath + "graphics\required\input\sample.mov" ))
416 printlog "Type something into the option field"
417 'Optionen so3:MultiLineEdit:MD_INSERT_OBJECT_PLUGIN:ED_PLUGINS_OPTIONS
418 Optionen.SetText "Fiddler's Green"
420 Optionen.TypeKeys "<HOME>"
421 Optionen.TypeKeys "<SHIFT><END>"
422 Optionen.TypeKeys "<delete>"
425 warnlog "Insert plugin isn't visible"
429 if Messagebox.exists (5) then
430 warnlog "Messagebox: " + Messagebox.gettext
435 '--------------------------------------------------------------------------------------------------------