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

  1. <refentry id="{@id}">
  2.  <refnamediv>
  3.   <refname>setCellAttributes Manual</refname>
  4.   <refpurpose>defines look and feel of the progress bar cells</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>setCellAttributes</important>( $attributes, $cell )</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>attributes</emphasis> </entry>
  35.       <entry>array                  </entry>
  36.       <entry>
  37.        <itemizedlist>
  38.         <listitem>id => progressCell%01s   </listitem>
  39.         <listitem>class => cell            </listitem>
  40.         <listitem>spacing => 2             </listitem>
  41.         <listitem>active-color => #006600        </listitem>
  42.         <listitem>inactive-color => #CCCCCC      </listitem>
  43.         <listitem>font-family => Courier, Verdana      </listitem>
  44.         <listitem>font-size => 8           </listitem>
  45.         <listitem>color => #000000         </listitem>
  46.         <listitem>for horizontal bar:      </listitem>
  47.         <itemizedlist>
  48.          <listitem>width => 15             </listitem>
  49.          <listitem>height => 20            </listitem>
  50.         </itemizedlist>
  51.         <listitem>for vertical bar:        </listitem>
  52.         <itemizedlist>
  53.          <listitem>width => 20             </listitem>
  54.          <listitem>height => 15            </listitem>
  55.         </itemizedlist>
  56.        </itemizedlist>
  57.       </entry>
  58.      </row>
  59.      <row>
  60.       <entry><emphasis>cell</emphasis> </entry>
  61.       <entry>integer                   </entry>
  62.       <entry>null                      </entry>
  63.      </row>
  64.     </tbody>
  65.     </tgroup>
  66.    </table>
  67.   </para>
  68.   <para>
  69.    <emphasis>$attributes</emphasis> is an associative array or string of HTML tag attributes.
  70.   </para>
  71.   <para>
  72.    <emphasis>$cell</emphasis> is an integer that allows to identify each cell, and properties
  73.     to apply.
  74.   </para>
  75.  </refsect1>
  76.  <refsect1 id="{@id description}">
  77.   <title>Description</title>
  78.   <para>The <emphasis>setCellAttributes()</emphasis> method is used to give a look and feel,
  79.    such as spacing, size and color, to the progress bar cells.
  80.   </para>
  81.  </refsect1>
  82.  <refsect1 id="{@id example}">
  83.   <title>Example</title>
  84.   <para>
  85.    Example below will produced a progress bar with smaller cell. It's a dynamic example, 
  86.    the progress bar will run.
  87.    <para><graphic fileref="../media/screenshots/bluesand.png"></graphic></para>
  88.    <programlisting role="php">
  89.    <![CDATA[
  90. <?php
  91. require_once ('HTML/Progress.php');
  92.  
  93. $bar = new HTML_Progress();
  94. $bar->setIncrement(10);
  95. $bar->setBorderPainted(true);
  96.  
  97. $ui =& $bar->getUI();
  98. $ui->setCellAttributes('active-color=#3874B4 inactive-color=#EEEECC width=10');
  99. $ui->setBorderAttributes('width=1 color=navy');
  100. $ui->setStringAttributes('width=60 font-size=14 background-color=#EEEEEE align=center');
  101.  
  102. ?>
  103. <!DOCTYPE html
  104.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  105.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  106.  
  107. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  108. <head>
  109. <title>Progress example</title>
  110. <style type="text/css">
  111. <!--
  112. <?php echo $bar->getStyle(); ?>
  113. // -->
  114. </style>
  115. <script type="text/javascript">
  116. <!--
  117. <?php echo $ui->getScript(); ?>
  118. //-->
  119. </script>
  120. </head>
  121. <body>
  122.  
  123. <?php 
  124. echo $bar->toHtml(); 
  125.  
  126. do {
  127.     $bar->display();
  128.     if ($bar->getPercentComplete() == 1) {
  129.         break;   // the progress bar has reached 100%
  130.     }
  131.     $bar->incValue();
  132. } while(1);
  133. ?>
  134.  
  135. </body>
  136. </html>
  137.    ]]>
  138.    </programlisting>
  139.   </para>
  140.  </refsect1>
  141.  <refsect1 id="{@id seealso}">
  142.   <title>See Also</title>
  143.   <para>
  144.    To display a progress bar with more or less cells, see {@tutorial ui.setcellcount.cls} 
  145.   </para>
  146.  </refsect1>
  147. </refentry>
  148.