>PUBLIC oform1 >oform1=NEWOBJECT("form1") >oform1.Show >RETURN > > > ************************************************** >*-- Form: form1 (x:\foxv\hugo\prog\testcrosshairs.scx) >*-- ParentClass: form >*-- BaseClass: form >*-- Time Stamp: 03/10/06 04:06:01 PM >* >DEFINE CLASS form1 AS form > > > Top = 0 > Left = 0 > Height = 395 > Width = 396 > DoCreate = .T. > Caption = "Form1" > *-- XML Metadata for customizable properties > _memberdata = "" > Name = "Form1" > > > ADD OBJECT crosshaircontainer1 AS crosshaircontainer WITH ; > Top = 25, ; > Left = 63, ; > Width = 282, ; > Height = 172, ; > Name = "Crosshaircontainer1", ; > vLine.Name = "vLine", ; > hLine.Name = "hLine" > > > ADD OBJECT image1 AS image WITH ; > Anchor = 15, ; > Picture = "c:\program files\microsoft visual foxpro 9\graphics\metafiles\business\laptop1.wmf", ; > Stretch = 2, ; > Height = 264, ; > Left = 20, ; > Top = 45, ; > Width = 334, ; > Name = "Image1" > > PROCEDURE Init > this.crosshaircontainer1.Top = thisform.image1.Top > this.crosshaircontainer1.Left = thisform.image1.Left > this.crosshaircontainer1.Width = thisform.image1.Width > this.crosshaircontainer1.Height = thisform.image1.Height > this.crosshaircontainer1.Anchor = thisform.Image1.Anchor > this.crosshaircontainer1.ZOrder(0) > ENDPROC > > >ENDDEFINE >* >*-- EndDefine: form1 >************************************************** > >************************************************** >*-- Class: crosshaircontainer (x:\foxv\hugo\prog\test.vcx) >*-- ParentClass: container >*-- BaseClass: container >*-- Time Stamp: 03/10/06 04:06:14 PM >* >DEFINE CLASS crosshaircontainer AS container > > > Anchor = 0 > Width = 200 > Height = 200 > BackStyle = 0 > BorderWidth = 0 > MousePointer = 2 > *-- XML Metadata for customizable properties > _memberdata = "" > Name = "crosshaircontainer" > > > ADD OBJECT vline AS line WITH ; > DrawMode = 5, ; > Enabled = .F., ; > Height = 100, ; > Left = 98, ; > MousePointer = 99, ; > Top = 3, ; > Visible = .F., ; > Width = 0, ; > BorderColor = RGB(128,128,128), ; > Name = "vLine" > > > ADD OBJECT hline AS line WITH ; > DrawMode = 5, ; > Enabled = .F., ; > Height = 0, ; > Left = 30, ; > MousePointer = 99, ; > Top = 43, ; > Visible = .F., ; > Width = 127, ; > BorderColor = RGB(128,128,128), ; > Name = "hLine" > > > PROCEDURE MouseLeave > LPARAMETERS nButton, nShift, nXCoord, nYCoord > > with this > .vLine.Visible = .F. > .hLine.Visible = .F. > endwith > > Dodefault(nButton, nShift, nXCoord, nYCoord) > ENDPROC > > > PROCEDURE MouseEnter > LPARAMETERS nButton, nShift, nXCoord, nYCoord > > with this > with .vLine > .Height = this.Height > .Width = 0 > .Left = nXCoord - Objtoclient(this, 2) > .Visible = .T. > endwith > with .hLine > .Left = 0 > .Width = this.Width > .Top = nYCoord - Objtoclient(this, 1) > .Visible = .T. > endwith > endwith > > Dodefault(nButton, nShift, nXCoord, nYCoord) > ENDPROC > > > PROCEDURE MouseMove > LPARAMETERS nButton, nShift, nXCoord, nYCoord > > with this > .vLine.Left = nXCoord - Objtoclient(this, 2) > .hLine.Top = nYCoord - Objtoclient(this, 1) > endwith > > Dodefault(nButton, nShift, nXCoord, nYCoord) > ENDPROC > > >ENDDEFINE >* >*-- EndDefine: crosshaircontainer >************************************************** >