summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDroppable/Home.php
blob: c59d035c8c3ee97c2df5645dc3287d29a0cc2ec5 (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
<?php

class Home extends TPage
{
	public function drop1_ondrop($sender, $param)
	{
		$draggable=$param->DraggableControl;
		/* Equals to:
		 * $draggable=$param->getControl($param->getCallbackParameter()->draggable);
		 */
		$offset=$param->getCallbackParameter()->offset;
		$target=$param->getCallbackParameter()->target->offset;
		$top=$offset->top - $target->top;
		$left=$offset->left - $target->left;
		$this->label1->Text="Dropped ".$draggable->ID." at: <br/>Top=".$top." Left=".$left;
	}

	public function drop2_ondrop($sender, $param)
	{
		$draggable=$param->DraggableControl;
		/* Equals to:
		 * $draggable=$param->getControl($param->getCallbackParameter()->draggable);
		 */
		$offset=$param->getCallbackParameter()->offset;
		$target=$param->getCallbackParameter()->target->offset;
		$top=$offset->top - $target->top;
		$left=$offset->left - $target->left;
		$this->label2->Text="Dropped ".$draggable->ID." at: <br/>Top=".$top." Left=".$left;
	}
}