home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / ui.setcellcount.cls < prev    next >
Encoding:
Text File  |  2004-03-24  |  3.2 KB  |  120 lines

  1. <refentry id="{@id}">
  2.  <refnamediv>
  3.   <refname>setCellCount Manual</refname>
  4.   <refpurpose>defines the number of cell in a progress bar</refpurpose>
  5.  </refnamediv>
  6.  <refsynopsisdiv>
  7.   <refsynopsisdivinfo>
  8.    <author>
  9.     by Laurent Laville
  10.     <authorblurb>{@link mailto:pear@laurent-laville.org}</authorblurb>
  11.    </author>
  12.    <copyright>November 2003, Laurent Laville</copyright>
  13.    <releaseinfo>HTML_Progress 1.0+</releaseinfo>
  14.   </refsynopsisdivinfo>
  15.  </refsynopsisdiv>
  16.  <refsect1 id="{@id synopsis}">
  17.   <title>Synopsis</title>
  18.   <para><emphasis>void</emphasis> <important>setCellCount</important>( $cells )</para>
  19.  </refsect1>
  20.  <refsect1 id="{@id attributes}">
  21.   <title>Attributes</title>
  22.   <para>
  23.    <table frame="all">
  24.     <tgroup cols="3">
  25.     <thead align="center">
  26.       <row>
  27.        <entry><important>Name</important></entry>
  28.        <entry><important>Type</important></entry>
  29.        <entry><important>Default</important></entry>
  30.       </row>
  31.     </thead>
  32.     <tbody>
  33.      <row>
  34.       <entry><emphasis>cells</emphasis> </entry>
  35.       <entry>integer                    </entry>
  36.       <entry>10                         </entry>
  37.      </row>
  38.     </tbody>
  39.     </tgroup>
  40.    </table>
  41.   </para>
  42.   <para>
  43.    <emphasis>$cells</emphasis> is an integer with a minimum of 1, but as no maximum limit.
  44.   </para>
  45.  </refsect1>
  46.  <refsect1 id="{@id description}">
  47.   <title>Description</title>
  48.   <para>The <emphasis>setCellCount()</emphasis> method is used to set the count of cell
  49.    in the progress bar.
  50.   </para>
  51.  </refsect1>
  52.  <refsect1 id="{@id example}">
  53.   <title>Example</title>
  54.   <para>
  55.    Example below will produced a progress bar with less than 10 default cells. 
  56.    It's a dynamic example, the progress bar will run.
  57.    <para><graphic fileref="../media/screenshots/redsandback.png"></graphic></para>
  58.    <programlisting role="php">
  59.    <![CDATA[
  60. <?php
  61. require_once ('HTML/Progress.php');
  62.  
  63. $bar = new HTML_Progress();
  64. $bar->setIncrement(10);
  65. $bar->setBorderPainted(true);
  66.  
  67. $ui =& $bar->getUI();
  68. $ui->setFillWay('reverse');
  69. $ui->setCellCount(5);
  70. $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
  71. $ui->setBorderAttributes('width=1 color=#000000');
  72. $ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom');
  73.  
  74. ?>
  75. <!DOCTYPE html
  76.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  77.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  78.  
  79. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  80. <head>
  81. <title>Progress example</title>
  82. <style type="text/css">
  83. <!--
  84. <?php echo $bar->getStyle(); ?>
  85. // -->
  86. </style>
  87. <script type="text/javascript">
  88. <!--
  89. <?php echo $ui->getScript(); ?>
  90. //-->
  91. </script>
  92. </head>
  93. <body>
  94.  
  95. <?php 
  96. echo $bar->toHtml(); 
  97.  
  98. do {
  99.     $bar->display();
  100.     if ($bar->getPercentComplete() == 1) {
  101.         break;   // the progress bar has reached 100%
  102.     }
  103.     $bar->incValue();
  104. } while(1);
  105. ?>
  106.  
  107. </body>
  108. </html>
  109.    ]]>
  110.    </programlisting>
  111.   </para>
  112.  </refsect1>
  113.  <refsect1 id="{@id seealso}">
  114.   <title>See Also</title>
  115.   <para>
  116.    To customize cell size and color, see {@tutorial ui.setcellattributes.cls} 
  117.   </para>
  118.  </refsect1>
  119. </refentry>
  120.