Splitter
It's been a while since I've last posted something in my weblog related to VFP. I have been using this code for a long time in one of my apps and have actually posted it in the forum sometime last year or maybe 2 years ago and just recently. Anyways, for those who might need it here it is. Some amount of work may still be required to polish this.
Public oForm
oForm = Createobject('mySplitter')
oForm.Show
Return
Define Class mySplitter As Form
Top = 0
Left = 0
Height = 371
Width = 373
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
nxtwips = .F.
nytwips = .F.
Add Object edit1 As EditBox With ;
Height = 62, ;
Left = 0, ;
Top = 5, ;
Width = 365, ;
Name = "Edit1"
Add Object edit2 As EditBox With ;
Height = 285, ;
Left = 0, ;
Top = 77, ;
Width = 365, ;
Name = "Edit2"
Add Object shape1 As Shape With ;
Top = 71, ;
Left = 0, ;
Height = 3, ;
Width = 358, ;
MousePointer = 7, ;
SpecialEffect = 0, ;
Name = "Shape1"
Procedure _resize
Lparameters lnYCoord
With This
Wait Window Transform(lnYCoord) Nowait
lnOffset = lnYCoord - .edit1.Height - 8
.edit1.Height = .edit1.Height + lnOffset
.shape1.Top = lnYCoord
.edit2.Top = lnYCoord + 4
.edit2.Height = .Height - (lnYCoord + 8)
Endwith
Endproc
Procedure shape1.Drag
Lparameters nAction
Wait Window Transform(nAction) Nowait
Endproc
Procedure shape1.MouseDown
Lparameters nButton, nShift, nXCoord, nYCoord
lcMsg = 'nButton = ' +Transform(nButton) + Chr(13) +;
'nShift = ' +Transform(nShift) + Chr(13) +;
'nXCoord = ' +Transform(nXCoord) + Chr(13) +;
'nYCoord = ' +Transform(nYCoord)
Wait Window lcMsg Nowait
Endproc
Procedure shape1.MouseMove
Lparameters nButton, nShift, nXCoord, nYCoord
If nButton = 1
Thisform._resize(nYCoord)
Endif
Endproc
Enddefine