當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTML_Progress::addListener方法代碼示例

本文整理匯總了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));
開發者ID:Esleelkartea,項目名稱:kz-adeada-talleres-electricos-,代碼行數:8,代碼來源:getlisteners.php

示例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');
開發者ID:GeekyNinja,項目名稱:LifesavingCAD,代碼行數:31,代碼來源:hbar.php

示例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'));
?>
開發者ID:GeekyNinja,項目名稱:LifesavingCAD,代碼行數:31,代碼來源:complex.php


注:本文中的HTML_Progress::addListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。