Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditional changing of Mouse Pointer on a Grid
Message
From
26/09/2005 16:41:47
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01046136
Message ID:
01053222
Views:
9
>>>time to move the replies to the top.
>>>
>>>I ran both versions you offered, yet while the grids work/populate, the mousepointer remained a I-bar. I checked the presence of the icons (even the CTRFRAN one), so that's not the problem. Is there any other property settings that I'm missing?
>>>Allen
>>>
>>
>>If you run it into VFP8 you are right,
>>before VFP9 existe a bug and grid.mousePointer is not used.
>
>Ok, then that's it. I'm on VFP8. (did it work on VFP7?) Is there a workaround?

Not.
Only in VFP9.
Before, VFP repaint the Mouse image with a fixed I-bar.
You can look this here:
- move over the cells, you see USA/ITALY flashed
- go over the RecordMark and move up/down
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form
	Height = 400
	
	ADD OBJECT grid1 AS myGrid WITH ;
		Height = 350, ;
		Left = 34, ;
		Top = 5, ;
		Width = 320 ;
		,MousePointer = 99	&& WITH 99 customMousePointer is called, by default it return 99

		
	PROCEDURE Load
		CREATE CURSOR XX1CB (F1 I,F2 c(40))
		FOR N=100  TO 0 STEP -2
			INSERT INTO (ALIAS()) (F1,F2) VALUES(m.n,'Item n°'+sTR(m.n))
		ENDFOR
		LOCATE
	ENDPROC

	PROCEDURE unLoad
		CLOSE TABLES all
		
	PROCEDURE Grid1.customMousePointer(nWhere,nRelRow,nRelCol)
		this.MouseIcon = HOME(4)+IIF(m.nRelRow%2=0,"Icons\Flags\CTRUSA.ICO","Icons\Flags\CTRITALY.ICO")
		RETURN 99
	
ENDDEFINE


DEFINE CLASS myGrid AS Grid
#IF VERSION(5)<900
*	THIS IS INCOMPLETE
	HIDDEN PROCEDURE Visible_Access
		IF NOT m.this.Visible
			RETURN .f.
		ENDIF
		IF m.This.MousePointer = 99 && for a custom put a dynamic level		
			LOCAL nWhere,nRelRow,nRelCol
			=grid::GridHitTest(MCOL(m.thisform.name,3),MROW(m.thisform.name,3);
					,@m.nWhere,@m.nRelRow,@m.nRelCol)
			STORE this.customMousePointer(m.nWhere,m.nRelRow,m.nRelCol) TO nWhere
			IF m.nWhere=99
				thisform.MouseIcon	= m.this.MouseIcon
			ENDIF
			thisform.MousePointer	= m.nWhere
		ELSE
			thisform.MousePointer = m.This.MousePointer
		ENDIF
	ENDPROC
	
#ELSE
	HIDDEN PROCEDURE MousePointer_Access
		DEBUGOUT SECONDS(),"mousepointer"
		IF m.This.MousePointer = 99 && for a custom put a dynamic level
			LOCAL nWhere,nRelRow,nRelCol
			=grid::GridHitTest(MCOL(0,3),MROW(0,3),@m.nWhere,@m.nRelRow,@m.nRelCol)
			RETURN this.customMousePointer(m.nWhere,m.nRelRow,m.nRelCol)
		ENDIF
		RETURN m.This.MousePointer
	ENDPROC
	
	PROCEDURE customMousePointer(nWhere,nRelRow,nRelCol)
		RETURN 99
#ENDIF

ENDDEFINE
Previous
Reply
Map
View

Click here to load this message in the networking platform