topical media & game development

talk show tell print

professional-php-04-closebox-decorator.php / php



  <?php
  require_once("abstract_widget.php");
  
  class CloseBoxDecorator extends Widget {
  
    private widget;
  
    function __construct(Widget & widget) {
           this->widget = widget;
    }
  
    public function draw() {
  
           this->widget->update(this->getSubject());
  
           print "<table border=0 cellspacing=1 bgcolor=#666666>";
           print "<tr bgcolor=#666666>";
           print "<td align=right>";
           print "        <table width=10 height=10 bgcolor=#cccccc>";
           print "        <tr><td><b>x</b></td></tr>";
           print "        </table>";
           print "</td>";
           print "</tr>";
           print "<tr bgcolor=#ffffff>";
           print "<td>";
           
           this->widget->draw();
           
           print "</td>";
           print "</tr>";
           print "</table>";
    }
                   
  }
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.