summaryrefslogtreecommitdiff
path: root/framework/Web/UI/WebControls/TRectangleHotSpot.php
blob: 8815e3f891d829f87ad1053b66c8845c98468b60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
 * TImageMap and related class file.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @package Prado\Web\UI\WebControls
 */

namespace Prado\Web\UI\WebControls;
use Prado\TPropertyValue;

/**
 * Class TRectangleHotSpot.
 *
 * TRectangleHotSpot defines a rectangle hot spot region in a {@link
 * TImageMap} control.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package Prado\Web\UI\WebControls
 * @since 3.0
 */
class TRectangleHotSpot extends THotSpot
{
	/**
	 * @return string shape of this hotspot.
	 */
	public function getShape()
	{
		return 'rect';
	}

	/**
	 * @return string coordinates defining this hotspot shape
	 */
	public function getCoordinates()
	{
		return $this->getLeft().','.$this->getTop().','.$this->getRight().','.$this->getBottom();
	}

	/**
	 * @return integer the Y coordinate of the bottom side of the rectangle HotSpot region. Defaults to 0.
	 */
	public function getBottom()
	{
		return $this->getViewState('Bottom',0);
	}

	/**
	 * @param integer the Y coordinate of the bottom side of the rectangle HotSpot region.
	 */
	public function setBottom($value)
	{
		$this->setViewState('Bottom',TPropertyValue::ensureInteger($value),0);
	}

	/**
	 * @return integer the X coordinate of the right side of the rectangle HotSpot region. Defaults to 0.
	 */
	public function getLeft()
	{
		return $this->getViewState('Left',0);
	}

	/**
	 * @param integer the X coordinate of the right side of the rectangle HotSpot region.
	 */
	public function setLeft($value)
	{
		$this->setViewState('Left',TPropertyValue::ensureInteger($value),0);
	}

	/**
	 * @return integer the X coordinate of the right side of the rectangle HotSpot region. Defaults to 0.
	 */
	public function getRight()
	{
		return $this->getViewState('Right',0);
	}

	/**
	 * @param integer the X coordinate of the right side of the rectangle HotSpot region.
	 */
	public function setRight($value)
	{
		$this->setViewState('Right',TPropertyValue::ensureInteger($value),0);
	}

	/**
	 * @return integer the Y coordinate of the top side of the rectangle HotSpot region. Defaults to 0.
	 */
	public function getTop()
	{
		return $this->getViewState('Top',0);
	}

	/**
	 * @param integer the Y coordinate of the top side of the rectangle HotSpot region.
	 */
	public function setTop($value)
	{
		$this->setViewState('Top',TPropertyValue::ensureInteger($value),0);
	}
}