Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid and RowHeight
Message
De
10/09/2002 07:08:58
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00698657
Message ID:
00698685
Vues:
14
Vlad,

You are right in that the GridHitTest is not really needed in these circumstances. It's just that this framework gives more control (and leaves room for expansion) as to the where of the mouse event. It allows to use different popups depending on where the mouse is + mouse button used

eg :
I use the box in upper left corner to show a popup which allows the users to hide/show and reorder the columns of the grid. The recordmarker popup is used to do things related to that specific record, etc



>Hi!
>
>I think it is not needed to use GridHitTest(). Just store original RowHeight in MouseDown in the property, then check if RowHeight is changed in the Moouse Up. All the rest is extra.
>
>
>&&Grid.MouseDown
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>this.RowHeightOld = this.RowHeight
>
>
>
>&& grid.MouseUp
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>if( this.RowHeightOld <> this.RowHeight )
>       && <b> the row height has changed</b>
>endif
>
>
>Also, if your grid is not a class, you can add custom property (RowHeightOld) to it in run-time by using AddProperty method in the Init event.
>
>
>>>Hi
>>>
>>>What events fire when user change RowHeigth , in grid ?
>>>
>>>I use VFP 6 .
>>>
>>>Thanks
>>
>>Pedro,
>>
>>As far as I know you will have to use the mousedown() and MouseUp() events and check whether the rowheight has changed in between
>>
>>I have not tested this. Just took some of my code. With this scheme you can fine-tune the mouse clicks
>>Add two properties to your grid class: MouseDownGridHitTest and RowHeightOld
>>
>>&&Grid.MouseDown
>>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>>
>>local xx
>>=this.GridHitTest(nXCoord, nYCoord, @xx)
>>this.MouseDownGridHitTest = xx
>>
>>do case
>>case nShift == 0
>>	do case
>>	case nButton == BUTTON_LEFT
>>		do case
>>		case xx = 5	&& Splitbar
>>		
>>		case xx = 11 && box in upper left corner
>>						
>>		case xx = 12 && record marker
>>		
>>		case xx = 13 && Column header sizing area
>>		
>>		case xx = 14 && Row sizing area
>>
>>                     this.RowHeightOld = this.RowHeight
>>		
>>		case xx = 16 && Horizontal scrollbar
>>
>>		case xx = 17 && Vertical scrollbar
>>			
>>		endcase
>>		
>>	case nButton == BUTTON_MIDDLE
>>
>>	case nButton == BUTTON_RIGHT
>>
>>        endcase
>>endcase
>>
>>
>>
>>&& grid.MouseUp
>>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>>
>>if( empty(this.MouseDownGridHitTest) )	&& did not pass MouseDown
>>	this.MouseDownGridHitTest = 0 && in case == FALSE
>>endif
>>do case
>>case nShift == 0
>>	do case
>>	case nButton == BUTTON_LEFT
>>		do case
>>		case this.MouseDownGridHitTest = 5	&& Splitbar
>>			
>>		case this.MouseDownGridHitTest = 11 && box in upper left corner
>>		
>>		case this.MouseDownGridHitTest = 12 && record marker
>>			
>>		case this.MouseDownGridHitTest = 13 && Column header sizing area
>>			
>>		case this.MouseDownGridHitTest = 14 && Row sizing area
>>			if( this.RowHeightOld <> this.RowHeight )
>>                             && <b> the row height has changed</b>
>>                        endif
>>		case this.MouseDownGridHitTest = 16 && Horizontal scrollbar
>>		
>>		case this.MouseDownGridHitTest = 17 && Vertical scrollbar
>>			
>>		endcase
>>	
>>	case nButton == BUTTON_MIDDLE
>>
>>	case nButton == BUTTON_RIGHT
>>
>>        endcase
>>endcase
>>
Gregory
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform