Current File : //opt/RZphp5/includes/doc/HTML_Progress2/docs/TDG/ch07.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>
      Chapter&nbsp;7.&nbsp;Listener
    </title>
    <link rel="stylesheet" href="book.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />
    <link rel="start" href="index.html" title="HTML_Progress2 Manual" />
    <link rel="up" href="pt02.html" title=
    "Part&nbsp;II.&nbsp;Getting Started" />
    <link rel="prev" href="ch06s02.html" title="Progress Monitor usage" />
    <link rel="next" href="ch07s02.html" title="How to observe events ?" />
    <style type="text/css">
/*<![CDATA[*/
    body {
    background-color: white;
    color: black;
    }
    :link { color: #0000FF }
    :visited { color: #840084 }
    :active { color: #0000FF }
    h2.c2 {clear: both}
    p.c1 {font-weight: bold}
    /*]]>*/
    </style>
  </head>
  <body>
    <table class="progress2Header">
      <tr>
        <td>
          <img src="img/pear_progress2.gif" align="left" alt=
          "PEAR Progress2 logo" />
          <h1>
            HTML_Progress2 : The Definitive Guide
          </h1>
          <div class="navheader">
            <table width="100%" summary="Navigation header">
              <tr>
                <th colspan="3" align="center">
                  Chapter&nbsp;7.&nbsp;Listener
                </th>
              </tr>
              <tr>
                <td width="20%" align="left">
                  <a accesskey="p" href="ch06s02.html">Prev</a>&nbsp;
                </td>
                <th width="60%" align="center">
                  Part&nbsp;II.&nbsp;Getting Started
                </th>
                <td width="20%" align="right">
                  &nbsp;<a accesskey="n" href="ch07s02.html">Next</a>
                </td>
              </tr>
            </table>
          </div>
        </td>
      </tr>
    </table>
    <div class="chapter" lang="en" xml:lang="en">
      <div class="titlepage">
        <h2 class="title">
          <a name="developers.listener" id=
          "developers.listener"></a>Chapter&nbsp;7.&nbsp;Listener
        </h2>
      </div>
      <div class="toc">
        <p class="c1">
          Table of Contents
        </p>
        <dl>
          <dt>
            <span class="sect1"><a href="ch07.html#listener.events">Events
            categories</a></span>
          </dt>
          <dt>
            <span class="sect1"><a href="ch07s02.html">How to observe events
            ?</a></span>
          </dt>
        </dl>
      </div>
      <p>
        HTML_Progress2 class provides an implementation of the observer
        pattern. It provide a mechanism which you can examine each important
        event as it is happened. This allow the implementation of special
        behavior based on the value of the progress meter.
      </p>
      <p>
        Implementation of a standardized observer pattern is made with help of
        <span class="emphasis"><em>PEAR::Event_Dispatcher</em></span> <a class=
        "external" href="http://pear.php.net/package/Event_Dispatcher" title=
        "http://pear.php.net/package/Event_Dispatcher">package</a> (<a class=
        "external" href=
        "http://pear.php.net/manual/en/package.event.event-dispatcher.php"
        title=
        "http://pear.php.net/manual/en/package.event.event-dispatcher.php">manual</a>
        ).
      </p>
      <div class="sect1" lang="en" xml:lang="en">
        <div class="titlepage">
          <h2 class="title c2">
            <a name="listener.events" id="listener.events"></a>Events
            categories
          </h2>
        </div>
        <p>
          Depending on action triggered, there are four events you may be
          listen:
        </p>
        <div class="itemizedlist">
          <ul type="disc">
            <li>
              <p>
                <span class="bold"><strong>onSubmit</strong></span>. This event
                corresponding to start of progress meter (at launch of
                <code class="methodname">run()</code> method).
              </p>
            </li>
            <li>
              <p>
                <span class="bold"><strong>onLoad</strong></span>. This event
                corresponding when progress meter reach 100% (just after
                <code class="methodname">run()</code> method execution).
              </p>
            </li>
            <li>
              <p>
                <span class="bold"><strong>onChange</strong></span> This event
                corresponding when progress meter value is changed. Many
                reasons :
              </p>
              <div class="itemizedlist">
                <ul type="circle">
                  <li>declare or change minimum value with <code class=
                  "methodname">setMinimum()</code> method
                  </li>
                  <li>declare or change maximum value with <code class=
                  "methodname">setMaximum()</code> method
                  </li>
                  <li>change current value with <code class=
                  "methodname">setValue()</code> or <code class=
                  "methodname">incValue()</code> methods
                  </li>
                  <li>refresh display with <code class=
                  "methodname">moveStep()</code> or <code class=
                  "methodname">moveNext()</code> methods
                  </li>
                </ul>
              </div>
            </li>
            <li>
              <p>
                <span class="bold"><strong>onCancel</strong></span> [progress
                monitor only]. This event corresponding when progress monitor
                is stopped by user action (cancel key pressed).
              </p>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <table class="progress2Footer">
      <tr>
        <td align="left">
          HTML_Progress2 : The Definitive Guide
        </td>
        <td align="right">
          v 2.4.0 : April 20, 2007
        </td>
      </tr>
    </table>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left">
            <a accesskey="p" href="ch06s02.html">Prev</a>&nbsp;
          </td>
          <td width="20%" align="center">
            <a accesskey="u" href="pt02.html">Up</a>
          </td>
          <td width="40%" align="right">
            &nbsp;<a accesskey="n" href="ch07s02.html">Next</a>
          </td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">
            Progress Monitor usage&nbsp;
          </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top">
            &nbsp;How to observe events ?
          </td>
        </tr>
      </table>
    </div>
  </body>
</html>