Source for file windowstyle2.php
Documentation is available at windowstyle2.php
Demonstration of the windowstyle feature of Progress2_Lite
version of Progress2 without any dependencies
@version $Id: windowstyle2.php,v 1.1 2005/06/12 21:05:18 farell Exp $
@author Laurent Laville <pear@laurent-laville.org>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<title>Progress2 Lite - Window Style</title>
<h1>Positioning schemes </h1>
<p style="background-color:lightblue;width:320px;height:240px;text-align:center;">
require_once 'HTML/Progress2_Lite.php';
* NOTE: The function {@link http://www.php.net/manual/en/function.usleep.php}
* did not work on Windows systems until PHP 5.0.0
if ((substr(PHP_OS , 0 , 3 ) == 'WIN') && (substr(PHP_VERSION ,0 ,1 ) < '5') ){
for ($i=0; $i< $usecs; $i++ ) { }
// Creates new progress bar with defaults (300 pixels width and 25 pixels height)
$pbl->setFrameAttributes (array ('left' => 50 , 'top' => 180 ));
$pbl->setBarAttributes (array ('border-color' => '#404040 #dfdfdf #dfdfdf #404040'));
// Adds additional text as label 'txt1'
$pbl->addLabel ('text','txt1','Please wait ...');
// Adds percent info as label 'pct1'
$pbl->addLabel ('percent','pct1');
// Adds restart button as label 'btn1' with action 'restart=1'
$pbl->addButton ('btn1','Restart',$_SERVER['PHP_SELF']. '?restart=1');
// Adds stop button as label 'btn2' with action 'stop=1'
$pbl->addButton ('btn2','Stop',$_SERVER['PHP_SELF']. '?stop=1');
// and make it right aligned with restart button (shift left 80 pixels)
$pbl->setLabelAttributes ('btn2', array ('left' => 80 ));
// Show the progress bar frame
if (isset ($_GET['stop'])) {
$messageEnd = 'Canceled';
for($i=1; $i<=100; $i++ ) {
$pbl->setLabelAttributes ('txt1',
array ('value' => 'Loading Demo')
$pbl->setLabelAttributes ('txt1',
array ('value' => 'Scanning ...')
$pbl->setLabelAttributes ('txt1',
array ('value' => 'Send Mail: '. $i. '/130')
$pbl->setLabelAttributes ('txt1',
array ('value' => 'anything else ...')
$messageEnd = 'Completed';
// Finishs operation with final label 'txt1' text value
$pbl->setLabelAttributes ('txt1', array ('value' => $messageEnd));
Documentation generated on Mon, 11 Mar 2019 14:16:23 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|