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