1*cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2*cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> 3*cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="RoadMap" script:language="StarBasic">REM ***** BASIC ***** 4*cdf0e10cSrcweirDim oControlModel 5*cdf0e10cSrcweirDim oDialogModel 6*cdf0e10cSrcweirDim CurrentItem 7*cdf0e10cSrcweirDim bLongString 8*cdf0e10cSrcweirDim oControl 9*cdf0e10cSrcweirDim oEvent 10*cdf0e10cSrcweirDim oUseDialog As Object 11*cdf0e10cSrcweirDim oModulName As Object 12*cdf0e10cSrcweir 13*cdf0e10cSrcweirSub RoadMapMain(ModulNameforItemChange, dialogtoUse) 14*cdf0e10cSrcweir GlobalScope.BasicLibraries.LoadLibrary("Tools") 15*cdf0e10cSrcweir oUseDialog = dialogtoUse 16*cdf0e10cSrcweir oModulName = ModulNameforItemChange 17*cdf0e10cSrcweir oDialogModel = oUseDialog.Model 18*cdf0e10cSrcweir oControlModel = oUseDialog.Model.CreateInstance("com.sun.star.awt.UnoControlRoadmapModel") 19*cdf0e10cSrcweir 20*cdf0e10cSrcweir oDialogModel.insertByName("RoadMap", oControlModel) 21*cdf0e10cSrcweir oControl = oUseDialog.getControl("RoadMap") 22*cdf0e10cSrcweir oEvent = createUnoListener( "CallBack_", "com.sun.star.awt.XItemListener" ) 23*cdf0e10cSrcweir oControl.addItemListener(oEvent) 24*cdf0e10cSrcweir oControlModel.CurrentItemID = 0 25*cdf0e10cSrcweir oControlModel.Complete = True 26*cdf0e10cSrcweir oControlModel.Activated = True 27*cdf0e10cSrcweirEnd Sub 28*cdf0e10cSrcweir 29*cdf0e10cSrcweirSub SetVisibleRoadMap(param) 30*cdf0e10cSrcweir oControl.SetVisible(param) 31*cdf0e10cSrcweirEnd Sub 32*cdf0e10cSrcweir 33*cdf0e10cSrcweirSub SetDialogModelSize(Width, Height) 34*cdf0e10cSrcweir oDialogModel.Width = Width 35*cdf0e10cSrcweir oDialogModel.Height = Height 36*cdf0e10cSrcweirEnd Sub 37*cdf0e10cSrcweir 38*cdf0e10cSrcweirSub SetControlModelPosSize(X, Y, Width, Height) 39*cdf0e10cSrcweir oControlModel.PositionX = X 40*cdf0e10cSrcweir oControlModel.PositionY = Y 41*cdf0e10cSrcweir oControlModel.Width = Width 42*cdf0e10cSrcweir oControlModel.Height = Height 43*cdf0e10cSrcweirEnd Sub 44*cdf0e10cSrcweir 45*cdf0e10cSrcweirSub SetControlModelText( ModelText As String) 46*cdf0e10cSrcweir oControlModel.Text = ModelText 47*cdf0e10cSrcweirEnd Sub 48*cdf0e10cSrcweir 49*cdf0e10cSrcweirSub InsertItemsLabels( ItemLabelsArray() As String) 50*cdf0e10cSrcweir For i = 0 To Ubound(ItemLabelsArray()) 51*cdf0e10cSrcweir oRoadmapItem = oControlModel.createInstance() 52*cdf0e10cSrcweir oRoadmapItem.Label = ItemLabelsArray(i) 53*cdf0e10cSrcweir oRoadmapItem.ID = i 54*cdf0e10cSrcweir oControlModel.insertbyIndex(i, oRoadmapItem) 55*cdf0e10cSrcweir Next i 56*cdf0e10cSrcweirEnd Sub 57*cdf0e10cSrcweir 58*cdf0e10cSrcweirSub SetItemEnabled( ItemIndex, param) 59*cdf0e10cSrcweir oControlModel.getByIndex(ItemIndex).Enabled = param 60*cdf0e10cSrcweir oControlModel.CurrentItemID = ItemIndex 61*cdf0e10cSrcweirEnd Sub 62*cdf0e10cSrcweir 63*cdf0e10cSrcweirSub AddImagetoControlModel( Url As String) 64*cdf0e10cSrcweir oControlModel.ImageUrl = ConvertToUrl(Url) 65*cdf0e10cSrcweirEnd Sub 66*cdf0e10cSrcweir 67*cdf0e10cSrcweirFunction GetSelectedIndex() 68*cdf0e10cSrcweir GetSelectedIndex() = oControlModel.CurrentItemID 69*cdf0e10cSrcweirEnd Function 70*cdf0e10cSrcweir 71*cdf0e10cSrcweirFunction GetControlModel() 72*cdf0e10cSrcweir GetControlModel = oControlModel 73*cdf0e10cSrcweirEnd Function 74*cdf0e10cSrcweir 75*cdf0e10cSrcweirFunction GetDialogModel() 76*cdf0e10cSrcweir GetDialogModel = oDialogModel 77*cdf0e10cSrcweirEnd Function 78*cdf0e10cSrcweir 79*cdf0e10cSrcweirSub Callback_itemStateChanged(aEvent) 80*cdf0e10cSrcweir oModulName.ItemChange(oControlModel.CurrentItemID, aEvent.itemID) 81*cdf0e10cSrcweirEnd Sub 82*cdf0e10cSrcweir 83*cdf0e10cSrcweirSub SetComplete(param) 84*cdf0e10cSrcweir oControlModel.Complete = param 85*cdf0e10cSrcweirEnd Sub 86*cdf0e10cSrcweir 87*cdf0e10cSrcweirSub SetActivated(param) 88*cdf0e10cSrcweir oControlModel.Activated = param 89*cdf0e10cSrcweirEnd Sub 90*cdf0e10cSrcweir 91*cdf0e10cSrcweirSub RemoveItem(ItemIndex) 92*cdf0e10cSrcweir If ItemIndex > -1 Then 93*cdf0e10cSrcweir oControlModel.removeByIndex(ItemIndex) 94*cdf0e10cSrcweir End If 95*cdf0e10cSrcweirEnd Sub 96*cdf0e10cSrcweir 97*cdf0e10cSrcweirSub InsertItem(ItemLabel As String) 98*cdf0e10cSrcweir oRoadmapItem = oControlModel.createInstance() 99*cdf0e10cSrcweir oRoadmapItem.Label = ItemLabel 100*cdf0e10cSrcweir oControlModel.insertbyIndex(oControlModel.CurrentItemID, oRoadmapItem) 101*cdf0e10cSrcweirEnd Sub 102*cdf0e10cSrcweir 103*cdf0e10cSrcweirSub ReplaceItem(ItemLabel As String) 104*cdf0e10cSrcweir oRoadmapItem = oControlModel.createInstance() 105*cdf0e10cSrcweir oRoadmapItem.Label = ItemLabel 106*cdf0e10cSrcweir oControlModel.replacebyIndex(oControlModel.CurrentItemID, oRoadmapItem) 107*cdf0e10cSrcweirEnd Sub 108*cdf0e10cSrcweir 109*cdf0e10cSrcweirSub Callback_disposing(aEvent) 110*cdf0e10cSrcweirEnd Sub 111*cdf0e10cSrcweir 112*cdf0e10cSrcweirSub Property_propertyChange(aEvent) 113*cdf0e10cSrcweirEnd Sub 114*cdf0e10cSrcweir 115*cdf0e10cSrcweirSub Property_disposing(aEvent) 116*cdf0e10cSrcweirEnd Sub 117*cdf0e10cSrcweir</script:module>