本文整理汇总了PHP中HTML_Progress::addListener方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML_Progress::addListener方法的具体用法?PHP HTML_Progress::addListener怎么用?PHP HTML_Progress::addListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML_Progress
的用法示例。
在下文中一共展示了HTML_Progress::addListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listener
<?php
require_once 'HTML/Progress/monitor.php';
$bar = new HTML_Progress();
$mon = new HTML_Progress_Monitor();
$bar->addListener($mon);
$li = $bar->getListeners();
printf("%d listener(s) <br/>", count($li));
示例2: or
// sleep a bit ...
if ($version > 1.1) {
$obj->sleep();
} else {
for ($i = 0; $i < $obj->_anim_speed * 1000; $i++) {
}
}
}
/*
Which version of html_progress: (stable)1.1 or (beta)1.2.0 RC1, RC2 or RC3
*/
$version = _methodExists('run') ? 1.2 : 1.1;
$progress = new HTML_Progress();
$observer = new logsUpload();
// prepare the progress meter to logs all upload operations
$progress->addListener($observer);
$progress->setIncrement(10);
$progress->setAnimSpeed(100);
$progress->setIndeterminate(true);
// progress bar run in indeterminate mode
$progress->setStringPainted(true);
// get space for the string
$progress->setBorderPainted(true);
$progress->setString("");
// but don't paint it
if ($version > 1.1) {
// set a progress handler required at least version 1.2.0RC3
$progress->setProgressHandler('myFunctionHandler');
}
$ui =& $progress->getUI();
$ui->setBorderAttributes('width=1 style=inset color=white');
示例3: die
}
}
}
// 2. Creates ProgressBar
$bar1 = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
$bar1->setAnimSpeed(50);
$bar1->setIncrement(10);
$bar1->setIdent('PB1');
$bar2 = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
$bar2->setAnimSpeed(50);
$bar2->setIncrement(25);
$bar2->setIdent('PB2');
$bar2->setBorderPainted(true);
// 3. Creates and attach a listener
$observer = new Bar1Observer();
$ok = $bar1->addListener($observer);
if (!$ok) {
die("Cannot add a valid listener to progress bar !");
}
// 4. Changes look-and-feel of ProgressBar
$ui1 =& $bar1->getUI();
$ui1->setComment('Complex Observer ProgressBar example');
$ui1->setTabOffset(1);
$ui1->setProgressAttributes(array('background-color' => '#e0e0e0'));
$ui1->setStringAttributes(array('valign' => 'left', 'color' => 'red', 'background-color' => 'lightblue'));
$ui2 =& $bar2->getUI();
$ui2->setTabOffset(1);
$ui2->setBorderAttributes(array('width' => 1, 'style' => 'solid', 'color' => 'navy'));
$ui2->setCellAttributes(array('active-color' => '#3874B4', 'inactive-color' => '#EEEECC'));
$ui2->setStringAttributes(array('width' => '100', 'align' => 'center', 'valign' => 'right', 'color' => 'yellow', 'background-color' => 'lightblue'));
?>