>>* add this into the grid class >>PROC Mousepointer_Access >> return nExpression >>>
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, ; Name = "Grid1",; MousePointer = 99 && with 99 customMousePointer is called, && by default it is invariant and return 99 PROCEDURE Load CREATE CURSOR XX1CB (F1 I,F2 V(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 Grid1.customMousePointer(nWhere,nRelRow,nRelCol) RETURN IIF(m.nWhere=3,m.nRelRow%17,0) && put a mousepinter rule here ENDDEFINE DEFINE CLASS myGrid AS Grid HIDDEN PROCEDURE MousePointer_Access IF m.This.MousePointer = 99 && for a custom put a dynamic level LOCAL nWhere,nRelRow,nRelCol #IF VERSION(5)<900 =grid::GridHitTest(MCOL(m.thisform.name,3); ,MROW(m.thisform.name,3); ,@m.nWhere,@m.nRelRow) #ELSE =grid::GridHitTest(MCOL(0,3),MROW(0,3),@m.nWhere,@m.nRelRow,@m.nRelCol) #ENDIF RETURN this.customMousePointer(m.nWhere,m.nRelRow,m.nRelCol) ENDIF RETURN m.This.MousePointer ENDPROC PROCEDURE customMousePointer(nWhere,nRelRow,nRelCol) RETURN 99 ENDDEFINEThis is a sample with MouseIcon dynamic:
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 V(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 Grid1.customMousePointer(nWhere,nRelRow,nRelCol) * change the pointer this.MouseIcon = HOME(4); +IIF(m.nRelRow%2=0,"Icons\Flags\CTRFRAN.ICO","Icons\Flags\CTRITALY.ICO") RETURN 99 ENDDEFINE DEFINE CLASS myGrid AS Grid HIDDEN PROCEDURE MousePointer_Access IF m.This.MousePointer = 99 && for a custom put a dynamic level LOCAL nWhere,nRelRow,nRelCol #IF VERSION(5)<900 =grid::GridHitTest(MCOL(m.thisform.name,3),MROW(m.thisform.name,3); ,@m.nWhere,@m.nRelRow,@m.nRelCol) #ELSE =grid::GridHitTest(MCOL(0,3); ,MROW(0,3),@m.nWhere,@m.nRelRow,@m.nRelCol) #ENDIF RETURN this.customMousePointer(m.nWhere,m.nRelRow,m.nRelCol) ENDIF RETURN m.This.MousePointer ENDPROC PROCEDURE customMousePointer(nWhere,nRelRow,nRelCol) RETURN 99 ENDDEFINE