KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: New events "On Mouse Enter" and "On Mouse Leave"
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: June 3, 2005

4D 2004 added several form event to give you a better control of an objects in the form. Two of them are "On Mouse Enter" and "On Mouse Leave". The event "On Mouse Enter " will be trigged when the cursor is entered inside the object boundry. The event "On Mouse Leave" behaves in the opposite. When the cursor moves from inside to the outter bound of an object, the event will be triggered.

With this new behavior, you can easily implement a procedure that respond to a particular event. The following is a method that change the font style of a text object to bold when the mouse cursor has enter the object boundry and plain when the cursor leave the object.


` Project Method: SwitchTextStyle
C_POINTER($1)
Case of
   : (Form event=On Mouse Enter )
      FONT STYLE($1->;Bold )

   : (Form event=On Mouse Leave )
      FONT STYLE($1->;Plain )
End case