diff options
author | Jens Klaer <kj.landwehr.software@gmail.com> | 2015-05-20 15:56:09 +0200 |
---|---|---|
committer | Jens Klaer <kj.landwehr.software@gmail.com> | 2015-05-20 15:56:09 +0200 |
commit | 55338f1cf947b8593a3e23094d6feab625370e28 (patch) | |
tree | e8d714ed8afad949c9e3ee93cf1fcc0602d92b36 /demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog | |
parent | 0fb75d64f8dbcc98b4c06e7556125b94bf612819 (diff) |
extended quichstart tutorial for TJuiControl option changes during callback
Diffstat (limited to 'demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog')
-rw-r--r-- | demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.page | 30 | ||||
-rw-r--r-- | demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.php | 33 |
2 files changed, 63 insertions, 0 deletions
diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.page b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.page index 6a9df446..acf49068 100644 --- a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.page +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.page @@ -62,6 +62,36 @@ Dialog with buttons: <com:TActiveLabel ID="lbl3" /> </td></tr> +<tr><td class="samplenote"> +Dialog with callbacks: +</td><td class="sampleaction"> +<com:TActiveButton + Text="Open Dialog" + OnClick="bt4Click"/> +<com:TJuiDialog + ID="dlg4" + Options.Width="400" + Options.Title="Dialog with callbacks" + Options.AutoOpen="False" + Options.Position="center center" + > + Change dialog options during callback. + <com:TJuiDialogButton + Text="change title" + OnClick="dlg4title" + /> + <com:TJuiDialogButton + Text="toggle width" + OnClick="dlg4width" + /> + <com:TJuiDialogButton + Text="toggle position" + OnClick="dlg4pos" + /> + +</com:TJuiDialog> +</td></tr> + </table> </com:TContent> diff --git a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.php b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.php index f9d1e3a9..3d89011c 100644 --- a/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.php +++ b/demos/quickstart/protected/pages/JuiControls/Samples/TJuiDialog/Home.php @@ -18,6 +18,11 @@ class Home extends TPage $this->dlg3->open(); } + public function bt4Click($sender, $param) + { + $this->dlg4->open(); + } + public function dlg3Ok($sender, $param) { $this->lbl3->Text="Button Ok clicked"; @@ -30,4 +35,32 @@ class Home extends TPage $this->dlg3->close(); } + public function dlg4title($sender, $param) + { + $this->dlg4->getOptions()->title = 'Title changed at ' . date('Y-m-d H:i:s'); + } + + public function dlg4width($sender, $param) + { + $this->dlg4->getOptions()->width += $this->dlg4->getOptions()->width > 400 ? -200 : 200; + } + + public function dlg4pos($sender, $param) + { + list($x, $y) = explode(' ', $this->dlg4->getOptions()->position); + if ($x == 'left') { + if ($y == 'top') $x = 'right'; + else $y = 'top'; + } + elseif ($x == 'right') { + if ($y == 'top') $y = 'bottom'; + else $x = 'left'; + } + else { + $x = 'left'; + $y = 'top'; + } + $this->dlg4->getOptions()->position = "$x $y"; + } + }
\ No newline at end of file |