Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid question
Message
De
27/05/2003 10:22:43
Walter Meester
HoogkarspelPays-Bas
 
 
À
27/05/2003 09:09:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00792933
Message ID:
00793086
Vues:
32
Hi Jim,

Long time, no speak... ;-)

I agree that BINDEVENT() is a function that easely gets missused by less experienced developers. I've not used either BINDEVENT() and RAISEEVENT() yet and I don't think I will need it anytime soon except for a bugfix when scrolling from left to right in a grid with invisible columns see Re: BUG#6: Scrollbug with Invisible columns in grid Thread #754850 Message #755099. Usually I find that whenever I need such function, something is wrong in the design.

OTOH, such functions are usefull to overcome some VFP limitations in VFP controls just like grids. However, I'd like to be damn sure that that the solution itself is encapsulated in a single class. Using such functions to BINDEVENT or RAISEEVENT accross (loosely related) objects is indeed asking for spagethy nightmares.


Walter,




>>In order to use grid's DblClick event you would have to put code in Column's text DblClick event like this.parent.parent.DblClick(this)
>>
>>Actually, this is not true in VFP 8.0. You can use code like this in the grid's Init to let the text boxes use the grid's dblClick()
>>
>>
>>*!* now make sure that the dblclick method of all the contained text boxes
>>*!* delegate to the grid's dblclick()
>>FOR EACH loColumn IN This.Columns
>>  FOR EACH loControl IN loColumn.Controls
>>    IF LOWER( loControl.BaseClass ) = 'textbox'
>>      BINDEVENT( loControl, 'dblClick', This, 'dblClick' )
>>    ENDIF
>>  ENDFOR
>>ENDFOR
>>
>
>That's really neat, Marcia, but I'm still scared by the idea of having BINDEVENT() coded all over the place in an application.
>To me this is worse that the old "GO TO/Branch unconditional" in code of old (non-Xbase) and as bad (if not worse) than spaghetti code.
>I've employed RAISEEVENT() a few times but have yet to use BINDEVENT() (until I find a satisfactory solution to this).
>
>cheers
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform