Update ooo320-m1
[ooovba.git] / qadevOOo / tests / basic / mod / forms / OComboBoxControl / forms_OComboBoxControl.xba
blob35eafece23146a7d74f0e645f0fc4d2139177c65
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.
9 '
10 ' Copyright 2008 by Sun Microsystems, Inc.
12 ' OpenOffice.org - a multi-platform office productivity suite
14 ' $RCSfile: forms_OComboBoxControl.xba,v $
16 ' $Revision: 1.3 $
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:
41 option explicit
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
65 Sub CreateObj()
67 '*************************************************************************
68 ' COMPONENT:
69 ' forms.OComboBoxControl
70 '*************************************************************************
71 On Error Goto ErrHndl
73 Dim bOK As Boolean
74 Dim oShape1 As Object
75 Dim oShape2 As Object
76 Dim oShape3 As Object
77 Dim oCurrCtrl As Object
78 Dim oWin As Object
79 Dim oKit As Object
80 Dim oDevice As Object
81 Dim oDoc2 As Object
83 bOK = true
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())
101 oContext = oDoc
102 oWinpeer = oWin
103 oToolkit = oKit
104 oXWindow = oCurrCtrl.getControl(oShape3.getControl())
105 oCtrlShape = oShape1
108 Exit Sub
109 ErrHndl:
110 Test.Exception()
111 End Sub
112 </script:module>