ManiaLib 1.0b1 API Reference

Source for file DialogCard.class.php

Documentation is available at DialogCard.class.php

  1. <?php
  2. /**
  3.  * @author Maxime Raoust
  4.  * @copyright 2009-2010 NADEO
  5.  * @package ManiaLib
  6.  */
  7.  
  8. /**
  9.  * Dialog
  10.  * Dialog box with 1 button
  11.  * @package ManiaLib
  12.  * @subpackage GUIToolkit_Cards
  13.  */
  14. class DialogCard extends Panel
  15. {
  16.     /**
  17.      * @var Button 
  18.      */
  19.     public $button;
  20.     /**
  21.      * @ignore
  22.      */
  23.     protected $elementsToShow array();
  24.     
  25.     function __construct($sizeX 65$sizeY 25)
  26.     {
  27.         parent::__construct($sizeX$sizeY);
  28.         
  29.         $this->setSubStyle(Bgs1::BgTitle2);
  30.         $this->title->setStyle(Label::TextTitle2);
  31.         
  32.         $this->button = new Button;
  33.         $this->button->setAlign('center''bottom');
  34.         
  35.         $this->elementsToShow[$this->button;
  36.     }
  37.     
  38.     /**
  39.      * @ignore
  40.      */
  41.     protected function postFilter()
  42.     {
  43.         parent::postFilter();
  44.         
  45.         $arr GuiTools::getAlignedPos($this'center''bottom');
  46.         $x $arr['x'];
  47.         $y $arr['y'];
  48.         
  49.         Manialink::beginFrame($x$y+2$this->posZ+1);
  50.         {
  51.             foreach($this->elementsToShow as $GUIElement)
  52.             {
  53.                 $GUIElement->save();
  54.             }
  55.         }
  56.         Manialink::endFrame();
  57.     }
  58. }
  59.  
  60. ?>