diff options
Diffstat (limited to 'demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable')
-rw-r--r-- | demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page | 28 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php | 30 |
2 files changed, 56 insertions, 2 deletions
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page index 349922cb..3155afa1 100644 --- a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.page @@ -12,10 +12,11 @@ </com:TStyleSheet> <table class="sampletable"> -<tr><td class="samplenote"> -Default options with a little css applied: +<tr><td class="samplenote" rowspan="2"> +Default options with a little css applied, change options during callback: </td><td class="sampleaction" style="height:600px"> <com:TJuiDraggable + ID="drag1" OnStart="drag1_start" OnStop="drag1_stop" > @@ -24,6 +25,29 @@ Default options with a little css applied: <com:TActiveLabel ID="label1" Text="Waiting.." /> </td></tr> +<tr><td> + <div> + Move direction + <com:TActiveButton Text="only horizontally" OnClick="drag1h" /> + <com:TActiveButton Text="only vertically" OnClick="drag1v" /> + <com:TActiveButton Text="both directions" OnClick="drag1b" /> + </div> + <div> + Cursor is + <com:TActiveDropDownList OnSelectedIndexChanged="drag2c"> + <com:TListItem Text="auto" Value="auto" Selected="true" /> + <com:TListItem Text="move" Value="move" /> + <com:TListItem Text="pointer" Value="pointer" /> + <com:TListItem Text="crosshair" Value="crosshair" /> + <com:TListItem Text="help" Value="help" /> + </com:TActiveDropDownList> + while dragging + </div> + <div> + <com:TActiveCheckBox OnCheckedChanged="drag3r" Text="Revert to original position after dragging stopped" /> + </div> +</td></tr> + </table> </com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php index 348eea55..92c30486 100644 --- a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDraggable/Home.php @@ -13,4 +13,34 @@ class Home extends TPage $offset=$param->getCallbackParameter()->offset; $this->label1->Text.="<br/>Stop drop at (".$offset->left.",".$offset->top.")"; } + + protected function drag1h($sender, $param) + { + $this->drag1->getOptions()->axis = 'x'; + $this->label1->Text.="<br/>Drag horizontally only"; + } + + protected function drag1v($sender, $param) + { + $this->drag1->getOptions()->axis = 'y'; + $this->label1->Text.="<br/>Drag vertically only"; + } + + protected function drag1b($sender, $param) + { + $this->drag1->getOptions()->axis = false; + $this->label1->Text.="<br/>Drag all directions"; + } + + protected function drag2c($sender, $param) + { + $this->drag1->getOptions()->cursor = $sender->getSelectedValue(); + $this->label1->Text.="<br/>Change dragging cursor to ".$sender->getSelectedValue(); + } + + protected function drag3r($sender, $param) + { + $this->drag1->getOptions()->revert = $sender->getChecked(); + $this->label1->Text.="<br/>".($sender->getChecked()?'Turn on':'Turn off')." reverting to original position."; + } }
\ No newline at end of file |