From c5e3052cdab7d0d8d86ddd272a906e850e0bc90a Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 21 Jan 2006 06:13:46 +0000 Subject: Replaced TRadioButton's with TRadioButtonList in hangman demo. --- .../pages/Fundamentals/Samples/Hangman/Home.page | 8 +++++--- .../protected/pages/Fundamentals/Samples/Hangman/Home.php | 15 +++------------ 2 files changed, 8 insertions(+), 15 deletions(-) (limited to 'demos/quickstart/protected') diff --git a/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page b/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page index 31058fa5..bae7b308 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page +++ b/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page @@ -6,9 +6,11 @@

This is the game of Hangman. You must guess a word, a letter at a time. If you make too many mistakes, you lose the game!

-
-
-
+ + + + +
diff --git a/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.php b/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.php index 93028573..cbbd1c56 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.php +++ b/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.php @@ -2,24 +2,15 @@ class Home extends TPage { - const EASY_LEVEL=10; - const MEDIUM_LEVEL=5; - const HARD_LEVEL=3; - public function selectLevel($sender,$param) { - if($this->EasyLevel->Checked) - $this->Level=self::EASY_LEVEL; - else if($this->MediumLevel->Checked) - $this->Level=self::MEDIUM_LEVEL; - else if($this->HardLevel->Checked) - $this->Level=self::HARD_LEVEL; - else + if(($selection=$this->LevelSelection->SelectedValue)==='') { $this->LevelError->Visible=true; return; } - + else + $this->Level=TPropertyValue::ensureInteger($selection); $this->Word=$this->generateWord(); $this->GuessWord=str_repeat('_',strlen($this->Word)); $this->Misses=0; -- cgit v1.2.3