Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid and Double-Click Event
Message
De
19/06/2001 12:50:11
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/06/2001 12:41:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00520905
Message ID:
00521130
Vues:
24
Right Lutz,
I'd also do it programmatically - multiselectgrid class as an example does that :) Here I skin my cat programmatically adding and sizing a container class instead.
Cetin

>>Grid dblclick would work if dblclicked in a dead area (gridlines, after recs etc). Other times dblclick of controls would work. It's cumbersome to add functioanlity to all controls to call grid's click. Instead you can control it from one place :) Place a transparent container in front of grid. In dblclick put your code but be sure to test where you're with gridhittest and activate clicked row first to get correct PK. Instead of activating you could temporarily set visibility of container to .f. and do a click at the same location.
>>Cetin
>
>Cetin,
>you are right, this is a lot of work to funnel all importend events to the Grid.
>
>But to add extra controls to my form means I need extra work to resize and so one.
>
>May forms regularly have more than one grid, I would die one each way.
>
>But what about code? We do programming to make customers life easier.
>Why not ours?
>
>I never do this manually.
>There are powerfull tools like subclassing, ASSIGN methods and so one.
>I have specialized control classes and a specialized grid class.
>All to do is some code in thoses classes to clean up the original textbox and add the new control.
>
>LOCAL;
> lnLoop,;
> loColumn,;
> lcCurrentControl
>
>IF NOT UPPER(THIS.CLASSLIBRARY) $ UPPER(SET("CLASSLIB")) THEN
>*Pretend the new grid and control is placed in the same classlib
> SET CLASSLIB TO (THIS.CLASSLIBRARY) ADDITIVE
>ENDIF
>
>...
>FOR lnLoop = 1 TO THIS.COLUMCOUNT
> loColumn         = THIS.COLUMNS(lnLoop)
> lcCurrentControl = loColumn.CURRENTCONTROL
> loColumn.REMOVEOBJECT(lcCurrentControl )
> loColumn.ADDOBJECT(lcCurrentControl,THIS.gcNewControl)
>ENDFOR lnLoop
>...
>
>Do this within INIT() and within a ASSIGN Method for COLUMNCOUNT().
>Transporting design time settings for FORMAT etc. may be done in this loop. (Not may way, I want programmatic control)
>
>And if you do the events like:
>
>
>PROCEDURE MyTextBox.CLICK()
> THIS.PARENT.PARENT.CLICK(THIS.PARENT)
>ENDPROC &&MyTextBox.CLICK()
>*also for other relevant Events
>...
>
>PROCEDURE MyGrid.CLICK()
> PARAMETERS;
>  toColumn
>
>*Event calls Method
> IF VARTYPE(toColumn)='O' THEN
>  THIS.Clicked_Column(toColumn)
> ELSE
>  THIS.Clicked_Grid()
> ENDIF VARTYPE(toColumn)='O'
>ENDPROC MyGrid.CLICK()
>
>PROCEDURE MyGrid.Clicked_Column()
> PARAMETERS;
>  toColumn
>ENDPROC MyGrid.CLICK()
>
>PROCEDURE MyGrid.Clicked_Grid()
>ENDPROC MyGrid.CLICK()
>
>*also for other relevant Events
>
>
>it is just on your fingertips to respond to the column an event fired and a click on the grid as well.
>.
>Now you are completely free to add the grid to your form.
>
>Lutz
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform