1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE script:module PUBLIC
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
4 * This file is part of the LibreOffice project.
6 * This Source Code Form is subject to the terms of the Mozilla Public
7 * License, v. 2.0. If a copy of the MPL was not distributed with this
8 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 * This file incorporates work covered by the following license notice:
12 * Licensed to the Apache Software Foundation (ASF) under one or more
13 * contributor license agreements. See the NOTICE file distributed
14 * with this work for additional information regarding copyright
15 * ownership. The ASF licenses this file to you under the Apache
16 * License, Version 2.0 (the "License"); you may not use this file
17 * except in compliance with the License. You may obtain a copy of
18 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 <script:module xmlns:
script=
"http://openoffice.org/2000/script" script:
name=
"RoadMap" script:
language=
"StarBasic">REM ***** BASIC *****
27 Dim oUseDialog As Object
28 Dim oModulName As Object
30 Sub RoadMapMain(ModulNameforItemChange, dialogtoUse)
31 GlobalScope.BasicLibraries.LoadLibrary(
"Tools
")
32 oUseDialog = dialogtoUse
33 oModulName = ModulNameforItemChange
34 oDialogModel = oUseDialog.Model
35 oControlModel = oUseDialog.Model.CreateInstance(
"com.sun.star.awt.UnoControlRoadmapModel
")
37 oDialogModel.insertByName(
"RoadMap
", oControlModel)
38 oControl = oUseDialog.getControl(
"RoadMap
")
39 oEvent = createUnoListener(
"CallBack_
",
"com.sun.star.awt.XItemListener
" )
40 oControl.addItemListener(oEvent)
41 oControlModel.CurrentItemID =
0
42 oControlModel.Complete = True
43 oControlModel.Activated = True
46 Sub SetVisibleRoadMap(param)
47 oControl.SetVisible(param)
50 Sub SetDialogModelSize(Width, Height)
51 oDialogModel.Width = Width
52 oDialogModel.Height = Height
55 Sub SetControlModelPosSize(X, Y, Width, Height)
56 oControlModel.PositionX = X
57 oControlModel.PositionY = Y
58 oControlModel.Width = Width
59 oControlModel.Height = Height
62 Sub SetControlModelText( ModelText As String)
63 oControlModel.Text = ModelText
66 Sub InsertItemsLabels( ItemLabelsArray() As String)
67 For i =
0 To Ubound(ItemLabelsArray())
68 oRoadmapItem = oControlModel.createInstance()
69 oRoadmapItem.Label = ItemLabelsArray(i)
71 oControlModel.insertbyIndex(i, oRoadmapItem)
75 Sub SetItemEnabled( ItemIndex, param)
76 oControlModel.getByIndex(ItemIndex).Enabled = param
77 oControlModel.CurrentItemID = ItemIndex
80 Sub AddImagetoControlModel( Url As String)
81 oControlModel.ImageUrl = ConvertToUrl(Url)
84 Function GetSelectedIndex()
85 GetSelectedIndex() = oControlModel.CurrentItemID
88 Function GetControlModel()
89 GetControlModel = oControlModel
92 Function GetDialogModel()
93 GetDialogModel = oDialogModel
96 Sub Callback_itemStateChanged(aEvent)
97 oModulName.ItemChange(oControlModel.CurrentItemID, aEvent.itemID)
100 Sub SetComplete(param)
101 oControlModel.Complete = param
104 Sub SetActivated(param)
105 oControlModel.Activated = param
108 Sub RemoveItem(ItemIndex)
109 If ItemIndex
> -
1 Then
110 oControlModel.removeByIndex(ItemIndex)
114 Sub InsertItem(ItemLabel As String)
115 oRoadmapItem = oControlModel.createInstance()
116 oRoadmapItem.Label = ItemLabel
117 oControlModel.insertbyIndex(oControlModel.CurrentItemID, oRoadmapItem)
120 Sub ReplaceItem(ItemLabel As String)
121 oRoadmapItem = oControlModel.createInstance()
122 oRoadmapItem.Label = ItemLabel
123 oControlModel.replacebyIndex(oControlModel.CurrentItemID, oRoadmapItem)
126 Sub Callback_disposing(aEvent)
129 Sub Property_propertyChange(aEvent)
132 Sub Property_disposing(aEvent)