updated FML
This commit is contained in:
@ -67,11 +67,21 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
*/
|
||||
protected $height = 0.;
|
||||
|
||||
/**
|
||||
* @var string $defaultHorizontalAlign Default horizontal alignment
|
||||
*/
|
||||
static protected $defaultHorizontalAlign = self::CENTER;
|
||||
|
||||
/**
|
||||
* @var string $horizontalAlign Horizontal alignment
|
||||
*/
|
||||
protected $horizontalAlign = self::CENTER;
|
||||
|
||||
/**
|
||||
* @var string $defaultVerticalAlign Default vertical alignment
|
||||
*/
|
||||
static protected $defaultVerticalAlign = self::CENTER2;
|
||||
|
||||
/**
|
||||
* @var string $verticalAlign Vertical alignment
|
||||
*/
|
||||
@ -130,6 +140,8 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
if ($controlId) {
|
||||
$this->setId($controlId);
|
||||
}
|
||||
$this->setHorizontalAlign(static::$defaultHorizontalAlign);
|
||||
$this->setVerticalAlign(static::$defaultVerticalAlign);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -310,6 +322,17 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
->setHeight($height);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default horizontal alignment
|
||||
*
|
||||
* @api
|
||||
* @return string
|
||||
*/
|
||||
public static function getDefaultHorizontalAlign()
|
||||
{
|
||||
return static::$defaultHorizontalAlign;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the horizontal alignment
|
||||
*
|
||||
@ -321,6 +344,17 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
return $this->horizontalAlign;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default horizontal alignment
|
||||
*
|
||||
* @api
|
||||
* @param string $defaultHorizontalAlignment Default horizontal alignment
|
||||
*/
|
||||
public static function setDefaultHorizontalAlign($defaultHorizontalAlignment)
|
||||
{
|
||||
static::$defaultHorizontalAlign = (string)$defaultHorizontalAlignment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the horizontal alignment
|
||||
*
|
||||
@ -348,6 +382,17 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default vertical alignment
|
||||
*
|
||||
* @api
|
||||
* @return string
|
||||
*/
|
||||
public static function getDefaultVerticalAlign()
|
||||
{
|
||||
return static::$defaultVerticalAlign;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the vertical alignment
|
||||
*
|
||||
@ -359,6 +404,17 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
return $this->verticalAlign;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default vertical alignment
|
||||
*
|
||||
* @api
|
||||
* @param string $defaultVerticalAlignment Default vertical alignment
|
||||
*/
|
||||
public static function setDefaultVerticalAlign($defaultVerticalAlignment)
|
||||
{
|
||||
static::$defaultVerticalAlign = (string)$defaultVerticalAlignment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the vertical alignment
|
||||
*
|
||||
@ -400,6 +456,17 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
->setVerticalAlign($verticalAlign);
|
||||
}
|
||||
|
||||
/**
|
||||
* Center the default alignment
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public static function centerDefaultAlign()
|
||||
{
|
||||
static::$defaultHorizontalAlign = static::CENTER;
|
||||
static::$defaultVerticalAlign = static::CENTER2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Center the alignment
|
||||
*
|
||||
@ -424,6 +491,17 @@ abstract class Control implements Identifiable, Renderable, ScriptFeatureable
|
||||
return $this->clearAlign();
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the default alignment
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public static function clearDefaultAlign()
|
||||
{
|
||||
static::$defaultHorizontalAlign = null;
|
||||
static::$defaultVerticalAlign = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the alignment
|
||||
*
|
||||
|
@ -3,8 +3,8 @@
|
||||
namespace FML\Controls;
|
||||
|
||||
use FML\Script\Features\GraphCurve;
|
||||
|
||||
// TODO: check CoordsMin & CoordsMax properties of CMlGraph
|
||||
use FML\Script\Features\GraphSettings;
|
||||
use FML\Script\Features\ScriptFeature;
|
||||
|
||||
/**
|
||||
* Graph Control
|
||||
@ -17,11 +17,42 @@ use FML\Script\Features\GraphCurve;
|
||||
class Graph extends Control
|
||||
{
|
||||
|
||||
/**
|
||||
* @var GraphSettings $graphSettings Graph settings
|
||||
*/
|
||||
protected $graphSettings = null;
|
||||
|
||||
/**
|
||||
* @var GraphCurve[] $curves Curves
|
||||
*/
|
||||
protected $curves = array();
|
||||
|
||||
/**
|
||||
* Get the graph settings
|
||||
*
|
||||
* @api
|
||||
* @return GraphSettings
|
||||
*/
|
||||
public function getSettings()
|
||||
{
|
||||
if (!$this->graphSettings) {
|
||||
$this->createSettings();
|
||||
}
|
||||
return $this->graphSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create new graph settings
|
||||
*
|
||||
* @return GraphSettings
|
||||
*/
|
||||
protected function createSettings()
|
||||
{
|
||||
$this->graphSettings = new GraphSettings($this);
|
||||
$this->addScriptFeature($this->graphSettings);
|
||||
return $this->graphSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get curves
|
||||
*
|
||||
|
@ -65,7 +65,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL
|
||||
/**
|
||||
* @var int $actionKey Action key
|
||||
*/
|
||||
protected $actionKey = -1;
|
||||
protected $actionKey = null;
|
||||
|
||||
/**
|
||||
* @var string $url Url
|
||||
@ -651,7 +651,7 @@ class Label extends Control implements Actionable, Linkable, NewLineable, MultiL
|
||||
if ($this->action) {
|
||||
$domElement->setAttribute("action", $this->action);
|
||||
}
|
||||
if ($this->actionKey >= 0) {
|
||||
if ($this->actionKey) {
|
||||
$domElement->setAttribute("actionkey", $this->actionKey);
|
||||
}
|
||||
if ($this->url) {
|
||||
|
@ -98,7 +98,7 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab
|
||||
/**
|
||||
* @var int $actionKey Action key
|
||||
*/
|
||||
protected $actionKey = -1;
|
||||
protected $actionKey = null;
|
||||
|
||||
/**
|
||||
* @var string $url Link url
|
||||
@ -676,6 +676,8 @@ class Quad extends Control implements Actionable, BackgroundColorable, BgColorab
|
||||
* @api
|
||||
* @param CheckBoxDesign $checkBoxDesign CheckBox Design
|
||||
* @return static
|
||||
* @deprecated Use CheckBoxDesign::applyToQuad()
|
||||
* @see CheckBoxDesign::applyToQuad()
|
||||
*/
|
||||
public function applyCheckBoxDesign(CheckBoxDesign $checkBoxDesign)
|
||||
{
|
||||
|
@ -17,10 +17,9 @@ class Quad_Icons128x32_1 extends Quad
|
||||
/*
|
||||
* Constants
|
||||
*/
|
||||
const STYLE = 'Icons128x32_1';
|
||||
const SUBSTYLE_ArrowUp = 'ArrowUp';
|
||||
const SUBSTYLE_BgQuadWhite = 'BgQuadWhite';
|
||||
// TODO: validate existence of 'close'
|
||||
const STYLE = 'Icons128x32_1';
|
||||
const SUBSTYLE_ArrowUp = 'ArrowUp';
|
||||
const SUBSTYLE_BgQuadWhite = 'BgQuadWhite';
|
||||
const SUBSTYLE_Close = 'Close';
|
||||
const SUBSTYLE_Empty = 'Empty';
|
||||
const SUBSTYLE_ManiaLinkHome = 'ManiaLinkHome';
|
||||
|
Reference in New Issue
Block a user