Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determine if resizing grid column
Message
 
 
To
19/05/2002 21:39:15
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00658746
Message ID:
00658770
Views:
21
This message has been marked as the solution to the initial question of the thread.
Craig,

Basically in MouseDown() and MouseUp() you have to account for and detect column size and position changes and conditionally run the code in Clisk(). I have this code in my custom header subclass to deal with the issue:
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
>I have some code in the click() event of a grid column to sort ascending or descending when they click the header. This code is also firing when the user resizes the grid column (width). How do I prevent this from happening?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform