1rem *************************************************************
2rem
3rem  Licensed to the Apache Software Foundation (ASF) under one
4rem  or more contributor license agreements.  See the NOTICE file
5rem  distributed with this work for additional information
6rem  regarding copyright ownership.  The ASF licenses this file
7rem  to you under the Apache License, Version 2.0 (the
8rem  "License"); you may not use this file except in compliance
9rem  with the License.  You may obtain a copy of the License at
10rem
11rem    http://www.apache.org/licenses/LICENSE-2.0
12rem
13rem  Unless required by applicable law or agreed to in writing,
14rem  software distributed under the License is distributed on an
15rem  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16rem  KIND, either express or implied.  See the License for the
17rem  specific language governing permissions and limitations
18rem  under the License.
19rem
20rem *************************************************************
21Sub Main
22
23	rem Get reference to current active frame. Most time this will be
24	rem the basic ide by himself.
25	xTestFrame = StarDesktop.ActiveFrame
26
27	rem Create more then one indicator objects for this frame.
28	xIndicator1 = xTestFrame.createStatusIndicator()
29	xIndicator2 = xTestFrame.createStatusIndicator()
30	xIndicator3 = xTestFrame.createStatusIndicator()
31
32	rem Check status of creation. No null references should be detected.
33	if( isNull(xIndicator1)=TRUE ) or ( isNull(xIndicator2)=TRUE ) or ( isNull(xIndicator3)=TRUE ) then
34		msgbox "Error: Could not create status indicators!"
35		exit Sub
36	endif
37
38	rem Start working for indicator 1 and 2.
39	rem The window should NOT be shown!
40	xIndicator1.start( "Indicator 1:", 100 )
41	xIndicator2.start( "Indicator 2:", 200 )
42	msgbox "Indicator 1 and 2 was started ... the window should NOT be shown!"
43
44	rem Start working for indicator 3.
45	rem The window should be shown! It's the most active one.
46	xIndicator3.start( "Indicator 3:", 300 )
47	msgbox "Indicator 3 was started ... the window should be shown!"
48
49	rem Set different values and texts for indicator 1 and 2.
50	rem These values are not visible.
51	xIndicator1.setValue( 25 )
52	xIndicator2.setValue( 50 )
53
54	rem Work with indicator 3.
55	rem If working finished automaticly indicator 2 is reactivated.
56	i = 0
57	while i<300
58		xIndicator3.setText( "Indicator 3: Range=300 Value=" + i )
59		xIndicator3.setValue( i )
60		i = i+10
61		wait( 1 )
62	wend
63
64	rem Delete indicator 2 before you deactivate number 3!
65	rem The next automaticly activated indicator will be the number 1.
66	xIndicator2.end
67	msgbox "Indicator 3 will be destroyed. Indicator 2 was deleted ... number 1 must reactivated automaticly!"
68	xIndicator3.end
69
70	rem Work with indicator 1.
71	rem If working finished automaticly the window will be destroyed.
72	i = 25
73	while i<100
74		xIndicator1.setText( "Indicator 1: Range=100 Value=" + i )
75		xIndicator1.setValue( i )
76		i = i+10
77		wait( 1 )
78	wend
79	xIndicator1.setText( "Indicator 1: ... reset values to defaults" )
80	wait( 1000 )
81	xIndicator1.reset
82	xIndicator1.setText( "Indicator 1: ... set 50 % for progress" )
83	wait( 1000 )
84	xIndicator1.setValue( 50 )
85	msgbox "Indicator 1 will be destroyed. Indicator window must destroyed automaticly!"
86	xIndicator1.end
87
88	msgbox "Test for status indicator finished successful!"
89End Sub
90