Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Resize of grid column fires the grid.header.click()
Message
 
 
À
27/11/2000 11:15:16
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00445699
Message ID:
00446033
Vues:
15
Ted,

I handled it with this chunk of code in the MouseDown and MouseUp events:
mcArrowName = ""    && name of the arrow used for all headers of the grid
mlAscending = .f.   && flag for sort order
mlColumnMoved = .f. && flag indicating column was moved
mnColumnOrder = 0   && original column order
mlColumnSized = .f. && flag indicating column was resized
mnColumnWidth = 0   && original size of column
mcTag = ""          && name of the index tag


procedure Click()
local loArrow

loArrow = evaluate( this.mcArrowName )

if ( ! empty( this.mcTag ) and ! this.mlColumnMoved and ! this.mlColumnSized )
   * sortable column that was clicked
   this.mlAscending = ! this.mlAscending
   this.parent.parent.Reorder( this.mcTag, this.mlAscending )
   loArrow.mcColumnName = this.parent.Name
endif

loArrow.SetPosition() && update position
endproc

procedure MouseDown
LPARAMETERS nButton, nShift, nXCoord, nYCoord

with this
   * initialize items that will be tested in MouseUp
   .mnColumnOrder = this.parent.ColumnOrder
   .mnColumnWidth = this.parent.Width
endwith
endproc

procedure MouseUp
LPARAMETERS nButton, nShift, nXCoord, nYCoord

with this
   * check to see if this was a resize or move
   .mlColumnMoved = ( this.parent.ColumnOrder != .mnColumnOrder )
   .mlColumnSized = ( this.parent.Width != .mnColumnWidth )
endwith
endproc
>When resizing a column in a cGridList grid with sortable columns, the act of resizing the column with the mouse fires the grid column header's click() method which results in the column being resorted. Does anyone know how to allow resizing the column without firing the header.click()?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform