KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Handling objects help tips with one method
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: June 23, 2006

This tech tip shows how to dynamically update a help tip of an object with only one method and one help tip. This is very useful if there is a large number of 4D objects on the form.

First, create a help tip in the 4D tool box named ObjectHelpTip and give it a value of "<HelpTipText>". This will show the value of HelpTipText variable as the object help tip.

Second, select all objects that should show a help tip and assign the ObjectHelpTip help tip to the objects you selected. Insert the following method in every selected object to update help tip value dynamically:

Case of

     : (Form event=On Mouse Enter )

         ShowHelpTip (Self)
End case

Finally, create the method named ShowHelpTip that will dynamically assign the help tips. This method will require "tool_Getpointer" method found in tech tip 29679. Arrays HelpTipObjectName and HelpTipValue hold object name and help tip that should be displayed, respectively.

` Method: ShowHelpTip



     C_POINTER($1;$selectedObject)

     C_TEXT($variableName)

     C_LONGINT($arrayPos;$selectedObjectNum)



     $selectedObject:=$1



    
     ` Get the name of the object



     $variableName:=(tool_Getpointer ($selectedObject))



          ` Find the object in the HelpTipObjectName array



     $arrayPos:=Find in array(HelpTipObjectName;$variableName)



          ` If object if found, assign help tip value to HelpTipValue variable



     If ($arrayPos#-1)



          $selectedObjectNum:=$arrayPos



          HelpTipText:=HelpTipValue{$selectedObjectNum}



End if