Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing headers
Message
From
03/12/1998 12:51:38
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00163637
Message ID:
00163736
Views:
33
>Michelle,
>
>>Ah, this is the part I was missing. So you can say "as header" if you do it in code. I thought you guys meant I had to make a custom class that was the same as a header. This makes more sense. Sometimes I miss the obvious. :)
>>
>>What's all that arrow business about in your code?
>
>It's an indicator arrow like in Outlook Express that shows the current sort direction.

That's a cool idea. Maybe I'll put that in the next version. :)

Thanks,

-Michelle


>
>
**************************************************
>*-- Class:        lblheaderarrow (e:\vfp5app\ccontrol.vcx)
>*-- ParentClass:  clabel (e:\vfp5app\ccontrol.vcx)
>*-- BaseClass:    label
>*
>DEFINE CLASS lblheaderarrow AS clabel
>
>
>	AutoSize = .F.
>	Caption = ""
>	Width = 16
>	*-- mcColumnName - name of the column the arrow is in
>	mccolumnname = ""
>	*-- mcDown - character used to point down
>	mcdown = ""
>	*-- mcUp - character used to point up
>	mcup = ""
>	*-- mcGridName - name of the grid this arrow is attached to
>	mcgridname = ""
>	Name = "lblheaderarrow"
>
>
>	*-- SetPosition - set the arrow position
>	PROCEDURE setposition
>		local loGrid, loCol
>
>		loGrid = eval( this.mcGridName )
>		for each loCol in loGrid.Columns
>		   if ( loCol.Name == this.mcColumnName )
>		      with this
>		         .Caption = iif( loCol.Header1.mlAscending, .mcUp, .mcDown )
>		         .Top = objtoclient( loCol.Header1, 1 ) + 2
>		         .Left = objtoclient( loCol.Header1, 2 ) + objtoclient( loCol.Header1, 3 ) - .Width
>		         .Visible = .t.
>		      endwith
>		      exit
>		   endif
>		endfor
>	ENDPROC
>
>
>	PROCEDURE Init
>		lparameter pcGridName
>
>		local laFonts[1]
>
>		afont( laFonts )
>		with this
>		   if ( ascan( laFonts, "Wingdings 3" ) > 0 )
>		      .FontName = "wingdings 3"
>		      .mcUp = 'p'
>		      .mcDown = 'q'
>		   else
>		      .FontName = "wingdings"
>		      .mcUp = chr(225)
>		      .mcDown = chr(226)
>		   endif
>		   .FontBold = .t.
>		   .ForeColor = ColorFactor( this.parent.BackColor, 0.5 )
>		   .Caption = ""
>		   .mcGridName = pcGridName
>		   .MousePointer = 99
>		   .MouseIcon = "down.cur"
>		endwith
>	ENDPROC
>
>
>	PROCEDURE Click
>		* pass the click onto the Header
>
>		local loCol
>
>		loCol = eval( this.mcGridName + "." + this.mcColumnName )
>		loCol.Click()
>	ENDPROC
>
>
>ENDDEFINE
>*
>*-- EndDefine: lblheaderarrow
>**************************************************
>
Previous
Reply
Map
View

Click here to load this message in the networking platform