ui.setcellattributes.pkg
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PKG 代码 · 共 216 行
PKG
216 行
<?xml version="1.0" encoding="iso-8859-1" ?>
<!-- $Revision: 1.4 $ -->
<refentry id="{@id}">
<refnamediv>
<refname><function>HTML_Progress_UI::setCellAttributes</function></refname>
<refpurpose>sets the look and feel of each progress bar cell</refpurpose>
</refnamediv>
<refsect1 id="{@id synopsis}">
<title>Synopsis</title>
<refsynopsisdiv>
<refsynopsisdivinfo>
<funcsynopsis>
<funcsynopsisinfo>
require_once 'HTML/Progress/UI.php';
</funcsynopsisinfo>
<funcprototype>
<funcdef>void <function>HTML_Progress_UI::setCellAttributes</function></funcdef>
<paramdef>mixed <parameter>$attributes</parameter></paramdef>
<paramdef>int <parameter><optional>$cells = NULL</optional></parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdivinfo>
</refsynopsisdiv>
</refsect1>
<refsect1 id="{@id description}">
<title>Description</title>
<para>
This method is used to give a look and feel, such as spacing, size and color,
to the progress meter cells.
</para>
<para>
<emphasis>$attributes</emphasis> is an associative array or string of HTML tag attributes.
</para>
<para>
<emphasis>$cell</emphasis> is an integer that allows to identify each cell, and properties
to apply.
</para>
</refsect1>
<refsect1 id="{@id parameter}">
<title>Parameter</title>
<para>
<variablelist>
<varlistentry>
<term>
<type>mixed</type>
<parameter>$attributes</parameter>
</term>
<listitem>
<para>
the new cell attributes of the progress meter.
</para>
<para>
<table frame="all">
<title>Key-values allowed are:</title>
<tgroup cols="3">
<thead align="center">
<row>
<entry><emphasis>Attribute</emphasis></entry>
<entry><emphasis>Format</emphasis></entry>
<entry><emphasis>Default value</emphasis></entry>
</row>
</thead>
<tbody>
<row>
<entry>id </entry>
<entry>string </entry>
<entry>progressCell%01s </entry>
</row>
<row>
<entry>class </entry>
<entry>string </entry>
<entry>cell </entry>
</row>
<row>
<entry>spacing </entry>
<entry>integer </entry>
<entry>2 </entry>
</row>
<row>
<entry>active-color </entry>
<entry>string </entry>
<entry>#006600 </entry>
</row>
<row>
<entry>inactive-color </entry>
<entry>string </entry>
<entry>#CCCCCC </entry>
</row>
<row>
<entry>font-family </entry>
<entry>string </entry>
<entry>Courier, Verdana </entry>
</row>
<row>
<entry>font-size </entry>
<entry>integer </entry>
<entry>(compute) </entry>
</row>
<row>
<entry>color </entry>
<entry>string </entry>
<entry>#000000 </entry>
</row>
<row>
<entry>width </entry>
<entry>integer </entry>
<entry>HB=15, VB=20 (HB:Horizontal Bar, VB:Vertical Bar)</entry>
</row>
<row>
<entry>height </entry>
<entry>integer </entry>
<entry>HB=20, VB=15 (HB:Horizontal Bar, VB:Vertical Bar)</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<type>integer</type>
<parameter>$cell</parameter>
</term>
<listitem>
<para>
the cell index if not nul. Otherwise, attributes will be apply for each cell.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 id="{@id throws}">
<title>Throws</title>
<para>
<table frame="all">
<title>Possible PEAR_Error values</title>
<tgroup cols="4">
<thead>
<row>
<entry>Error level</entry>
<entry>Error code</entry>
<entry>Error message</entry>
<entry>Solution</entry>
</row>
</thead>
<tbody>
<row>
<entry>exception</entry>
<entry><constant>HTML_PROGRESS_ERROR_INVALID_INPUT</constant></entry>
<entry>invalid input, parameter #2 "<parameter>$cells</parameter>" was expecting "integer"</entry>
<entry>Fixed the cast of parameter</entry>
</row>
<row>
<entry>error</entry>
<entry><constant>HTML_PROGRESS_ERROR_INVALID_INPUT</constant></entry>
<entry>invalid input, parameter #2 "<parameter>$cells</parameter>" was expecting "positive"</entry>
<entry>Give an integer between zero and cell count</entry>
</row>
<row>
<entry>error</entry>
<entry><constant>HTML_PROGRESS_ERROR_INVALID_INPUT</constant></entry>
<entry>invalid input, parameter #2 "<parameter>$cells</parameter>" was expecting "less or equal (cell count)"</entry>
<entry>Give an integer between zero and cell count</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsect1>
<refsect1 id="{@id note}">
<title>Note</title>
<simpara>
( HTML_Progress >= 1.0 )
</simpara>
<para>
<important>
This function can not be called statically.
</important>
</para>
</refsect1>
<refsect1 id="{@id see}">
<title>See</title>
<para>
{@tutorial ui.getcellattributes.pkg},
{@tutorial ui.getcellcount.pkg}
</para>
</refsect1>
<refsect1 id="{@id example}">
<title>Example</title>
<para>
<simpara>
Example below (that requires HTML_Progress >= 1.2.0RC3) will produced a progress bar
with custom bluesand cells (see line 10).
</simpara>
<figure>
<graphic fileref="../media/screenshots/bluesand.png"></graphic>
</figure>
<example>
{@example setcellattributes.php}
</example>
</para>
</refsect1>
</refentry>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?