ui.setcellcoordinates.pkg

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· PKG 代码 · 共 182 行

PKG
182
字号
<?xml version="1.0" encoding="iso-8859-1" ?>
<!-- $Revision: 1.4 $ -->

<refentry id="{@id}">

 <refnamediv>
  <refname><function>HTML_Progress_UI::setCellCoordinates</function></refname>
  <refpurpose>sets the coordinates of each cell for a polygonal shape</refpurpose>
 </refnamediv>
 
 <refsect1 id="{@id synopsis}">
  <title>Synopsis</title>
 <refsynopsisdiv>
  <funcsynopsis>
   <funcsynopsisinfo>
    require_once 'HTML/Progress/UI.php'; 
   </funcsynopsisinfo>
   <funcprototype>
    <funcdef>mixed <function>HTML_Progress_UI::setCellCoordinates</function></funcdef>
    <paramdef>int <parameter>$xgrid</parameter></paramdef>
    <paramdef>int <parameter>$ygrid</parameter></paramdef>
    <paramdef>array <parameter><optional>$coord = NULL</optional></parameter></paramdef>
   </funcprototype>
  </funcsynopsis>
 </refsynopsisdiv>
 </refsect1>

 <refsect1 id="{@id description}">
  <title>Description</title>
  <para>
   This method is used to define all cell coordinates of any progress meter 
   polygonal shape (square, rectangle ...)
  </para>
 </refsect1>

 <refsect1 id="{@id parameter}">
  <title>Parameter</title>
  <para>
   <variablelist>
    <varlistentry>
     <term>
      <type>integer</type>
      <parameter>$xgrid</parameter>
     </term>
     <listitem>
      <para>
       the grid width in cell size.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term>
      <type>integer</type>
      <parameter>$ygrid</parameter>
     </term>
     <listitem>
      <para>
       the grid height in cell size.
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term>
      <type>array</type>
      <parameter>$coord</parameter>
     </term>
     <listitem>
      <para>
       the coordinates (x,y) in the grid, of 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 #1 "<parameter>$xgrid</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 #1 "<parameter>$xgrid</parameter>" was expecting "greater than 2"</entry>
       <entry>Give an integer greater than two</entry>
      </row>
      <row>
       <entry>exception</entry>
       <entry><constant>HTML_PROGRESS_ERROR_INVALID_INPUT</constant></entry>
       <entry>invalid input, parameter #2 "<parameter>$ygrid</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>$ygrid</parameter>" was expecting "greater than 2"</entry>
       <entry>Give an integer greater than two</entry>
      </row>
      <row>
       <entry>exception</entry>
       <entry><constant>HTML_PROGRESS_ERROR_INVALID_INPUT</constant></entry>
       <entry>invalid input, parameter #3 "<parameter>$coord</parameter>" was expecting "array"</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 #3 "<parameter>$coord</parameter>" was expecting "coordinate less than grid width"</entry>
       <entry>Fixed the cell x-coordinate or the parameter #1 (grid width) </entry>
      </row>
      <row>
       <entry>error</entry>
       <entry><constant>HTML_PROGRESS_ERROR_INVALID_INPUT</constant></entry>
       <entry>invalid input, parameter #3 "<parameter>$coord</parameter>" was expecting "coordinate less than grid height"</entry>
       <entry>Fixed the cell y-coordinate or the parameter #2 (grid height) </entry>
      </row>
     </tbody>
    </tgroup>
   </table>
  </para>
 </refsect1>

 <refsect1 id="{@id note}">
  <title>Note</title>
  <simpara>
   ( HTML_Progress >= 1.2.0RC1 )
  </simpara>
  <para>
   <important>
    This function can not be called statically.
   </important>   
  </para>
  <para>
   <tip>
    For basic shapes (square, rectangle), you don't have to give all cell coordinates.
    HTML_Progress will compute it for you. You should have to give the cell coordinates list
    only for free polygonal shape.
   </tip>   
  </para>
 </refsect1>

 <refsect1 id="{@id see}">
  <title>See</title>
  <para>
   {@tutorial ui.getcellcoordinates.pkg}
  </para>
 </refsect1>
 
 <refsect1 id="{@id example}">
  <title>Example</title>
  <para>
   <simpara>
    Example below will create a rectangle 6x4 (see line 18).
   </simpara>
   <figure>
    <graphic fileref="../media/screenshots/rect64.png"></graphic>
   </figure>
   <example>
    {@example setcellcoordinates.php}
   </example>
  </para>
 </refsect1>

</refentry>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?