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

  1. <refentry id="{@id}">
  2.  <refnamediv>
  3.   <refname>setFillWay Manual</refname>
  4.   <refpurpose>decides how the progress bar will be filled</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>setFillWay</important>( $way )</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>way</emphasis> </entry>
  35.       <entry>string                   </entry>
  36.       <entry>natural | [ reverse ]    </entry>
  37.      </row>
  38.     </tbody>
  39.     </tgroup>
  40.    </table>
  41.   </para>
  42.  </refsect1>
  43.  <refsect1 id="{@id description}">
  44.   <title>Description</title>
  45.   <para>The <emphasis>setFillWay()</emphasis> method is used to change the fill way
  46.    of the progress bar.
  47.    It could be <emphasis>natural</emphasis> (left to right for horizontal progress bar),
  48.    (down to up for vertical progress bar) or <emphasis>reverse</emphasis> 
  49.    (right to left for horizontal progress bar), (up to down for vertical progress bar).
  50.   </para>
  51.  </refsect1>
  52.  <refsect1 id="{@id example}">
  53.   <title>Example</title>
  54.   <para>
  55.    Example below will produced a vertical progress bar with only 5 cells filled in reverse order.
  56.    It's a dynamic example, the progress bar will run.
  57.    <para><graphic fileref="../media/screenshots/vertical2.png"></graphic></para>
  58.    <programlisting role="php">
  59.    <![CDATA[
  60. <?php
  61. require_once ('HTML/Progress.php');
  62.  
  63. $bar = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
  64. $bar->setIdent('PB1');
  65. $bar->setIncrement(10);
  66.  
  67. $ui =& $bar->getUI();
  68. $ui->setComment('Reverse ProgressBar example');
  69. $ui->setTabOffset(1);
  70. $ui->setFillWay('reverse');
  71. $ui->setCellCount(5);
  72. $ui->setProgressAttributes(array(
  73.     'background-color' => '#e0e0e0'
  74. ));        
  75. $ui->setStringAttributes(array(
  76.     'valign' => 'left',
  77.     'color'  => 'red',
  78.     'background-color' => 'lightblue'
  79.     ));
  80.  
  81. ?>
  82. <!DOCTYPE html
  83.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  84.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  85.  
  86. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  87. <head>
  88. <title>Progress example</title>
  89. <style type="text/css">
  90. <!--
  91. <?php echo $bar->getStyle(); ?>
  92.  
  93. body {
  94.     background-color: lightblue;
  95.     color: #000000;
  96.     font-family: Verdana, Arial;
  97. }
  98. // -->
  99. </style>
  100. <script type="text/javascript">
  101. <!--
  102. <?php echo $ui->getScript(); ?>
  103. //-->
  104. </script>
  105. </head>
  106. <body>
  107.  
  108. <?php 
  109. echo $bar->toHtml(); 
  110.  
  111. do {
  112.     $bar->display();
  113.     if ($bar->getPercentComplete() == 1) {
  114.         break;   // the progress bar has reached 100%
  115.     }
  116.     $bar->incValue();
  117. } while(1);
  118. ?>
  119.  
  120. </body>
  121. </html>
  122.    ]]>
  123.    </programlisting>
  124.   </para>
  125.  </refsect1>
  126.  <refsect1 id="{@id seealso}">
  127.   <title>See Also</title>
  128.   <para>
  129.    To display a vertical progress bar, see {@tutorial ui.setorientation.cls} 
  130.   </para>
  131.  </refsect1>
  132. </refentry>
  133.