[futurebasic] [FB3]progressBar

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2000 : Group Archive : Group : All Groups

From: SVANVOORST@...
Date: Tue, 11 Apr 2000 01:37:47 EDT
For those interested, the following demo shows how to use btnType 81 to 
create a progress bar.  Works with OS 9 and FB^3 using FBII runtime.

/* Creates progress bar using btnType 81.   
   Works with OS 9.  Use FBII runtime.   
   Written by S. Van Voorst */

_min = 0
_max = 100
_delayFactor = 100

local
dim btnValue&
LOCAL FN setBtn(id,min,max)
  btnValue& = BUTTON&(id)
  LONG IF btnValue& <> 0
    CALL SETCTLMIN(btnValue&, min) 
    CALL SETCTLMAX(btnValue&, max)   
END IF
END FN

local
dim x
local fn doSomeTask
for x = 1 to _max
button(1),x+1
delay _delayFactor
EDIT$(1)= STR$(x)+" %"           
next 
end fn

LOCAL FN buildWnd
WINDOW#1,"progressBar.demo",(0,0)-(350,130),_docNoGrow
TEXT _sysFont,12
print%(20,30)  "btnType = 81"  
EDIT FIELD#1,,(255,58)-(305,73),_statFramed,_centerJust
BUTTON#1,_activeBtn,,(65,60)-(245,76),81'Progress bar
FN setBtn(1,_min,_max)'Set min,max. 
cursor = _watchCursor
fn doSomeTask
cursor = _arrowCursor
END FN

LOCAL FN doDialog
dim evnt%
dim id% 
evnt% = DIALOG(0)
id%   = DIALOG(evnt%)
SELECT CASE evnt
  CASE _wndClose
   END
END SELECT
END FN

FN buildWnd
ON DIALOG FN doDialog
DO
  HANDLEEVENTS
UNTIL 0
'=======================

Steve Van Voorst