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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : marc.neumann@oracle.com
30 '* short description : Helper Routines for Base tests.
32 '***************************************************************************************
34 '* #1 fOpenNewFormDesign
40 '\***********************************************************************************
41 '-------------------------------------------------------------------------
42 function fOpenNewFormDesign()
43 '/// open a a new form design from an open database
44 '/// <u>parameter:</u>
47 if ( Database.NotExists(3) ) then
48 fOpenNewFormDesign = false
52 Database.MouseDown(50,50)
53 Database.MouseUp(50,50)
62 fOpenNewFormDesign = true
65 '--------------------------------------------------------------------
66 function fCloseForm( optional bSave )
67 '/// close an open form
68 '/// <u>parameter:</u>
69 '/// <b><i>optional</i> bSave:</b> if true the form shall be saved, if false the changes are lost
73 Kontext "DocumentWriter"
74 DocumentWriter.UseMenu
75 hMenuSelectNr(1) ' the file menu
76 hMenuSelectNr(5) ' the Close Window
78 'when issue 30401 is fixed this has to be changed
80 if Messagebox.Exists(3) then
81 if ( IsMissing( bSave ) ) then
97 '--------------------------------------------------------------------
98 function fSaveForm( sFormName as string, optional bCloseForm as boolean )
99 '/// save an open form with the given name
100 '/// <u>parameter:</u>
101 '/// <b>sFormName:</b> the name under which the form shall be saved. If the file allready exists, then the file will be overwritten
102 '/// <b><i>optional</i> bCloseForm:</b> if true the form shall be closed after saving, if false form stay open
105 Kontext "DocumentWriter"
106 DocumentWriter.UseMenu
107 hMenuSelectNr(1) ' the file menu
108 hMenuSelectNr(6) ' the Save
110 Kontext "FormSaveDialog"
111 if FormSaveDialog.exists(3) then
112 FormName.setText(sFormName)
114 'click yes in the overwrite messages box
116 if MessageBox.exists(1) then
124 if ( IsMissing( bCloseForm ) ) then
131 '--------------------------------------------------------------------
132 function fOpenForm(sFormName as string)
133 '/// open a form with the given name
134 '/// <u>parameter:</u>
135 '/// <b>sFormName:</b> the name of the form which shall be open
137 if ( fFindForm(sFormName) = true ) then
138 printlog "Form found -> open"
139 Kontext "ContainerView"
140 OpenForm ' uno-Slot .uno:DB/Open
144 printlog "Form not found."
149 '--------------------------------------------------------------------
150 function fFindForm(sFormName as string)
151 '/// select a form with the given name
152 '/// <u>parameter:</u>
153 '/// <b>sFormName:</b> the name of the form which shall be selected
155 Dim iNumbersOfForms as integer
158 Kontext "ContainerView"
164 if ( Not FormTree.exists(1) ) then
165 warnlog "The form tree doesn't exists"
169 iNumbersOfForms = FormTree.getItemCount()
171 ' this select the first entry
172 FormTree.TypeKeys "<HOME>"
173 FormTree.TypeKeys "<UP>"
176 for i = 1 to iNumbersOfForms
178 FormTree.TypeKeys "<ADD>"
180 'printlog "FormName.getItemCount = " + FormTree.getItemCount
181 if FormTree.getItemCount > iNumbersOfForms then
182 iNumbersOfForms = FormTree.getItemCount()
184 'printlog "FormName.getSeltext = " + FormTree.getSeltext
185 if FormTree.getSeltext = sFormName then
189 FormTree.TypeKeys "<DOWN>"