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: basic_modules.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:13 $
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 : joerg.skottke@sun.com
36 '* short description : Edit several modules and dialogs in basic ide
38 '\******************************************************************************
41 testcase tMore_Modules_Dialogs
43 '///<h1>Work with macros - create multiple modules</h1>
48 dim iCurrentTab as integer
51 cFile = gOfficePath & "user\work\basic.odt"
53 const FILTER = "writer8"
55 'const iTABCOUNT is the number of dialogs and modules.
56 'If iTABCOUNT = 10 then 20 tabs (+ the first one!) = 21 should be created.
58 const iTABCOUNT as Integer = 10
59 const CMODULE = "TTMODULE"
61 '///+<li>Delete workfile just in case it was left over by prior testrun</li>
64 '///+<li>Create a new Writer document.</li>
65 printlog "open a new writer-doc"
66 gApplication = "WRITER"
69 '///+<li>Create a new module for the new document (named TTModule)</li>
70 brc = hInitBasicIDE( CMODULE )
72 '///+<li>Insert 10 modules.</li>
73 printlog "insert 10 modules"
75 for iCurrentTab = 1 to iTABCOUNT
76 printlog " - insert new module : " & iCurrentTab
79 Tabbar.OpenContextMenu
84 EditWindow.TypeKeys "'# " & ( iCurrentTab + 1 ) & ". module in this document"
88 '///+<li>Insert 10 dialogs</li>
89 printlog "insert 10 dialogs"
91 for iCurrentTab = 1 to iTABCOUNT
92 printlog " - insert new dialog : " & iCurrentTab
93 Tabbar.OpenContextMenu
97 if DialogWindow.Exists (2) <> TRUE then
98 warnlog "No dialog window is shown!"
103 '///+<li>Close the BasicIDE.</li>
104 printlog Chr(13) + "- close the BasicIDE"
107 '///+<li>Save the document.</li>
108 printlog Chr(13) + "- save the document"
109 Call hFileSaveAsWithFilterKill( cFile , FILTER )
111 '///+<li>Close the document</li>
112 printlog Chr(13) + "- close the document"
115 '///+<li>Open the saved document</li>
116 printlog Chr(13) + "- open the saved document"
119 '///+<li>Open the BASIC Organizer, select the module for the current document</li>
122 hSelectNodeByName( MakroAus , CMODULE )
124 '///+<li>Select the last module and open the BASIC IDE.</li>
127 '///+<li>Delete all modules and dialogs.</li>
128 printlog "delete all modules and dialogs"
130 for iCurrentTab = 1 to ( 2 * iTABCOUNT + 1 )
133 printlog "delete - " & iCurrentTab & "/" & ( 2 * iTABCOUNT + 1 )
137 Tabbar.OpenContextMenu
143 if Active.Exists then
146 warnlog "No warning after deleting a dialog!"
150 QAErrorLog "Deleting - " & iCurrentTab & "/" & ((2 * iTABCOUNT)+1) & " failed."