Source for file AWindow.php

Documentation is available at AWindow.php

  1. <?php
  2. /**
  3.  *
  4.  */
  5.  
  6.  
  7.  
  8. /**
  9.  *
  10.  */
  11. class AWindow extends AHTMLElement{
  12.     
  13.     /**
  14.      * @var string 
  15.      */
  16.     private $title;
  17.     
  18.     private $draggable = false;
  19.     
  20.     /**
  21.      * @var AWidget 
  22.      */
  23.     private $mainWidget;
  24.     
  25.     /**
  26.      *
  27.      */
  28.     public function __construct(){
  29.         parent::__construct();
  30.         $this->defineSignal('moved');
  31.         $this->setLayout(new AWindowLayout($this));
  32.     }
  33.     
  34.     /**
  35.      *
  36.      */
  37.     public function getTitle(){
  38.         return $this->title;
  39.     }
  40.     
  41.     /**
  42.      * @return AWidget the main widget
  43.      */
  44.     public function getMainWidget(){
  45.         return $this->mainWidget;
  46.     }
  47.     
  48.     /**
  49.      * @param string $title 
  50.      */
  51.     public function setTitle($title){
  52.         $this->title = (string)$title;
  53.     }
  54.     
  55.     /**
  56.      *
  57.      * @param AWidget $widget The widget to set as the main wisget in the window
  58.      */
  59.     public function setMainWidget(AWidget $widget){
  60.         $this->mainWidget = $widget;
  61.     }
  62.     
  63.     public function toggleDraggable(){
  64.         if($this->draggable){
  65.             
  66.         }else{
  67.             $this->draggable = true;
  68.             Alia::sendJScript("new Draggable('".$this->getAttribute('id')."',{handle: '".$this->getAttribute('id')."Title', onEnd: function(draggable,mouseEvent){".AJScript::emit('moved',$this)."}});");
  69.         }
  70.     }
  71.  
  72.  
  73. }
  74. ?>

Documentation generated on Fri, 11 Jul 2008 13:28:44 -0400 by phpDocumentor 1.4.2