Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Redirect the method gotfocus of ALL objects in a contain
Message
De
27/07/2009 13:04:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01414786
Message ID:
01414801
Vues:
61
This message has been marked as the solution to the initial question of the thread.
I have a container.
I want to redirect the method gotfocus of ALL objects in a container.


Call the method, passing an object reference to the topmost container.
Suppose the method is called redirectGotFocus. Here is your modified code
(off the top of my head and untested):
LPARAMETERS toObject
LOCAL loControl
*---------------------------------------------------------------------------------
FOR EACH loControl IN toObject.OBJECTS
*--------------------------------------------------------------------------------- 
  IF PEMSTATUS( loControl ,'GotFocus',5)  
    * 0 00 Call delegate code before event code. (Default)  
    * 1 01 Call event code before delegate code.  
    * 2 10 Do not trigger event (call delegate code) when a simple method calloccurs. 
    BINDEVENT( loControl,"GotFocus" , Thisform, "CustomGotFocus" , 0 )  
    IF loControl.Objects.Count > 0
      Thisform.redirectGotFocus( loControl )
    ENDIF
  ENDIF
ENDFOR
The point is that if the objects in your container are also containers, you need to drill down into them too.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform