From 3fcf847e0cadfb9ede930f538c2f277483442175 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 21 Jan 2006 17:29:40 +0000 Subject: BE AWARE: Significant change! Changed event definition from XXX to OnXXX. --- .../protected/pages/Fundamentals/Components.page | 12 ++--- .../pages/Fundamentals/Samples/Hangman/Home.page | 60 +++++++++++----------- .../Fundamentals/Samples/HelloWorld/Home.page | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) (limited to 'demos/quickstart/protected/pages/Fundamentals') diff --git a/demos/quickstart/protected/pages/Fundamentals/Components.page b/demos/quickstart/protected/pages/Fundamentals/Components.page index 32d82e1c..c419a5fa 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Components.page +++ b/demos/quickstart/protected/pages/Fundamentals/Components.page @@ -58,7 +58,7 @@ $component->getFont()->setName( $name ); Component events are special properties that take method names as their values. Attaching (setting) a method to an event will hook up the method to the places at which the event is raised. Therefore, the behavior of a component can be modified in a way that may not be foreseen during the development of the component.

-A component event is defined by the existence of an on-method. For example, in TButton, we have +A component event is defined by the existence of a method whose name starts with the word on. The event name is the method name and is thus case-insensitve. For example, in TButton, we have class TButton extends TWebControl { public function onClick( $param ) { @@ -66,12 +66,12 @@ class TButton extends TWebControl { } } -This defines an event named Click, and a handler can be attached to the event using one of the following ways, +This defines an event named OnClick, and a handler can be attached to the event using one of the following ways, -$button->Click = $callback; -$button->Click->add( $callback ); -$button->Click[] = $callback; -$button->attachEventHandler( 'Click' , $callback ); +$button->OnClick = $callback; +$button->OnClick->add( $callback ); +$button->OnClick[] = $callback; +$button->attachEventHandler( 'OnClick' , $callback ); where $callback refers to a valid PHP callback (e.g. a function name, a class method array($object,'method'), etc.)

diff --git a/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page b/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page index bae7b308..977b2a04 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page +++ b/demos/quickstart/protected/pages/Fundamentals/Samples/Hangman/Home.page @@ -11,7 +11,7 @@ If you make too many mistakes, you lose the game!

- + @@ -21,46 +21,46 @@ If you make too many mistakes, you lose the game!

You have made <%=$this->Page->Misses %> bad guesses out of a maximum of <%= $this->Page->Level %>.

Guess: - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + +

-

+

You Win!

The word was: <%= $this->Page->Word %>.

-

+

You Lose!

The word was: <%= $this->Page->Word %>.

-

+

\ No newline at end of file diff --git a/demos/quickstart/protected/pages/Fundamentals/Samples/HelloWorld/Home.page b/demos/quickstart/protected/pages/Fundamentals/Samples/HelloWorld/Home.page index 8931dad6..60c7c3e2 100644 --- a/demos/quickstart/protected/pages/Fundamentals/Samples/HelloWorld/Home.page +++ b/demos/quickstart/protected/pages/Fundamentals/Samples/HelloWorld/Home.page @@ -1,6 +1,6 @@ <%@ Title="Hello World" %> - + \ No newline at end of file -- cgit v1.2.3