1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 3*3e02b54dSAndrew Rist<!--*********************************************************** 4*3e02b54dSAndrew Rist * 5*3e02b54dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 6*3e02b54dSAndrew Rist * or more contributor license agreements. See the NOTICE file 7*3e02b54dSAndrew Rist * distributed with this work for additional information 8*3e02b54dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 9*3e02b54dSAndrew Rist * to you under the Apache License, Version 2.0 (the 10*3e02b54dSAndrew Rist * "License"); you may not use this file except in compliance 11*3e02b54dSAndrew Rist * with the License. You may obtain a copy of the License at 12*3e02b54dSAndrew Rist * 13*3e02b54dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 14*3e02b54dSAndrew Rist * 15*3e02b54dSAndrew Rist * Unless required by applicable law or agreed to in writing, 16*3e02b54dSAndrew Rist * software distributed under the License is distributed on an 17*3e02b54dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18*3e02b54dSAndrew Rist * KIND, either express or implied. See the License for the 19*3e02b54dSAndrew Rist * specific language governing permissions and limitations 20*3e02b54dSAndrew Rist * under the License. 21*3e02b54dSAndrew Rist * 22*3e02b54dSAndrew Rist ***********************************************************--> 23cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="RoadMap" script:language="StarBasic">REM ***** BASIC ***** 24cdf0e10cSrcweirDim oControlModel 25cdf0e10cSrcweirDim oDialogModel 26cdf0e10cSrcweirDim CurrentItem 27cdf0e10cSrcweirDim bLongString 28cdf0e10cSrcweirDim oControl 29cdf0e10cSrcweirDim oEvent 30cdf0e10cSrcweirDim oUseDialog As Object 31cdf0e10cSrcweirDim oModulName As Object 32cdf0e10cSrcweir 33cdf0e10cSrcweirSub RoadMapMain(ModulNameforItemChange, dialogtoUse) 34cdf0e10cSrcweir GlobalScope.BasicLibraries.LoadLibrary("Tools") 35cdf0e10cSrcweir oUseDialog = dialogtoUse 36cdf0e10cSrcweir oModulName = ModulNameforItemChange 37cdf0e10cSrcweir oDialogModel = oUseDialog.Model 38cdf0e10cSrcweir oControlModel = oUseDialog.Model.CreateInstance("com.sun.star.awt.UnoControlRoadmapModel") 39cdf0e10cSrcweir 40cdf0e10cSrcweir oDialogModel.insertByName("RoadMap", oControlModel) 41cdf0e10cSrcweir oControl = oUseDialog.getControl("RoadMap") 42cdf0e10cSrcweir oEvent = createUnoListener( "CallBack_", "com.sun.star.awt.XItemListener" ) 43cdf0e10cSrcweir oControl.addItemListener(oEvent) 44cdf0e10cSrcweir oControlModel.CurrentItemID = 0 45cdf0e10cSrcweir oControlModel.Complete = True 46cdf0e10cSrcweir oControlModel.Activated = True 47cdf0e10cSrcweirEnd Sub 48cdf0e10cSrcweir 49cdf0e10cSrcweirSub SetVisibleRoadMap(param) 50cdf0e10cSrcweir oControl.SetVisible(param) 51cdf0e10cSrcweirEnd Sub 52cdf0e10cSrcweir 53cdf0e10cSrcweirSub SetDialogModelSize(Width, Height) 54cdf0e10cSrcweir oDialogModel.Width = Width 55cdf0e10cSrcweir oDialogModel.Height = Height 56cdf0e10cSrcweirEnd Sub 57cdf0e10cSrcweir 58cdf0e10cSrcweirSub SetControlModelPosSize(X, Y, Width, Height) 59cdf0e10cSrcweir oControlModel.PositionX = X 60cdf0e10cSrcweir oControlModel.PositionY = Y 61cdf0e10cSrcweir oControlModel.Width = Width 62cdf0e10cSrcweir oControlModel.Height = Height 63cdf0e10cSrcweirEnd Sub 64cdf0e10cSrcweir 65cdf0e10cSrcweirSub SetControlModelText( ModelText As String) 66cdf0e10cSrcweir oControlModel.Text = ModelText 67cdf0e10cSrcweirEnd Sub 68cdf0e10cSrcweir 69cdf0e10cSrcweirSub InsertItemsLabels( ItemLabelsArray() As String) 70cdf0e10cSrcweir For i = 0 To Ubound(ItemLabelsArray()) 71cdf0e10cSrcweir oRoadmapItem = oControlModel.createInstance() 72cdf0e10cSrcweir oRoadmapItem.Label = ItemLabelsArray(i) 73cdf0e10cSrcweir oRoadmapItem.ID = i 74cdf0e10cSrcweir oControlModel.insertbyIndex(i, oRoadmapItem) 75cdf0e10cSrcweir Next i 76cdf0e10cSrcweirEnd Sub 77cdf0e10cSrcweir 78cdf0e10cSrcweirSub SetItemEnabled( ItemIndex, param) 79cdf0e10cSrcweir oControlModel.getByIndex(ItemIndex).Enabled = param 80cdf0e10cSrcweir oControlModel.CurrentItemID = ItemIndex 81cdf0e10cSrcweirEnd Sub 82cdf0e10cSrcweir 83cdf0e10cSrcweirSub AddImagetoControlModel( Url As String) 84cdf0e10cSrcweir oControlModel.ImageUrl = ConvertToUrl(Url) 85cdf0e10cSrcweirEnd Sub 86cdf0e10cSrcweir 87cdf0e10cSrcweirFunction GetSelectedIndex() 88cdf0e10cSrcweir GetSelectedIndex() = oControlModel.CurrentItemID 89cdf0e10cSrcweirEnd Function 90cdf0e10cSrcweir 91cdf0e10cSrcweirFunction GetControlModel() 92cdf0e10cSrcweir GetControlModel = oControlModel 93cdf0e10cSrcweirEnd Function 94cdf0e10cSrcweir 95cdf0e10cSrcweirFunction GetDialogModel() 96cdf0e10cSrcweir GetDialogModel = oDialogModel 97cdf0e10cSrcweirEnd Function 98cdf0e10cSrcweir 99cdf0e10cSrcweirSub Callback_itemStateChanged(aEvent) 100cdf0e10cSrcweir oModulName.ItemChange(oControlModel.CurrentItemID, aEvent.itemID) 101cdf0e10cSrcweirEnd Sub 102cdf0e10cSrcweir 103cdf0e10cSrcweirSub SetComplete(param) 104cdf0e10cSrcweir oControlModel.Complete = param 105cdf0e10cSrcweirEnd Sub 106cdf0e10cSrcweir 107cdf0e10cSrcweirSub SetActivated(param) 108cdf0e10cSrcweir oControlModel.Activated = param 109cdf0e10cSrcweirEnd Sub 110cdf0e10cSrcweir 111cdf0e10cSrcweirSub RemoveItem(ItemIndex) 112cdf0e10cSrcweir If ItemIndex > -1 Then 113cdf0e10cSrcweir oControlModel.removeByIndex(ItemIndex) 114cdf0e10cSrcweir End If 115cdf0e10cSrcweirEnd Sub 116cdf0e10cSrcweir 117cdf0e10cSrcweirSub InsertItem(ItemLabel As String) 118cdf0e10cSrcweir oRoadmapItem = oControlModel.createInstance() 119cdf0e10cSrcweir oRoadmapItem.Label = ItemLabel 120cdf0e10cSrcweir oControlModel.insertbyIndex(oControlModel.CurrentItemID, oRoadmapItem) 121cdf0e10cSrcweirEnd Sub 122cdf0e10cSrcweir 123cdf0e10cSrcweirSub ReplaceItem(ItemLabel As String) 124cdf0e10cSrcweir oRoadmapItem = oControlModel.createInstance() 125cdf0e10cSrcweir oRoadmapItem.Label = ItemLabel 126cdf0e10cSrcweir oControlModel.replacebyIndex(oControlModel.CurrentItemID, oRoadmapItem) 127cdf0e10cSrcweirEnd Sub 128cdf0e10cSrcweir 129cdf0e10cSrcweirSub Callback_disposing(aEvent) 130cdf0e10cSrcweirEnd Sub 131cdf0e10cSrcweir 132cdf0e10cSrcweirSub Property_propertyChange(aEvent) 133cdf0e10cSrcweirEnd Sub 134cdf0e10cSrcweir 135cdf0e10cSrcweirSub Property_disposing(aEvent) 136cdf0e10cSrcweirEnd Sub 137*3e02b54dSAndrew Rist</script:module> 138