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=
"awt_XCheckBox" 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: awt_XCheckBox.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:
44 Dim bIL_itemStateChanged As Boolean
49 '*************************************************************************
51 ' com.sun.star.awt.XCheckBox
52 '*************************************************************************
55 Dim oListener As Object
57 bIL_itemStateChanged = False
58 out.log(
"create listener for item events")
59 oListener = createUnoListener(
"IL_",
"com.sun.star.awt.XItemListener")
61 Test.StartMethod(
"addItemListener()")
62 oObj.addItemListener(oListener)
63 out.log(
"Can be checked only interactively !!!")
65 Test.MethodTested(
"addItemListener()", bOK)
67 Test.StartMethod(
"removeItemListener()")
68 oObj.removeItemListener(oListener)
70 Test.MethodTested(
"removeItemListener()", bOK)
72 Test.StartMethod(
"getState()")
73 Test.StartMethod(
"setState()")
74 Dim state, newState As Integer
75 state = oObj.getState()
76 Out.Log(
"current state of check-box: " + state)
81 Out.Log(
"set new state: " + newState)
82 oObj.setState(newState)
83 bOK = (newState = oObj.getState())
84 Test.MethodTested(
"getState()", bOK)
85 Test.MethodTested(
"setState()", bOK)
87 Test.StartMethod(
"setLabel()")
88 oObj.setLabel(
"XCheckBox test")
90 Test.MethodTested(
"setLabel()", bOK)
92 Test.StartMethod(
"enableTriState()")
93 oObj.enableTriState(True)
95 Test.MethodTested(
"enableTriState()", bOK)
107 Sub IL_itemStateChanged
108 Out.Log(
"CallBack for ItemListener itemStateChanged was called.")
109 bIL_itemStateChanged = true