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

  1. <refentry id="{@id}">
  2.  <refnamediv>
  3.   <refname>setOrientation Manual</refname>
  4.   <refpurpose>defines the orientation of the 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>setOrientation</important>( $orient )</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>orient</emphasis> </entry>
  35.       <entry>integer                     </entry>
  36.       <entry>HTML_PROGRESS_BAR_HORIZONTAL | [ HTML_PROGRESS_BAR_VERTICAL ] </entry>
  37.      </row>
  38.     </tbody>
  39.     </tgroup>
  40.    </table>
  41.   </para>
  42.   <para>
  43.    <emphasis>$orient</emphasis> is an integer with identify, actually in version 1.0, only 2 shapes,
  44.    Horizontal and Vertical Progress Bars.
  45.   </para>
  46.  </refsect1>
  47.  <refsect1 id="{@id description}">
  48.   <title>Description</title>
  49.   <para>The <emphasis>setOrientation()</emphasis> method is used to change orientation
  50.    of the progress bar after you invoked the constructor. For example, you can swap from a
  51.    horizontal progress bar to a vertical one, by only one call such as: 
  52.    <emphasis>setOrientation(HTML_PROGRESS_BAR_VERTICAL)</emphasis>.
  53.   </para>
  54.  </refsect1>
  55.  <refsect1 id="{@id example}">
  56.   <title>Example</title>
  57.   <para>
  58.    Example below will produced a vertical progress bar with only 6 cells.
  59.    It's a dynamic example, the progress bar will run.
  60.    <para><graphic fileref="../media/screenshots/vertical1.png"></graphic></para>
  61.    <programlisting role="php">
  62.    <![CDATA[
  63. <?php
  64. require_once ('HTML/Progress.php');
  65.  
  66. $bar = new HTML_Progress();
  67. $bar->setIdent('PB1');
  68. $bar->setIncrement(10);
  69. $bar->setBorderPainted(true);
  70.  
  71. $ui =& $bar->getUI();
  72. $ui->setOrientation(HTML_PROGRESS_BAR_VERTICAL);
  73. $ui->setFillWay('natural');
  74. $ui->setCellCount(6);
  75. $ui->setCellAttributes(array(
  76.     'active-color' => '#970038',
  77.     'inactive-color' => '#FFDDAA',
  78.     'width' => 50,
  79.     'height' => 13
  80. ));
  81. $ui->setBorderAttributes('width=1');
  82. $ui->setStringAttributes(array(
  83.     'font-size' => 8,
  84.     'color' => '#FF0000',
  85.     'background-color' => '#C3C6C3',
  86.     'align' => 'center', 
  87.     'valign' => 'bottom'
  88. ));
  89.  
  90. ?>
  91. <!DOCTYPE html
  92.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  93.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  94.  
  95. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  96. <head>
  97. <title>Progress example</title>
  98. <style type="text/css">
  99. <!--
  100. <?php echo $bar->getStyle(); ?>
  101.  
  102. body {
  103.     background-color: #C3C6C3;
  104.     color: #000000;
  105.     font-family: Verdana, Arial;
  106. }
  107. // -->
  108. </style>
  109. <script type="text/javascript">
  110. <!--
  111. <?php echo $ui->getScript(); ?>
  112. //-->
  113. </script>
  114. </head>
  115. <body>
  116.  
  117. <?php 
  118. echo $bar->toHtml(); 
  119.  
  120. do {
  121.     $bar->display();
  122.     if ($bar->getPercentComplete() == 1) {
  123.         break;   // the progress bar has reached 100%
  124.     }
  125.     $bar->incValue();
  126. } while(1);
  127. ?>
  128.  
  129. </body>
  130. </html>
  131.    ]]>
  132.    </programlisting>
  133.   </para>
  134.  </refsect1>
  135.  <refsect1 id="{@id seealso}">
  136.   <title>See Also</title>
  137.   <para>
  138.    To display a progress bar filled in reverse order, have a look on {@tutorial ui.setfillway.cls} 
  139.   </para>
  140.  </refsect1>
  141. </refentry>
  142.