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: t_toolbar_tools1.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 10:27:09 $
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 : helge.delfs@sun.com
36 '* short description : Toolbar tools 1
38 '***************************************************************************************
40 ' #1 fActiveObjectInToolbar ' active/inactive image button in toolbar
42 '\*************************************************************************************
44 '******************************************************************
45 '* Created by hercule.li@sun.com
46 '* This function will active or inactive image button in toolbar
47 '* sToolbar : Toolbar name
48 '* sObject : image button name
49 '* bActive : Active or Inactive image button
52 '* Will return the original status of the image button
53 '*****************************************************************
54 function fActiveObjectInToolbar(sToolbar as String , sObject as String , bActive as Boolean) as Boolean
56 Dim iObject as Integer
57 Dim sToolbarName as String
60 sToolbarName = fGetToolbarName(sToolbar)
61 iObject = fGetObject(sToolbar , sObject)
66 Active.SetPage TabCustomizeToolbars
67 Kontext "TabCustomizeToolbars"
68 Menu.Select sToolbarName
70 ToolbarContents.Typekeys "<Home>"
73 ToolbarContents.Typekeys "<Down>" , iObject-1
75 sFlag = ToolbarContents.IsChecked
76 if bActive = TRUE then
77 if sFlag = FALSE then ToolbarContents.Check
79 ToolbarContents.UnCheck
81 TabCustomizeToolbars.OK
82 fActiveObjectInToolbar = sFlag
87 '******************************************
88 '* This function will Get toolbar's name **
89 '* Return Toolbar's name in StarOffice **
90 '******************************************
91 function fGetToolbarName(sToolbar) as String
96 case 01 : fGetToolbarName = "3D-Settings"
97 case 33 : fGetToolbarName = "3D-Settings"
98 case 34 : fGetToolbarName = "3D-Settings"
99 case 39 : fGetToolbarName = "3D-Settings"
100 case 46 : fGetToolbarName = "3D-Settings"
101 case 49 : fGetToolbarName = "3D-Einstellungen"
102 case 55 : fGetToolbarName = "3D-Settings"
103 case 81 : fGetToolbarName = "3D-Settings"
104 case 82 : fGetToolbarName = "3D-Settings"
105 case 86 : fGetToolbarName = "3D-Settings"
106 case 88 : fGetToolbarName = "3D-Settings"
107 case else : QAErrorLog "The test does not support the language " + iSprache
108 fGetToolbarName = "3D-Settings"
113 case 01 : fGetToolbarName = "Align"
114 case 33 : fGetToolbarName = "Align"
115 case 34 : fGetToolbarName = "Align"
116 case 39 : fGetToolbarName = "Align"
117 case 46 : fGetToolbarName = "Align"
118 case 49 : fGetToolbarName = "Ausrichten"
119 case 55 : fGetToolbarName = "Align"
120 case 81 : fGetToolbarName = "Align"
121 case 82 : fGetToolbarName = "Align"
122 case 86 : fGetToolbarName = "Align"
123 case 88 : fGetToolbarName = "Align"
124 case else : QAErrorLog "The test does not support the language " + iSprache
125 fGetToolbarName = "Align"
128 case "Basic Shapes" :
130 case 01 : fGetToolbarName = "Basic Shapes"
131 case 33 : fGetToolbarName = "Basic Shapes"
132 case 34 : fGetToolbarName = "Basic Shapes"
133 case 39 : fGetToolbarName = "Basic Shapes"
134 case 46 : fGetToolbarName = "Basic Shapes"
135 case 49 : fGetToolbarName = "Standardformen"
136 case 55 : fGetToolbarName = "Basic Shapes"
137 case 81 : fGetToolbarName = "Basic Shapes"
138 case 82 : fGetToolbarName = "Basic Shapes"
139 case 86 : fGetToolbarName = "Basic Shapes"
140 case 88 : fGetToolbarName = "Basic Shapes"
141 case else : QAErrorLog "The test does not support the language " + iSprache
142 fGetToolbarName = "Basic Shapes"
145 case "Block Arrows" :
147 case 01 : fGetToolbarName = "Block Arrows"
148 case 33 : fGetToolbarName = "Block Arrows"
149 case 34 : fGetToolbarName = "Block Arrows"
150 case 39 : fGetToolbarName = "Block Arrows"
151 case 46 : fGetToolbarName = "Block Arrows"
152 case 49 : fGetToolbarName = "Blockpfeile"
153 case 55 : fGetToolbarName = "Block Arrows"
154 case 81 : fGetToolbarName = "Block Arrows"
155 case 82 : fGetToolbarName = "Block Arrows"
156 case 86 : fGetToolbarName = "Block Arrows"
157 case 88 : fGetToolbarName = "Block Arrows"
158 case else : QAErrorLog "The test does not support the language " + iSprache
159 fGetToolbarName = "Block Arrows"
162 case "Bullets and Numbering" :
164 case 01 : fGetToolbarName = "Bullets and Numbering"
165 case 33 : fGetToolbarName = "Bullets and Numbering"
166 case 34 : fGetToolbarName = "Bullets and Numbering"
167 case 39 : fGetToolbarName = "Bullets and Numbering"
168 case 46 : fGetToolbarName = "Bullets and Numbering"
169 case 49 : fGetToolbarName = "Nummerierung und Aufzählungszeichen"
170 case 55 : fGetToolbarName = "Bullets and Numbering"
171 case 81 : fGetToolbarName = "Bullets and Numbering"
172 case 82 : fGetToolbarName = "Bullets and Numbering"
173 case 86 : fGetToolbarName = "Bullets and Numbering"
174 case 88 : fGetToolbarName = "Bullets and Numbering"
175 case else : QAErrorLog "The test does not support the language " + iSprache
176 fGetToolbarName = "Bullets and Numbering"
179 case "Database Form Design" :
181 case 01 : fGetToolbarName = "Database Form Design"
182 case 33 : fGetToolbarName = "Database Form Design"
183 case 34 : fGetToolbarName = "Database Form Design"
184 case 39 : fGetToolbarName = "Database Form Design"
185 case 46 : fGetToolbarName = "Database Form Design"
186 case 49 : fGetToolbarName = "Datenbank Formularentwurf"
187 case 55 : fGetToolbarName = "Database Form Design"
188 case 81 : fGetToolbarName = "Database Form Design"
189 case 82 : fGetToolbarName = "Database Form Design"
190 case 86 : fGetToolbarName = "Database Form Design"
191 case 88 : fGetToolbarName = "Database Form Design"
192 case else : QAErrorLog "The test does not support the language " + iSprache
193 fGetToolbarName = "Database Form Design"
198 case 01 : fGetToolbarName = "Drawing"
199 case 33 : fGetToolbarName = "Drawing"
200 case 34 : fGetToolbarName = "Drawing"
201 case 39 : fGetToolbarName = "Drawing"
202 case 46 : fGetToolbarName = "Drawing"
203 case 49 : fGetToolbarName = "Zeichnen"
204 case 55 : fGetToolbarName = "Drawing"
205 case 81 : fGetToolbarName = "Drawing"
206 case 82 : fGetToolbarName = "Drawing"
207 case 86 : fGetToolbarName = "Drawing"
208 case 88 : fGetToolbarName = "Drawing"
209 case else : QAErrorLog "The test does not support the language " + iSprache
210 fGetToolbarName = "Drawing"
213 case "Drawing Object Properties" :
215 case 01 : fGetToolbarName = "Drawing Object Properties"
216 case 33 : fGetToolbarName = "Drawing Object Properties"
217 case 34 : fGetToolbarName = "Drawing Object Properties"
218 case 39 : fGetToolbarName = "Drawing Object Properties"
219 case 46 : fGetToolbarName = "Drawing Object Properties"
220 case 49 : fGetToolbarName = "Zeichnungsobjekt-Eigenschaften"
221 case 55 : fGetToolbarName = "Drawing Object Properties"
222 case 81 : fGetToolbarName = "Drawing Object Properties"
223 case 82 : fGetToolbarName = "Drawing Object Properties"
224 case 86 : fGetToolbarName = "Drawing Object Properties"
225 case 88 : fGetToolbarName = "Drawing Object Properties"
226 case else : QAErrorLog "The test does not support the language " + iSprache
227 fGetToolbarName = "Drawing Object Properties"
232 case 01 : fGetToolbarName = "Form Design"
233 case 33 : fGetToolbarName = "Form Design"
234 case 34 : fGetToolbarName = "Form Design"
235 case 39 : fGetToolbarName = "Form Design"
236 case 46 : fGetToolbarName = "Form Design"
237 case 49 : fGetToolbarName = "Formular Entwurf"
238 case 55 : fGetToolbarName = "Form Design"
239 case 81 : fGetToolbarName = "Form Design"
240 case 82 : fGetToolbarName = "Form Design"
241 case 86 : fGetToolbarName = "Form Design"
242 case 88 : fGetToolbarName = "Form Design"
243 case else : QAErrorLog "The test does not support the language " + iSprache
244 fGetToolbarName = "Form Design"
249 case 01 : fGetToolbarName = "Formatting"
250 case 33 : fGetToolbarName = "Formatting"
251 case 34 : fGetToolbarName = "Formatting"
252 case 39 : fGetToolbarName = "Formatting"
253 case 46 : fGetToolbarName = "Formatting"
254 case 49 : fGetToolbarName = "Format"
255 case 55 : fGetToolbarName = "Formatting"
256 case 81 : fGetToolbarName = "Formatting"
257 case 82 : fGetToolbarName = "Formatting"
258 case 86 : fGetToolbarName = "Formatting"
259 case 88 : fGetToolbarName = "Formatting"
260 case else : QAErrorLog "The test does not support the language " + iSprache
261 fGetToolbarName = "Formatting"
266 case 01 : fGetToolbarName = "Frame"
267 case 33 : fGetToolbarName = "Frame"
268 case 34 : fGetToolbarName = "Frame"
269 case 39 : fGetToolbarName = "Frame"
270 case 46 : fGetToolbarName = "Frame"
271 case 49 : fGetToolbarName = "Rahmen"
272 case 55 : fGetToolbarName = "Frame"
273 case 81 : fGetToolbarName = "Frame"
274 case 82 : fGetToolbarName = "Frame"
275 case 86 : fGetToolbarName = "Frame"
276 case 88 : fGetToolbarName = "Frame"
277 case else : QAErrorLog "The test does not support the language " + iSprache
278 fGetToolbarName = "Frame"
283 case 01 : fGetToolbarName = "Insert"
284 case 33 : fGetToolbarName = "Insert"
285 case 34 : fGetToolbarName = "Insert"
286 case 39 : fGetToolbarName = "Insert"
287 case 46 : fGetToolbarName = "Insert"
288 case 49 : fGetToolbarName = "Einfügen"
289 case 55 : fGetToolbarName = "Insert"
290 case 81 : fGetToolbarName = "Insert"
291 case 82 : fGetToolbarName = "Insert"
292 case 86 : fGetToolbarName = "Insert"
293 case 88 : fGetToolbarName = "Insert"
294 case else : QAErrorLog "The test does not support the language " + iSprache
295 fGetToolbarName = "Insert"
300 case 01 : fGetToolbarName = "OLE-Object"
301 case 33 : fGetToolbarName = "OLE-Object"
302 case 34 : fGetToolbarName = "OLE-Object"
303 case 39 : fGetToolbarName = "OLE-Object"
304 case 46 : fGetToolbarName = "OLE-Object"
305 case 49 : fGetToolbarName = "OLE Objekt"
306 case 55 : fGetToolbarName = "OLE-Object"
307 case 81 : fGetToolbarName = "OLE-Object"
308 case 82 : fGetToolbarName = "OLE-Object"
309 case 86 : fGetToolbarName = "OLE-Object"
310 case 88 : fGetToolbarName = "OLE-Object"
311 case else : QAErrorLog "The test does not support the language " + iSprache
312 fGetToolbarName = "OLE-Object"
317 case 01 : fGetToolbarName = "Standard"
318 case 33 : fGetToolbarName = "Standard"
319 case 34 : fGetToolbarName = "Standard"
320 case 39 : fGetToolbarName = "Standard"
321 case 46 : fGetToolbarName = "Standard"
322 case 49 : fGetToolbarName = "Standard"
323 case 55 : fGetToolbarName = "Standard"
324 case 81 : fGetToolbarName = "Standard"
325 case 82 : fGetToolbarName = "Standard"
326 case 86 : fGetToolbarName = "Standard"
327 case 88 : fGetToolbarName = "Standard"
328 case else : QAErrorLog "The test does not support the language " + iSprache
329 fGetToolbarName = "Standard"
334 case 01 : fGetToolbarName = "Table"
335 case 33 : fGetToolbarName = "Table"
336 case 34 : fGetToolbarName = "Table"
337 case 39 : fGetToolbarName = "Table"
338 case 46 : fGetToolbarName = "Table"
339 case 49 : fGetToolbarName = "Tabelle"
340 case 55 : fGetToolbarName = "Table"
341 case 81 : fGetToolbarName = "Table"
342 case 82 : fGetToolbarName = "Table"
343 case 86 : fGetToolbarName = "Table"
344 case 88 : fGetToolbarName = "Table"
345 case else : QAErrorLog "The test does not support the language " + iSprache
346 fGetToolbarName = "Table"
351 case 01 : fGetToolbarName = "Text Object"
352 case 33 : fGetToolbarName = "Text Object"
353 case 34 : fGetToolbarName = "Text Object"
354 case 39 : fGetToolbarName = "Text Object"
355 case 46 : fGetToolbarName = "Text Object"
356 case 49 : fGetToolbarName = "Textobjekt"
357 case 55 : fGetToolbarName = "Text Object"
358 case 81 : fGetToolbarName = "Text Object"
359 case 82 : fGetToolbarName = "Text Object"
360 case 86 : fGetToolbarName = "Text Object"
361 case 88 : fGetToolbarName = "Text Object"
362 case else : QAErrorLog "The test does not support the language " + iSprache
363 fGetToolbarName = "Text Object"
366 case "XML Form Design" :
368 case 01 : fGetToolbarName = "XML Form Design"
369 case 33 : fGetToolbarName = "XML Form Design"
370 case 34 : fGetToolbarName = "XML Form Design"
371 case 39 : fGetToolbarName = "XML Form Design"
372 case 46 : fGetToolbarName = "XML Form Design"
373 case 49 : fGetToolbarName = "XML Formularentwurf"
374 case 55 : fGetToolbarName = "XML Form Design"
375 case 81 : fGetToolbarName = "XML Form Design"
376 case 82 : fGetToolbarName = "XML Form Design"
377 case 86 : fGetToolbarName = "XML Form Design"
378 case 88 : fGetToolbarName = "XML Form Design"
379 case else : QAErrorLog "The test does not support the language " + iSprache
380 fGetToolbarName = "XML Form Design"
387 '*******************************************************
388 '* This function will get the location for image button
389 '* in Commands in Tools/Customize/Toolbars
390 '*******************************************************
391 function fGetObject(sToolbar as String , sObject as String) as Integer
393 select case gApplication
395 case "WRITER" : fGetObject = fGetObjectWriter(sToolbar , sObject)
396 case "HTML" : fGetObject = fGetObjectWriter(sToolbar , sObject)
397 case "MASTERDOCUMENT" : fGetObject = fGetObjectWriter(sToolbar , sObject)
399 case "CALC" : fGetObject = fGetObjectCalc(sToolbar , sObject)
401 case "IMPRESS" : fGetObject = fGetObjectImpress(sToolbar , sObject)