| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> |
| <script:module xmlns:script="http://openoffice.org/2000/script" script:name="toolkit_UnoControlDialog" script:language="StarBasic"> |
| |
| |
| '************************************************************************* |
| ' |
| ' Licensed to the Apache Software Foundation (ASF) under one |
| ' or more contributor license agreements. See the NOTICE file |
| ' distributed with this work for additional information |
| ' regarding copyright ownership. The ASF licenses this file |
| ' to you under the Apache License, Version 2.0 (the |
| ' "License"); you may not use this file except in compliance |
| ' with the License. You may obtain a copy of the License at |
| ' |
| ' http://www.apache.org/licenses/LICENSE-2.0 |
| ' |
| ' Unless required by applicable law or agreed to in writing, |
| ' software distributed under the License is distributed on an |
| ' "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| ' KIND, either express or implied. See the License for the |
| ' specific language governing permissions and limitations |
| ' under the License. |
| ' |
| '************************************************************************* |
| |
| |
| |
| |
| |
| ' Be sure that all variables are dimensioned: |
| option explicit |
| |
| |
| ' REQUIRED VARIABLES for interface/service tests: |
| Global oGraphics as Object |
| Global oContext as Object |
| Global oWinpeer as Object |
| Global oToolkit as Object |
| Global oModel as Object |
| Global oXWindow as Object |
| Global oCtrlShape as Object |
| |
| Global oXControl1 as Object |
| Global oXControl2 as Object |
| |
| |
| Sub CreateObj() |
| |
| '************************************************************************* |
| ' COMPONENT: |
| ' toolkit.UnoControlDialog |
| '************************************************************************* |
| On Error Goto ErrHndl |
| Dim oWin As Object |
| Dim oKit As Object |
| Dim oDevice As Object |
| Dim oDoc2 As Object |
| Dim oDlgModel As Object |
| Dim oButModel As Object |
| Dim oDlgControl As Object |
| Dim oComponentInstance As Object |
| Dim oComponentModel As Object |
| Dim oXWindowModel As Object |
| |
| oDlgModel = createUnoService("com.sun.star.awt.UnoControlDialogModel") |
| oDlgControl = createUnoService("com.sun.star.awt.UnoControlDialog") |
| oDlgControl.setModel(oDlgModel) |
| |
| oComponentModel = createUnoService("com.sun.star.awt.UnoControlDialogModel") |
| oComponentInstance = createUnoService("com.sun.star.awt.UnoControlDialog") |
| oComponentInstance.setModel(oComponentModel) |
| |
| oXWindowModel = createUnoService("com.sun.star.awt.UnoControlDialogModel") |
| oXWindow = createUnoService("com.sun.star.awt.UnoControlDialog") |
| oXWindow.setModel(oXWindowModel) |
| |
| oButModel = createUnoService("com.sun.star.awt.UnoControlButtonModel") |
| oXControl1 = createUnoService("com.sun.star.awt.UnoControlButton") |
| oXControl1.setModel(oButModel) |
| oButModel = createUnoService("com.sun.star.awt.UnoControlButtonModel") |
| oXControl2 = createUnoService("com.sun.star.awt.UnoControlButton") |
| oXControl2.setModel(oButModel) |
| |
| oDlgControl.setVisible(true) |
| oDlgControl.setPosSize(0, 0, 200, 100, com.sun.star.awt.PosSize.SIZE) |
| oContext = oDlgModel |
| oModel = oDlgModel |
| oWinpeer = oDlgControl.getPeer() |
| oToolkit = oWinpeer.getToolkit() |
| oDevice = oToolKit.createScreenCompatibleDevice(200,200) |
| oGraphics = oDevice.createGraphics() |
| |
| oObj = oDlgControl |
| Exit Sub |
| ErrHndl: |
| Test.Exception() |
| End Sub |
| |
| Sub DisposeObj() |
| oXWindow.Dispose() |
| End Sub |
| </script:module> |