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="Functions" script:language="StarBasic">REM  *****  BASIC  *****
24cdf0e10cSrcweirDim DialogVisible As Boolean
25cdf0e10cSrcweirDim TutorStep As Integer
26cdf0e10cSrcweirDim TutorLastStep As Integer
27cdf0e10cSrcweirDim myDialog As Object
28cdf0e10cSrcweirDim myTutorial As Object
29cdf0e10cSrcweirPublic TutorText() As String
30cdf0e10cSrcweirDim documentTitle As String
31cdf0e10cSrcweirDim exampleUse As Object
32cdf0e10cSrcweirDim properties() As Object
33cdf0e10cSrcweirDim docTYP  As String
34cdf0e10cSrcweir&apos;public myWidth As Long
35cdf0e10cSrcweirDim myHeight As Long
36cdf0e10cSrcweirDim oTextField As Object
37cdf0e10cSrcweirDim stepTitle  As String
38cdf0e10cSrcweirDim oOpenDialogFlag
39cdf0e10cSrcweirDim imageStatus  As String
40cdf0e10cSrcweir
41cdf0e10cSrcweirSub LoadTutorialDialog(exampleToUse, documentTYP)
42cdf0e10cSrcweir	Init()
43cdf0e10cSrcweir	exampleUse = exampleToUse
44cdf0e10cSrcweir	TutorText() = exampleUse.LoadText()
45cdf0e10cSrcweir	properties() = exampleUse.GetProperties()
46cdf0e10cSrcweir	If properties(3).Value = &quot;True&quot; Then
47cdf0e10cSrcweir		Dim localisation(0) As new com.sun.star.beans.NamedValue
48cdf0e10cSrcweir		localisation(0).Name = &quot;Localisation&quot;
49cdf0e10cSrcweir    	localisation(0).Value = properties()
50cdf0e10cSrcweir    	myTutorial.execute(localisation())
51cdf0e10cSrcweir	Else
52cdf0e10cSrcweir		TutorStep = 0
53cdf0e10cSrcweir		TutorLastStep = 0
54cdf0e10cSrcweir		docTYP = documentTYP
55cdf0e10cSrcweir		InitAction()
56cdf0e10cSrcweir		ShowInfoMain()
57cdf0e10cSrcweir		DialogVisible = True
58cdf0e10cSrcweir		myDialog = LoadDialog(&quot;Tutorials&quot;,&quot;TutorialsDialog&quot;)
59cdf0e10cSrcweir
60cdf0e10cSrcweir		SetTutorialDocumentPosSize()
61cdf0e10cSrcweir
62cdf0e10cSrcweir		documentProps =  ThisComponent.getDocumentProperties()
63cdf0e10cSrcweir		myDialog.Title = &quot;Tutorials - &quot; &amp; documentProps.Title
64cdf0e10cSrcweir		oTextField = myDialog.GetControl(&quot;myTextField&quot;)
65cdf0e10cSrcweir		oTextField.setVisible(False)
66cdf0e10cSrcweir
67cdf0e10cSrcweir		imageStatus = &quot;MIN&quot;
68cdf0e10cSrcweir		setMaxMinImage(imageStatus)
69cdf0e10cSrcweir
70cdf0e10cSrcweir		&apos;myWidth = myDialog.Size.Width
71cdf0e10cSrcweir		myHeight = myDialog.Size.Height
72cdf0e10cSrcweir
73cdf0e10cSrcweir		CheckForStepShowButtonStatus()
74cdf0e10cSrcweir		CheckForStepNextButtonStatus()
75cdf0e10cSrcweir		InitRoadMap()
76cdf0e10cSrcweir		SetVisibleTrue()
77cdf0e10cSrcweir		myDialog.model.myTextField.Label = stepTitle
78cdf0e10cSrcweir		myDialog.model.myText.Label = GetStepText()&apos;TutorText(TutorStep)
79cdf0e10cSrcweir
80cdf0e10cSrcweir
81cdf0e10cSrcweir		Do
82cdf0e10cSrcweir			wait 1000
83cdf0e10cSrcweir		Loop Until DialogVisible = False
84cdf0e10cSrcweir		If( oOpenDialogFlag = True) Then
85cdf0e10cSrcweir			Destroy()
86cdf0e10cSrcweir			TutorialOpen.TutorialOpenMain()
87cdf0e10cSrcweir		Else
88cdf0e10cSrcweir			Destroy()
89cdf0e10cSrcweir		End If
90cdf0e10cSrcweir	End If
91cdf0e10cSrcweirEnd Sub
92cdf0e10cSrcweir
93cdf0e10cSrcweirSub setMaxMinImage(param As String)
94cdf0e10cSrcweir	On Local Error Goto NOIMAGE
95cdf0e10cSrcweir		oCommandButton = myDialog.GetControl(&quot;CommandButton&quot;)
96cdf0e10cSrcweir		templatePath = GetPathSettings(&quot;Template&quot;,false, 0)
97cdf0e10cSrcweir		Dim bitmapPath As String
98cdf0e10cSrcweir		iPos = InStr(templatePath,&quot;/&quot;)
99cdf0e10cSrcweir		If(iPos &gt; 0) Then
100cdf0e10cSrcweir			If(param = &quot;MAX&quot;) Then
101cdf0e10cSrcweir				bitmapPath = templatePath &amp; &quot;../wizard/bitmap/maximize.bmp&quot;
102cdf0e10cSrcweir			ElseIf(param = &quot;MIN&quot;) Then
103cdf0e10cSrcweir				bitmapPath = templatePath &amp; &quot;../wizard/bitmap/minimize.bmp&quot;
104cdf0e10cSrcweir			End If
105cdf0e10cSrcweir		Else
106cdf0e10cSrcweir			If(param = &quot;MAX&quot;) Then
107cdf0e10cSrcweir				bitmapPath = templatePath &amp; &quot;..\wizard\bitmap\maximize.bmp&quot;
108cdf0e10cSrcweir			ElseIf(param = &quot;MIN&quot;) Then
109cdf0e10cSrcweir				bitmapPath = templatePath &amp; &quot;..\wizard\bitmap\minimize.bmp&quot;
110cdf0e10cSrcweir			End If
111cdf0e10cSrcweir		End If
112cdf0e10cSrcweir		&apos;printdbgInfo oCommandButton.Model
113cdf0e10cSrcweir		oCommandButton.Model.ImageUrl = bitmapPath
114cdf0e10cSrcweir	Exit Sub
115cdf0e10cSrcweir	NOIMAGE:
116cdf0e10cSrcweirEnd Sub
117cdf0e10cSrcweir
118cdf0e10cSrcweirSub SetTutorialDocumentPosSize()
119cdf0e10cSrcweir	activDesktopWindow = StarDesktop.activeFrame.ContainerWindow
120cdf0e10cSrcweir	If(activDesktopWindow.posSize.Height &lt; 550) Then
121cdf0e10cSrcweir		activDesktopWindow.setPosSize(0,0,0,550,8)
122cdf0e10cSrcweir	End If
123cdf0e10cSrcweir	If	(activDesktopWindow.posSize.Width &lt; 750 ) Then
124cdf0e10cSrcweir		activDesktopWindow.setPosSize(0,0,750,0,4)
125cdf0e10cSrcweir	EndIf
126cdf0e10cSrcweirEnd Sub
127cdf0e10cSrcweir
128cdf0e10cSrcweirSub InitRoadMap()
129cdf0e10cSrcweir	RoadMapMain(Functions, myDialog)
130cdf0e10cSrcweir	SetControlModelPosSize(0, 0, 85, 176)
131cdf0e10cSrcweir	SetControlModelText(&quot;Steps&quot;)
132cdf0e10cSrcweir
133cdf0e10cSrcweir	StepSize = Ubound(TutorText())
134cdf0e10cSrcweir	Dim ItemsArray(StepSize) as String
135cdf0e10cSrcweir	For i = 0 To StepSize
136cdf0e10cSrcweir		stepcontent = TutorText(i)
137cdf0e10cSrcweir		iPos = InStr(stepcontent,CHR(13))
138cdf0e10cSrcweir		ItemName = Left(stepcontent, iPos)
139cdf0e10cSrcweir		ItemsArray(i) = ItemName
140cdf0e10cSrcweir	Next i
141cdf0e10cSrcweir	InsertItemsLabels( ItemsArray())
142cdf0e10cSrcweir
143cdf0e10cSrcweir	For i = 1 To StepSize
144cdf0e10cSrcweir		SetItemEnabled( i, False)
145cdf0e10cSrcweir	Next i
146cdf0e10cSrcweir	SetItemEnabled( 0, True)
147cdf0e10cSrcweirEnd Sub
148cdf0e10cSrcweir
149cdf0e10cSrcweirSub Destroy()
150cdf0e10cSrcweir	&apos;myDialog.dispose
151cdf0e10cSrcweir	wait 1000
152cdf0e10cSrcweir    ShowInfoDialog.DisposeIDialog()
153cdf0e10cSrcweir
154cdf0e10cSrcweir    &apos; HIER WIRD DAS DOCUMENT GESCHLOSSEN!!!!!!!! GPF
155cdf0e10cSrcweir    thisComponent.CurrentController.Frame.close(True)
156cdf0e10cSrcweir
157cdf0e10cSrcweirEnd Sub
158cdf0e10cSrcweir
159cdf0e10cSrcweirSub Init
160cdf0e10cSrcweir	GlobalScope.BasicLibraries.LoadLibrary(&quot;Tools&quot;)
161cdf0e10cSrcweir	myTutorial = createUNOService(&quot;com.sun.star.wizards.tutorial.executer.CallTutorialFramework&quot;)
162cdf0e10cSrcweir	documentTitle = ThisComponent.getCurrentController.getFrame.Title
163cdf0e10cSrcweirEnd Sub
164cdf0e10cSrcweir
165cdf0e10cSrcweirSub InitStep
166cdf0e10cSrcweir    udProps = ThisComponent.DocumentProperties.UserDefinedProperties
167cdf0e10cSrcweir    If udProps.PropertySetInfo.hasPropertyByName(&quot;CurrentStep&quot;) Then
168cdf0e10cSrcweir        TutorStep = udProps.CurrentStep
169cdf0e10cSrcweir    Else
170cdf0e10cSrcweir        udProps.addProperty(&quot;CurrentStep&quot;, 0, TutorStep)
171cdf0e10cSrcweir    End If
172cdf0e10cSrcweirEnd Sub
173cdf0e10cSrcweir
174cdf0e10cSrcweirSub setStep
175cdf0e10cSrcweir    ThisComponent.DocumentProperties.UserDefinedProperties.CurrentStep = TutorStep
176cdf0e10cSrcweirEnd Sub
177cdf0e10cSrcweir
178cdf0e10cSrcweirSub InitAction()
179cdf0e10cSrcweir	SetStepTitle()
180cdf0e10cSrcweir
181cdf0e10cSrcweir	Dim property(6) As new com.sun.star.beans.PropertyValue
182cdf0e10cSrcweir	property(0).Name = &quot;DocumentTYP&quot;
183cdf0e10cSrcweir	property(0).Value = docTYP
184cdf0e10cSrcweir	property(1).Name = &quot;MethodName&quot;
185cdf0e10cSrcweir	property(1).Value = &quot;setDelay&quot;
186cdf0e10cSrcweir	property(2).Name = &quot;Param&quot;
187cdf0e10cSrcweir	property(2).Value = 0	 &apos;key insert speed (Millis)
188cdf0e10cSrcweir	property(3).Name = &quot;Param&quot;
189cdf0e10cSrcweir	property(3).Value = 4	 &apos;mouse animate speed (Millis)
190cdf0e10cSrcweir	property(4).Name = &quot;Param&quot;
191cdf0e10cSrcweir	property(4).Value = 2000 &apos;after mouse animate sleep (Millis)
192cdf0e10cSrcweir	property(5).Name = &quot;Param&quot;
193cdf0e10cSrcweir	property(5).Value = 10	 &apos;mouse scroll speed (Millis)
194cdf0e10cSrcweir	property(6).Name = &quot;Param&quot;
195cdf0e10cSrcweir	property(6).Value = -1	 &apos;mouse speed (step)
196cdf0e10cSrcweir	myTutorial.setPropertyValues(property())
197cdf0e10cSrcweirEnd Sub
198cdf0e10cSrcweir
199cdf0e10cSrcweirSub EndDialog
200cdf0e10cSrcweir	oOpenDialogFlag = False
201cdf0e10cSrcweir	If (myDialog.model.done.Label = &quot;Close&quot;) Then
202cdf0e10cSrcweir		TutorialCloseMain()
203cdf0e10cSrcweir	Else
204cdf0e10cSrcweir		DialogVisible = False
205cdf0e10cSrcweir	End If
206cdf0e10cSrcweirEnd Sub
207cdf0e10cSrcweir
208cdf0e10cSrcweirSub NextStep
209cdf0e10cSrcweir	GotoStep(TutorStep + 1)
210cdf0e10cSrcweirEnd Sub
211cdf0e10cSrcweir
212cdf0e10cSrcweirSub GotoStep(StepIndex)
213cdf0e10cSrcweir	If(StepIndex &lt;= Ubound(TutorText())) Then
214cdf0e10cSrcweir		TutorStep = StepIndex
215cdf0e10cSrcweir		If TutorStep &gt; TutorLastStep Then
216cdf0e10cSrcweir			TutorLastStep = TutorStep
217cdf0e10cSrcweir		End If
218cdf0e10cSrcweir		If(TutorStep = Ubound(TutorText())) Then
219cdf0e10cSrcweir			myDialog.model.next.enabled = False
220cdf0e10cSrcweir			myDialog.model.done.Label = &quot;Done&quot;
221cdf0e10cSrcweir			myDialog.model.show.Label = &quot;Tutorials&quot;
222cdf0e10cSrcweir		Else
223cdf0e10cSrcweir			myDialog.model.next.enabled = True
224cdf0e10cSrcweir		End If
225cdf0e10cSrcweir		SetStepTitle()
226cdf0e10cSrcweir		myDialog.model.myText.Label = GetStepText()
227cdf0e10cSrcweir		CheckForStepShowButtonStatus()
228cdf0e10cSrcweir		SetItemEnabled( TutorStep, True)
229cdf0e10cSrcweir		&apos;setStep()
230cdf0e10cSrcweir	End If
231cdf0e10cSrcweirEnd Sub
232cdf0e10cSrcweir
233cdf0e10cSrcweirFunction GetStepText()
234cdf0e10cSrcweir	Dim tempText As String
235cdf0e10cSrcweir	tempText = TutorText(TutorStep)
236cdf0e10cSrcweir	iPos = InStr(tempText,CHR(13))
237cdf0e10cSrcweir	ResultString = Right(tempText, Len(tempText) - iPos - 1)
238cdf0e10cSrcweir	GetStepText() = ResultString
239cdf0e10cSrcweirEnd Function
240cdf0e10cSrcweir
241cdf0e10cSrcweirSub ItemChange(CurrentItemID, SelectitemID)
242cdf0e10cSrcweir	GotoStep(SelectitemID)
243cdf0e10cSrcweirEnd Sub
244cdf0e10cSrcweir
245cdf0e10cSrcweirSub SetDisableShowMeButton()
246cdf0e10cSrcweir	myDialog.model.show.enabled = False
247cdf0e10cSrcweir	TutorLastStep = TutorLastStep + 1
248cdf0e10cSrcweirEnd Sub
249cdf0e10cSrcweir
250cdf0e10cSrcweirSub Minimize(aEvent)
251cdf0e10cSrcweir	ActionItemsTextField = myDialog.GetControl(&quot;ActionItemsLabel&quot;)
252cdf0e10cSrcweir	FixedLineVertikal = myDialog.GetControl(&quot;FixedLineVertikal&quot;)
253cdf0e10cSrcweir
254cdf0e10cSrcweir	If myDialog.Size.Height = 35 Then
255cdf0e10cSrcweir		myDialog.setPosSize(0,0,0,myHeight,8)
256cdf0e10cSrcweir		oTextField.setVisible(False)
257cdf0e10cSrcweir		ActionItemsTextField.setVisible(True)
258cdf0e10cSrcweir		FixedLineVertikal.setVisible(True)
259cdf0e10cSrcweir		RoadMap.SetVisibleRoadMap(True)
260cdf0e10cSrcweir	Else
261cdf0e10cSrcweir		myDialog.setPosSize(0,0,0,35,8)
262cdf0e10cSrcweir		rmSelectedIndex = RoadMap.GetSelectedIndex() + 1
263cdf0e10cSrcweir		gsTitle = GetStepTitle()
264cdf0e10cSrcweir		oTextField.setText(rmSelectedIndex &amp; &quot;. &quot; &amp; gsTitle)
265cdf0e10cSrcweir		oTextField.setVisible(True)
266cdf0e10cSrcweir		ActionItemsTextField.setVisible(False)
267cdf0e10cSrcweir		FixedLineVertikal.setVisible(False)
268cdf0e10cSrcweir		RoadMap.SetVisibleRoadMap(False)
269cdf0e10cSrcweir	End If
270cdf0e10cSrcweir	If(imageStatus = &quot;MAX&quot;) Then
271cdf0e10cSrcweir		imageStatus = &quot;MIN&quot;
272cdf0e10cSrcweir	ElseIf(imageStatus = &quot;MIN&quot;) Then
273cdf0e10cSrcweir		imageStatus = &quot;MAX&quot;
274cdf0e10cSrcweir	End If
275cdf0e10cSrcweir	setMaxMinImage(imageStatus)
276cdf0e10cSrcweir
277cdf0e10cSrcweirEnd Sub
278cdf0e10cSrcweir
279cdf0e10cSrcweirSub SetStepTitle()
280cdf0e10cSrcweir	stepcontent = TutorText(TutorStep)
281cdf0e10cSrcweir	iPos = InStr(stepcontent,CHR(13))
282cdf0e10cSrcweir	stepTitle = Left(stepcontent, iPos)
283cdf0e10cSrcweir	SetStepTitle() = stepTitle
284cdf0e10cSrcweirEnd Sub
285cdf0e10cSrcweir
286cdf0e10cSrcweirFunction GetStepTitle()
287cdf0e10cSrcweir	GetStepTitle() = stepTitle
288cdf0e10cSrcweirEnd Function
289cdf0e10cSrcweir
290cdf0e10cSrcweirSub CheckForStepShowButtonStatus()
291cdf0e10cSrcweir	If ((exampleUse.ContainsStepAction() = True And TutorStep = TutorLastStep) Or myDialog.model.show.Label = &quot;Tutorials&quot;) Then
292cdf0e10cSrcweir		myDialog.model.show.enabled = True
293cdf0e10cSrcweir	Else
294cdf0e10cSrcweir		myDialog.model.show.enabled = False
295cdf0e10cSrcweir	End If
296cdf0e10cSrcweirEnd Sub
297cdf0e10cSrcweir
298cdf0e10cSrcweirSub CheckForStepNextButtonStatus()
299cdf0e10cSrcweir	If(TutorStep = Ubound(TutorText())) Then
300cdf0e10cSrcweir		myDialog.model.next.enabled = False
301cdf0e10cSrcweir		myDialog.model.done.Label = &quot;Done&quot;
302cdf0e10cSrcweir	End If
303cdf0e10cSrcweirEnd Sub
304cdf0e10cSrcweir
305cdf0e10cSrcweirSub Show(aEvent)
306cdf0e10cSrcweir	&apos;ShowInfoMain()
307cdf0e10cSrcweir	If( myDialog.model.show.Label = &quot;Tutorials&quot;) Then
308cdf0e10cSrcweir		oOpenDialogFlag = True
309cdf0e10cSrcweir		DialogVisible = False
310cdf0e10cSrcweir	Else
311cdf0e10cSrcweir		SetMousePosition(aEvent)
312cdf0e10cSrcweir		exampleUse.Action()
313cdf0e10cSrcweir	End If
314cdf0e10cSrcweirEnd Sub
315cdf0e10cSrcweir
316cdf0e10cSrcweirSub SetMousePosition(aEvent)
317cdf0e10cSrcweir	MyPoints() = MousePoints(aEvent)
318cdf0e10cSrcweir
319cdf0e10cSrcweir	Dim mousePosition(3) as new com.sun.star.beans.PropertyValue
320cdf0e10cSrcweir	mousePosition(0).Name = &quot;DocumentTYP&quot;
321cdf0e10cSrcweir	mousePosition(0).Value = docTYP
322cdf0e10cSrcweir	mousePosition(1).Name = &quot;MethodName&quot;
323cdf0e10cSrcweir	mousePosition(1).Value = &quot;setMousePosition&quot;
324cdf0e10cSrcweir   	mousePosition(2).Name = &quot;Param&quot;
325cdf0e10cSrcweir   	mousePosition(2).Value = MyPoints(0)
326cdf0e10cSrcweir	mousePosition(3).Name = &quot;Param&quot;
327cdf0e10cSrcweir	mousePosition(3).Value = MyPoints(1)
328cdf0e10cSrcweir
329cdf0e10cSrcweir	myTutorial.setPropertyValues(mousePosition())
330cdf0e10cSrcweirEnd Sub
331cdf0e10cSrcweir
332cdf0e10cSrcweirFunction MousePoints(aEvent)
333cdf0e10cSrcweir	Dim position(1) As Integer
334cdf0e10cSrcweir	position(0) = myDialog.getControl(&quot;show&quot;).AccessibleContext.LocationOnScreen.X + aEvent.Source.Model.PositionX
335cdf0e10cSrcweir	position(1) = myDialog.getControl(&quot;show&quot;).AccessibleContext.LocationOnScreen.Y + aEvent.Source.Model.PositionY
336cdf0e10cSrcweir	MousePoints = position()
337cdf0e10cSrcweirEnd Function
338cdf0e10cSrcweir
339cdf0e10cSrcweirFunction CheckPath(path() As String)
340cdf0e10cSrcweir	&apos;documentTitle = ThisComponent.getCurrentController.getFrame.Title
341cdf0e10cSrcweir	sTitle =  path(0)
342cdf0e10cSrcweir	ResultString = Right(sTitle, 3)
343cdf0e10cSrcweir	iPos = InStr(ResultString,&quot;#&quot;)
344cdf0e10cSrcweir	ResultString = Right(ResultString, Len(ResultString) - iPos)
345cdf0e10cSrcweir	ResultFrameString = InStr (sTitle, &quot;{D}FRAME#&quot;)
346cdf0e10cSrcweir	If ResultFrameString &lt;&gt; 0 Then
347cdf0e10cSrcweir		If Not (sTitle = (&quot;{D}FRAME#&quot; &amp; documentTitle &amp; &quot;#&quot; &amp; ResultString)) Then
348cdf0e10cSrcweir			&apos;path(0) = &quot;{D}FRAME#&quot; &amp; documentTitle &amp; &quot;#&quot; &amp; ResultString
349cdf0e10cSrcweir			path(0) = &quot;FRAME#&quot; &amp; documentTitle &amp; &quot;#&quot; &amp; ResultString
350cdf0e10cSrcweir			sTitle =  path(1)
351cdf0e10cSrcweir			ResultString = Right(sTitle, 3)
352cdf0e10cSrcweir			iPos = InStr(ResultString,&quot;#&quot;)
353cdf0e10cSrcweir			ResultString = Right(ResultString, Len(ResultString) - iPos)
354cdf0e10cSrcweir			path(1) = &quot;ROOT_PANE#&quot; &amp; documentTitle &amp; &quot;#&quot; &amp; ResultString
355cdf0e10cSrcweir		Else
356cdf0e10cSrcweir			&apos;path(0) = &quot;{D}FRAME#&quot; &amp; documentTitle &amp; &quot;#&quot; &amp; ResultString
357cdf0e10cSrcweir			path(0) = &quot;FRAME#&quot; &amp; documentTitle &amp; &quot;#&quot; &amp; ResultString
358cdf0e10cSrcweir		End If
359cdf0e10cSrcweir	End If
360cdf0e10cSrcweirEnd Function
361cdf0e10cSrcweir
362cdf0e10cSrcweirSub SetVisibleTutorialsDialog(param)
363cdf0e10cSrcweir	myDialog.setVisible(param)
364cdf0e10cSrcweirEnd Sub
365cdf0e10cSrcweir
366cdf0e10cSrcweirSub SetVisibleTrue()
367cdf0e10cSrcweir	myDialog.setVisible(True)
368cdf0e10cSrcweirEnd Sub
369cdf0e10cSrcweir
370cdf0e10cSrcweirSub SetVisibleFalse()
371cdf0e10cSrcweir	myDialog.setVisible(False)
372cdf0e10cSrcweirEnd Sub
373cdf0e10cSrcweir
374cdf0e10cSrcweirSub ExitTutorial()
375cdf0e10cSrcweir	Dim aUrl As new com.sun.star.util.URL
376cdf0e10cSrcweir	oDoc = ThisComponent
377cdf0e10cSrcweir    urlTransformer = createUNOService(&quot;com.sun.star.util.URLTransformer&quot;)
378cdf0e10cSrcweir    aUrl.Complete = &quot;slot:5621&quot;
379cdf0e10cSrcweir    urlTransformer.parseStrict(aUrl)
380cdf0e10cSrcweir    xController = oDoc.getCurrentController()
381cdf0e10cSrcweir    xDispatcher = xController.queryDispatch(aUrl, &quot;&quot;, 0)
382cdf0e10cSrcweir    if NOT isNull(xDispatcher) then
383cdf0e10cSrcweir        xDispatcher.dispatch(aUrl, DimArray())
384cdf0e10cSrcweir     else
385cdf0e10cSrcweir       msgBox &quot;Error! Cannot close document.&quot;
386cdf0e10cSrcweir     End If
387cdf0e10cSrcweirEnd Sub
388cdf0e10cSrcweir</script:module>
389