Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
o = createobject("MyForm")
o.show()
read events
* Main form
define class MyForm as form
docreate = .t.
autocenter = .t.
caption = "Mousepointer in grid controls example"
datasession = 2
nOriginalMousePointer = this.mousepointer
add object grdTest as clsGrid with ;
width = this.width
add object text1 as textbox with ;
top = this.grdTest.top + this.grdTest.height, ;
width = this.width
procedure load
create cursor temp (fld1 c(10), fld2 n(10))
for i = 1 to 100
insert into temp (fld1, fld2) values ("Field"+trans(i),i)
next
go top
endproc
procedure destroy
clear events
endproc
* Reset mouse pointer
procedure mousemove
lparameters nButton, nShift, nXCoord, nYCoord
this.mousepointer = this.nOriginalMousePointer
endproc
* Just to show mouse position
procedure GrdNotify
lparam cObjName, nXCoord, nYCoord
this.text1.value = cObjName+" X:="+trans(nXCoord)+", Y:="+trans(nYCoord)
endproc
enddefine
* Custom grid class
define class clsGrid as grid
deletemark = .f.
add object column1 as clsColumn
add object column2 as column
* Show mouse position for illustrative purposes
procedure mousemove
lparameters nButton, nShift, nXCoord, nYCoord
thisform.GrdNotify(this.name,nXCoord, nYCoord)
endproc
enddefine
* Custom column class
define class clsColumn as column
add object Text1 as clsText
* This column sets the form's mouse pointer
* to simulate a desired mousepointer over a
* control even though the control is not selected
procedure mousemove
lparameters nButton, nShift, nXCoord, nYCoord
thisform.mousepointer = 6
thisform.GrdNotify(this.name,nXCoord, nYCoord)
endproc
enddefine
* Custom texbox class
define class clsText as textbox
procedure init
this.width = this.parent.width
endproc
* MousePointer could be set during class definition
* or at any other time
procedure mousemove
lparameters nButton, nShift, nXCoord, nYCoord
this.mousepointer = 6
endproc
enddefine