1*cdf0e10cSrcweirSub Main
2*cdf0e10cSrcweir
3*cdf0e10cSrcweir	rem Get reference to current active frame. Most time this will be
4*cdf0e10cSrcweir	rem the basic ide by himself.
5*cdf0e10cSrcweir	xTestFrame = StarDesktop.ActiveFrame
6*cdf0e10cSrcweir
7*cdf0e10cSrcweir	rem Create more then one indicator objects for this frame.
8*cdf0e10cSrcweir	xIndicator1 = xTestFrame.createStatusIndicator()
9*cdf0e10cSrcweir	xIndicator2 = xTestFrame.createStatusIndicator()
10*cdf0e10cSrcweir	xIndicator3 = xTestFrame.createStatusIndicator()
11*cdf0e10cSrcweir
12*cdf0e10cSrcweir	rem Check status of creation. No null references should be detected.
13*cdf0e10cSrcweir	if( isNull(xIndicator1)=TRUE ) or ( isNull(xIndicator2)=TRUE ) or ( isNull(xIndicator3)=TRUE ) then
14*cdf0e10cSrcweir		msgbox "Error: Could not create status indicators!"
15*cdf0e10cSrcweir		exit Sub
16*cdf0e10cSrcweir	endif
17*cdf0e10cSrcweir
18*cdf0e10cSrcweir	rem Start working for indicator 1 and 2.
19*cdf0e10cSrcweir	rem The window should NOT be shown!
20*cdf0e10cSrcweir	xIndicator1.start( "Indicator 1:", 100 )
21*cdf0e10cSrcweir	xIndicator2.start( "Indicator 2:", 200 )
22*cdf0e10cSrcweir	msgbox "Indicator 1 and 2 was started ... the window should NOT be shown!"
23*cdf0e10cSrcweir
24*cdf0e10cSrcweir	rem Start working for indicator 3.
25*cdf0e10cSrcweir	rem The window should be shown! It's the most active one.
26*cdf0e10cSrcweir	xIndicator3.start( "Indicator 3:", 300 )
27*cdf0e10cSrcweir	msgbox "Indicator 3 was started ... the window should be shown!"
28*cdf0e10cSrcweir
29*cdf0e10cSrcweir	rem Set different values and texts for indicator 1 and 2.
30*cdf0e10cSrcweir	rem These values are not visible.
31*cdf0e10cSrcweir	xIndicator1.setValue( 25 )
32*cdf0e10cSrcweir	xIndicator2.setValue( 50 )
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir	rem Work with indicator 3.
35*cdf0e10cSrcweir	rem If working finished automaticly indicator 2 is reactivated.
36*cdf0e10cSrcweir	i = 0
37*cdf0e10cSrcweir	while i<300
38*cdf0e10cSrcweir		xIndicator3.setText( "Indicator 3: Range=300 Value=" + i )
39*cdf0e10cSrcweir		xIndicator3.setValue( i )
40*cdf0e10cSrcweir		i = i+10
41*cdf0e10cSrcweir		wait( 1 )
42*cdf0e10cSrcweir	wend
43*cdf0e10cSrcweir
44*cdf0e10cSrcweir	rem Delete indicator 2 before you deactivate number 3!
45*cdf0e10cSrcweir	rem The next automaticly activated indicator will be the number 1.
46*cdf0e10cSrcweir	xIndicator2.end
47*cdf0e10cSrcweir	msgbox "Indicator 3 will be destroyed. Indicator 2 was deleted ... number 1 must reactivated automaticly!"
48*cdf0e10cSrcweir	xIndicator3.end
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir	rem Work with indicator 1.
51*cdf0e10cSrcweir	rem If working finished automaticly the window will be destroyed.
52*cdf0e10cSrcweir	i = 25
53*cdf0e10cSrcweir	while i<100
54*cdf0e10cSrcweir		xIndicator1.setText( "Indicator 1: Range=100 Value=" + i )
55*cdf0e10cSrcweir		xIndicator1.setValue( i )
56*cdf0e10cSrcweir		i = i+10
57*cdf0e10cSrcweir		wait( 1 )
58*cdf0e10cSrcweir	wend
59*cdf0e10cSrcweir	xIndicator1.setText( "Indicator 1: ... reset values to defaults" )
60*cdf0e10cSrcweir	wait( 1000 )
61*cdf0e10cSrcweir	xIndicator1.reset
62*cdf0e10cSrcweir	xIndicator1.setText( "Indicator 1: ... set 50 % for progress" )
63*cdf0e10cSrcweir	wait( 1000 )
64*cdf0e10cSrcweir	xIndicator1.setValue( 50 )
65*cdf0e10cSrcweir	msgbox "Indicator 1 will be destroyed. Indicator window must destroyed automaticly!"
66*cdf0e10cSrcweir	xIndicator1.end
67*cdf0e10cSrcweir
68*cdf0e10cSrcweir	msgbox "Test for status indicator finished successful!"
69*cdf0e10cSrcweirEnd Sub
70