Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Locking current grid row
Message
De
04/11/1998 03:08:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
02/11/1998 13:10:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00152154
Message ID:
00154260
Vues:
22
>>>>>>>I can dynamically disable all rows in a grid leaving only the
>>>>>>>current row enabled (after an append). However the user can still
>>>>>>>move the record pointer to another row by clicking. How can I
>>>>>>>prevent this ?
>>>>>>>
>>>>>>>Regards Ian
>
>Cetin,
>
>Thanks for the code. I've managed to get the current grid row to lock.
>However, i've needed to alter the .top/.bottom settings of the grid,
>which i don't understand (see code). Any suggestions on what i'm missing ...?
>
>LPARAMETERS nColIndex
>
>LOCAL llChangingRow, lnRowPos, lnColPos
>
>llChangingRow = .F.
>STORE 0 TO lnRowPos, lnColPos
>
>IF Thisform.Navigate.EditMode
> *< Add/edit mode ... >*
> IF MDown()
> lnBottom = This.Top+This.HeaderHeight+(This.RelativeRow*This.RowHeight)
> lnTop = lnBottom - This.RowHeight
>
> *< ???? Top=7 HeaderHeight=23 RowHeight=23 >*
> lnBottom = lnBottom + 28
> lnTop = lnTop + 34
>
> lnRowPos = MROW(WONTOP(),3)
> lnColPos = MCOL(WONTOP(),3)
>
> llChangingRow = !BETWEEN(lnRowPos,lnTop,lnBottom) AND ;
> BETWEEN(lnColPos,This.Left,This.Left+This.Width)
>
> *Messagebox("Row: "+str(lnRowPos)+" Bottom: "+str(lnBottom)+" Top: "+str(lnTop))
> ELSE
> llChangingRow = INLIST(LASTKEY(),24,5,28,3,145,148)
> ENDIF && MDown
>
> IF llChangingRow
> NODEFAULT
> ELSE
> *< Do nothing >*
> ENDIF && llChangingRow
>ELSE
> *< Do nothing >*
>ENDIF && Thisform.Navigate.EditMode
>
>Regards Ian
Ian,
Couldn't clearly understand what you mean change top/bottom settings of grid and the need for +28, +34. However while trying what you mean I realized that I ignored gridlinewidth (there is a little zone -one pixel or two- where it seems that you're not changing row but in fact changing) and updated the code as :
lnTop	  = .top+.headerheight + 2 + ;
            (.relativerow - 1) * .rowheight + int(.gridlinewidth/2) 
lnBottom  = .top+.headerheight + 1 + ;
            .relativerow * .rowheight - int(.gridlinewidth/2)
By saying change top/bottom do you mean ie: current control is something like combo with sparse=.t. and you want the rowheight be taller when column getsfocus ?
Cetin
Ç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