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