clea
form1=CREATEOBJECT("form1")
form1.show()
read even
retu
DEFINE CLASS form1 AS form
Top = 0
Left = -1
Height = 650
Width = 1000
DoCreate = .T.
BorderStyle = 3
Caption = "Form1"
MaxButton = .F.
Name = "Form1"
ADD OBJECT container1 AS container WITH ;
Top = 0, ;
Left = 0, ;
Width = 1000, ;
Height = 650, ;
SpecialEffect = 1, ;
BackColor = RGB(255,255,255), ;
Name = "Container1"
ADD OBJECT timer1 AS timer WITH ;
Top = 10, ;
Left = 10, ;
Height = 23, ;
Width = 23, ;
Name = "Timer1"
PROCEDURE Resize
this.container1.Width=this.Width-1
this.container1.Height=this.Height-1
ENDPROC
PROCEDURE container1.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
this.tox=nxcoord
this.toy=nycoord
ENDPROC
PROCEDURE container1.MouseDown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nbutton=1 &&mouse left
WITH this
.draw()
.x=nxcoord
.y=nycoord
.oldx=nxcoord
.oldy=nycoord
endwith
thisform.timer1.Interval=100
ENDIF
ENDPROC
PROCEDURE container1.Init
this.AddProperty("X",0)
this.AddProperty("Y",0)
this.AddProperty("toX",0)
this.AddProperty("toY",0)
this.AddProperty("oldX",0)
this.AddProperty("oldY",0)
STORE 1 TO this.Top,this.left
this.Height=thisform.Height-1
this.Width=thisform.Width-1
ENDPROC
PROCEDURE container1.draw
WITH this
IF .x#.oldx or .y#.oldy
lcrect=bintoc(MIN(.x,.oldx),"4rs")+bintoc(MIN(.y,.oldy),"4rs")+bintoc(MAX(.x,.oldx),"4rs")+bintoc(MAX(.y,.oldy),"4rs")
DrawFocusRect(getdc(thisform.hwnd),lcrect)
endif
ENDWITH
ENDPROC
PROCEDURE container1.MouseUp
LPARAMETERS nButton, nShift, nXCoord, nYCoord
thisform.timer1.Interval=0
ENDPROC
PROCEDURE timer1.Init
DECLARE Integer DrawFocusRect IN WIN32API ;
Integer hdc , ;
String lpRect
DECLARE Integer GetDC IN WIN32API ;
Integer hwnd
DECLARE integer ReleaseDC IN WIN32API integer hwnd,integer hdc
ENDPROC
PROCEDURE timer1.Timer
WITH thisform.container1
IF .tox#.oldx or .toy#.oldy
.draw()
.oldx=.tox
.oldy=.toy
.Draw()
ENDIF
endwith
ENDPROC
PROCEDURE unload
CLEAR EVENTS
ENDPROC
ENDDEFINE
form1=CREATEOBJECT("form1")
form1.show()
read even
retu
DEFINE CLASS form1 AS form
Top = 0
Left = -1
Height = 650
Width = 1000
DoCreate = .T.
BorderStyle = 3
Caption = "Form1"
MaxButton = .F.
Name = "Form1"
ADD OBJECT container1 AS container WITH ;
Top = 0, ;
Left = 0, ;
Width = 1000, ;
Height = 650, ;
SpecialEffect = 1, ;
BackColor = RGB(255,255,255), ;
Name = "Container1"
ADD OBJECT timer1 AS timer WITH ;
Top = 10, ;
Left = 10, ;
Height = 23, ;
Width = 23, ;
Name = "Timer1"
PROCEDURE Resize
this.container1.Width=this.Width-1
this.container1.Height=this.Height-1
ENDPROC
PROCEDURE container1.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
this.tox=nxcoord
this.toy=nycoord
ENDPROC
PROCEDURE container1.MouseDown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nbutton=1 &&mouse left
WITH this
.draw()
.x=nxcoord
.y=nycoord
.oldx=nxcoord
.oldy=nycoord
endwith
thisform.timer1.Interval=100
ENDIF
ENDPROC
PROCEDURE container1.Init
this.AddProperty("X",0)
this.AddProperty("Y",0)
this.AddProperty("toX",0)
this.AddProperty("toY",0)
this.AddProperty("oldX",0)
this.AddProperty("oldY",0)
STORE 1 TO this.Top,this.left
this.Height=thisform.Height-1
this.Width=thisform.Width-1
ENDPROC
PROCEDURE container1.draw
WITH this
IF .x#.oldx or .y#.oldy
lcrect=bintoc(MIN(.x,.oldx),"4rs")+bintoc(MIN(.y,.oldy),"4rs")+bintoc(MAX(.x,.oldx),"4rs")+bintoc(MAX(.y,.oldy),"4rs")
DrawFocusRect(getdc(thisform.hwnd),lcrect)
endif
ENDWITH
ENDPROC
PROCEDURE container1.MouseUp
LPARAMETERS nButton, nShift, nXCoord, nYCoord
thisform.timer1.Interval=0
ENDPROC
PROCEDURE timer1.Init
DECLARE Integer DrawFocusRect IN WIN32API ;
Integer hdc , ;
String lpRect
DECLARE Integer GetDC IN WIN32API ;
Integer hwnd
DECLARE integer ReleaseDC IN WIN32API integer hwnd,integer hdc
ENDPROC
PROCEDURE timer1.Timer
WITH thisform.container1
IF .tox#.oldx or .toy#.oldy
.draw()
.oldx=.tox
.oldy=.toy
.Draw()
ENDIF
endwith
ENDPROC
PROCEDURE unload
CLEAR EVENTS
ENDPROC
ENDDEFINE