Sliders/progress bars templates?
Rob Cozens
rcozens at pon.net
Wed Nov 6 10:31:20 EST 2002
>Is there a Revolution (or SC?) library anywhere which contains a collection
>nice-looking pre-fabbed sliders and progress bars?
Hello Mark,
I doubt SC progress bars would work with RunRev; but I have not tried
it. In RunRev a progress bar is a special instance of the horizontal
scrollbar. To create a progress bar select "New Control" & "Progress
Bar" from the development UI.
As for scripting a progress bar, here's a portion of a handler I
posted in August. I've prefixed each statement pertinent to the
progress bar with "}"
if backingUp then
put "binfile:"&(the text of button "Destination Title") into backupFileName
set the label of stack "Backup Progress" to
sdbMessage(sdbBackupInProgressLabel)
put (field "File Index" of card 2 of stack
sdbStackName)&recordDelimiter into backupData
} put the number of cards of stack sdbStackName into lastRecord
} put lastRecord-3 into recordCount
} set the thumbPosition of scrollBar "Progress Scrollbar" to 0
} set the endvalue of scrollBar "Progress Scrollbar" to recordCount
} show scrollBar "Progress Scrollbar"
} put 0 into recordsProcessed
} put round(recordCount/(the width of scrollBar "Progress
Scrollbar")) into progressInterval
} put max(1,progressInterval) into progressInterval
repeat with x=4 to lastRecord
set cursor to busy
put field "Record Type" of card x of stack sdbFileName into theType
put field "Record Key" of card x of stack sdbFileName into theKey
put field "Record" of card x of stack sdbFileName into theRecord
put theType&&theKey&return&theRecord&recordDelimiter after backupData
} add 1 to recordsProcessed
} if (recordsProcessed mod progressInterval)=0 then set the
thumbPosition of scrollBar "Progress Scrollbar" to recordsProcessed
end repeat
} set the thumbPosition of scrollBar "Progress Scrollbar" to
recordCount -- yes, recordCount
else
--
Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.com/who.htm
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode
mailing list