cvs: pear /HTML_Progress/tutorials/HTML_Progress part2-indeterminate.pkg
| From: | Laurent Laville | Date: | Sat, 11 Sep 2004 23:37:59 +0000 |
| Subject: | cvs: pear /HTML_Progress/tutorials/HTML_Progress part2-indeterminate.pkg | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-23843@lists.php.net to get a copy of this message | ||
farell Sat Sep 11 19:37:59 2004 EDT
Added files:
/pear/HTML_Progress/tutorials/HTML_Progress part2-indeterminate.pkg
Log:
adds the indeterminate mode explains
http://cvs.php.net/co.php/pear/HTML_Progress/tutorials/HTML_Progress/part2-indeterminate.pkg?r=1.1&p=1
Index: pear/HTML_Progress/tutorials/HTML_Progress/part2-indeterminate.pkg
+++ pear/HTML_Progress/tutorials/HTML_Progress/part2-indeterminate.pkg
<refentry id="{@id}">
<refnamediv>
<refname>Using Indeterminate Mode</refname>
<refpurpose>how to animate a progress bar to show unknown length-task
activity</refpurpose>
</refnamediv>
{@toc}
<refsect1 id="{@id intro}">
<title>Introduction</title>
<para>
<simpara>
Sometimes you can't immediately determine the length of a long-running task,
or the task might stay stuck at the same state of completion for a long time.
You can show work without measurable progress by putting the progress bar in
indeterminate mode. A progress bar in indeterminate mode displays animation
to indicate that work is occurring. As soon as the progress bar can display
more meaningful information, you should switch it back into its default,
determinate mode.
</simpara>
</para>
</refsect1>
<refsect1 id="{@id useit}">
<title>Using Indeterminate Mode without Progress Monitor</title>
<para>
<figure>
<graphic fileref="../media/screenshots/indeterminate_basic.png"></graphic>
</figure>
</para>
<example>
{@example indeterminate.php}
</example>
<para>
Lets review this example step by step :
</para>
<simpara>
First, there is the user callback defined on <emphasis>lines 4 to 34</emphasis>,
and attached to the progress meter at <emphasis>line 42</emphasis>
with {@tutorial progress.setprogresshandler.pkg} method.
</simpara>
<simpara>
Percent text information is hidden with value "" given to {@tutorial
progress.setstring.pkg}
method (<emphasis>line 40</emphasis>).
And the determinate mode is activated on <emphasis>line 41</emphasis>.
</simpara>
<para>
Lets have a look deeper into user-callback.
</para>
<simpara>
This example simulate a wait-process result for 12 seconds (<emphasis>lines 18 and
27</emphasis>).
Each new second, we display the elapse time (<emphasis>lines 20 to 23</emphasis>).
When process
will reach 12 seconds (line 27), we will switch back to determinate mode (<emphasis>line
28</emphasis>).
The percent text information will be display again (<emphasis>line 30</emphasis>)
and we will start a new standard cycle, from 0 to 100 percent (<emphasis>lines 29 and
31</emphasis>).
</simpara>
</refsect1>
<refsect1 id="{@id useit}">
<title>Using Indeterminate Mode with Progress Monitor</title>
<para>
<figure>
<graphic fileref="../media/screenshots/indeterminate.png"></graphic>
</figure>
<para>
<note>
In example that follow, we will use a progress bar with help of monitoring functions v2,
so you should have HTML_Progress 1.1 or greater installed.
</note>
</para>
<simpara>
Usage of indeterminate mode of progress meter with
<classname>HTML_Progress_Monitor</classname>
class is almost the same as in basic example above.
</simpara>
</para>
<example>
{@example monitor_indeterminate.php}
</example>
<para>
Differences with basic concept resides into <emphasis>QF renders</emphasis> defined
on lines
89 to 102, and attached to the monitor at line 103.
And also the progress meter is linked to the monitor on line 59.
</para>
</refsect1>
</refentry>