part2-indeterminate.pkg
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PKG 代码 · 共 89 行
PKG
89 行
<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 basic-indeterminate}">
<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 monitor-indeterminate}">
<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>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?