FML Improvements
This commit is contained in:
		| @@ -7,6 +7,7 @@ use FML\Controls\Frame; | ||||
| use FML\Controls\Quad; | ||||
| use FML\Models\CheckBoxDesign; | ||||
| use FML\Script\Features\CheckBoxFeature; | ||||
| use FML\Script\Features\ScriptFeature; | ||||
| use FML\Types\Renderable; | ||||
| use FML\Types\ScriptFeatureable; | ||||
|  | ||||
| @@ -99,22 +100,6 @@ class CheckBox implements Renderable, ScriptFeatureable { | ||||
| 		return $this; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get the CheckBox Quad | ||||
| 	 * | ||||
| 	 * @param bool $createIfEmpty (optional) Create the Quad if it's not set | ||||
| 	 * @return \FML\Controls\Quad | ||||
| 	 */ | ||||
| 	public function getQuad($createIfEmpty = true) { | ||||
| 		if (!$this->feature->getQuad() && $createIfEmpty) { | ||||
| 			$quad = new Quad(); | ||||
| 			$quad->setSize(10, 10); | ||||
| 			$quad->setScriptEvents(true); | ||||
| 			$this->feature->setQuad($quad); | ||||
| 		} | ||||
| 		return $this->feature->getQuad(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Set the CheckBox Quad | ||||
| 	 * | ||||
| @@ -130,7 +115,24 @@ class CheckBox implements Renderable, ScriptFeatureable { | ||||
| 	 * @see \FML\Types\ScriptFeatureable::getScriptFeatures() | ||||
| 	 */ | ||||
| 	public function getScriptFeatures() { | ||||
| 		return array($this->feature); | ||||
| 		return ScriptFeature::collect($this->feature, $this->getQuad(), $this->feature->getEntry()); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Get the CheckBox Quad | ||||
| 	 * | ||||
| 	 * @param bool $createIfEmpty (optional) Create the Quad if it's not set | ||||
| 	 * @return \FML\Controls\Quad | ||||
| 	 */ | ||||
| 	public function getQuad($createIfEmpty = true) { | ||||
| 		if (!$this->feature->getQuad() && $createIfEmpty) { | ||||
| 			$quad = new Quad(); | ||||
| 			$quad->setSize(10, 10); | ||||
| 			$quad->setScriptEvents(true); | ||||
| 			$this->feature->setQuad($quad); | ||||
|  | ||||
| 		} | ||||
| 		return $this->feature->getQuad(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user