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

  1. <refentry id="{@id}">
  2.  <refnamediv>
  3.   <refname>setStringAttributes Manual</refname>
  4.   <refpurpose>defines look and feel of the progress bar string</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>setStringAttributes</important>( $attributes )</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 => installationProgress    </listitem>
  39.         <listitem>width => 50                   </listitem>
  40.         <listitem>font-family => Verdana, Arial, Helvetica, sans-serif   </listitem>
  41.         <listitem>font-size => 12               </listitem>
  42.         <listitem>color => #000000              </listitem>
  43.         <listitem>background-color => #FFFFFF   </listitem>
  44.         <listitem>align => right ( left, center )   </listitem>
  45.         <listitem>for horizontal bar:           </listitem>
  46.         <itemizedlist>
  47.          <listitem>valign => right (left, top, bottom)      </listitem>
  48.         </itemizedlist>
  49.         <listitem>for vertical bar:             </listitem>
  50.         <itemizedlist>
  51.          <listitem>valign => bottom (top, left, right)      </listitem>
  52.         </itemizedlist>
  53.        </itemizedlist>
  54.       </entry>
  55.      </row>
  56.     </tbody>
  57.     </tgroup>
  58.    </table>
  59.   </para>
  60.   <para>
  61.    <emphasis>$attributes</emphasis> is an associative array or string of HTML tag attributes.
  62.   </para>
  63.  </refsect1>
  64.  <refsect1 id="{@id description}">
  65.   <title>Description</title>
  66.   <para>The <emphasis>setStringAttributes()</emphasis> method is used to give a look and feel,
  67.    such as alignment, size and color, to the progress bar string.
  68.   </para>
  69.   <para>
  70.   <tip><title></title>
  71.    You may also used an existing StyleSheet and a CSS id with pre-defined style.
  72.    For example:
  73.    <para>
  74.    <programlisting role="php">
  75.    <![CDATA[
  76. <?php
  77. require_once ('HTML/Progress.php');
  78.  
  79. $bar = new HTML_Progress();
  80. // specify a user-ident (instead of the auto-generated value)
  81. $bar->setIdent('myPB');
  82. $bar->setStringPainted(true);
  83.  
  84. $ui =& $bar->getUI();
  85. $ui->setStringAttributes('id="myPBstring"');
  86. ...
  87. ?>
  88.    ]]>
  89.    </programlisting>
  90.    <example>
  91.    <![CDATA[
  92. <!-- custom stylesheet -->
  93. ...
  94. .myPB .myPBstring { width: 100px; background-color: lightyellow; color: black; }
  95. ...
  96.    ]]>
  97.    </example>
  98.    </para>
  99.    <para><graphic fileref="../media/screenshots/string1.png"></graphic></para>
  100.   </tip>
  101.   </para>
  102.  </refsect1>
  103.  <refsect1 id="{@id example}">
  104.   <title>Example</title>
  105.   <para>
  106.    Example below will produced a progress bar with a custom style string. It's a static example, 
  107.    the progress bar will not run.
  108.    <para><graphic fileref="../media/screenshots/redsandback.png"></graphic></para>
  109.    <programlisting role="php">
  110.    <![CDATA[
  111. <?php
  112. require_once ('HTML/Progress.php');
  113.  
  114. $bar = new HTML_Progress();
  115. $bar->setValue(50);
  116. $bar->setBorderPainted(true);
  117.  
  118. $ui =& $bar->getUI();
  119. $ui->setFillWay('reverse');
  120. $ui->setCellCount(5);
  121. $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
  122. $ui->setBorderAttributes('width=1 color=#000000');
  123. $ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom');
  124.  
  125. ?>
  126. <!DOCTYPE html
  127.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  128.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  129.  
  130. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  131. <head>
  132. <title>Progress example</title>
  133. <style type="text/css">
  134. <!--
  135. <?php echo $bar->getStyle(); ?>
  136. // -->
  137. </style>
  138. <script type="text/javascript">
  139. <!--
  140. <?php echo $ui->getScript(); ?>
  141. //-->
  142. </script>
  143. </head>
  144. <body>
  145.  
  146. <?php 
  147. echo $bar->toHtml(); 
  148. $bar->display();
  149. ?>
  150.  
  151. </body>
  152. </html>
  153.    ]]>
  154.    </programlisting>
  155.   </para>
  156.  </refsect1>
  157.  <refsect1 id="{@id seealso}">
  158.   <title>See Also</title>
  159.   <para>
  160.    To display the progress bar string, take care that method in {@tutorial progress.setstringpainted.cls} 
  161.    was also invoked.
  162.   </para>
  163.  </refsect1>
  164. </refentry>
  165.