1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE script:module PUBLIC
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3 <script:module xmlns:
script=
"http://openoffice.org/2000/script" script:
name=
"forms_OComboBoxControl" script:
language=
"StarBasic">
6 '*************************************************************************
8 ' DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10 ' Copyright
2008 by Sun Microsystems, Inc.
12 ' OpenOffice.org - a multi-platform office productivity suite
14 ' $RCSfile: forms_OComboBoxControl.xba,v $
18 ' This file is part of OpenOffice.org.
20 ' OpenOffice.org is free software: you can redistribute it and/or modify
21 ' it under the terms of the GNU Lesser General Public License version
3
22 ' only, as published by the Free Software Foundation.
24 ' OpenOffice.org is distributed in the hope that it will be useful,
25 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
26 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ' GNU Lesser General Public License version
3 for more details
28 ' (a copy is included in the LICENSE file that accompanied this code).
30 ' You should have received a copy of the GNU Lesser General Public License
31 ' version
3 along with OpenOffice.org. If not, see
32 '
<http://www.openoffice.org/license.html
>
33 ' for a copy of the LGPLv3 License.
35 '*************************************************************************
36 '*************************************************************************
40 ' Be sure that all variables are dimensioned:
45 ' REQUIRED VARIABLES for interface/service tests:
47 ' Required for com.sun.star.awt.XView:
48 Global oGraphics as Object
50 ' Required for com.sun.star.lang.XComponent:
51 Global oComponentInstance As Object ' it will be disposed
53 ' Required for com.sun.star.awt.XControl:
54 Global oContext As Object
55 Global oWinpeer As Object
56 Global oToolkit As Object
57 Global oModel As Object
59 ' Required for com.sun.star.awt.XWindow:
60 Global oXWindow as Object
61 Global oCtrlShape As Variant
67 '*************************************************************************
69 ' forms.OComboBoxControl
70 '*************************************************************************
77 Dim oCurrCtrl As Object
85 oDoc = utils.createDocument(
"swriter", cObjectName)
86 ' oDoc2 = utils.createDocument(
"swriter", cObjectName +
"2")
88 oShape1 = toolkittools.addControlToDefaultForm(
"ComboBox",
1000,
1000,
3000,
1500)
89 oShape2 = toolkittools.addControlToDefaultForm(
"ComboBox",
1000,
3000,
3000,
1500)
90 oShape3 = toolkittools.addControlToDefaultForm(
"TextField",
1000,
5000,
3000,
1500)
92 oModel = oShape1.getControl()
93 oCurrCtrl = oDoc.getCurrentController()
94 oWin = oCurrCtrl.getControl(oModel).getPeer()
95 oKit = oWin.getToolkit()
96 oDevice = oKit.createScreenCompatibleDevice(
200,
200)
97 oGraphics = oDevice.createGraphics()
99 oObj = oCurrCtrl.getControl(oModel)
100 oComponentInstance = oCurrCtrl.getControl(oShape2.getControl())
104 oXWindow = oCurrCtrl.getControl(oShape3.getControl())