************************************************** *-- Class: wwsplitter (c:\wwapps\wwhelp\wwhelp_ui.vcx) *-- ParentClass: shape *-- BaseClass: shape *-- Time Stamp: 04/17/15 10:21:02 AM * DEFINE CLASS wwsplitter AS shape Height = 355 Width = 8 MousePointer = 9 BackColor = RGB(192,192,192) FillColor = RGB(0,0,0) BorderColor = RGB(192,192,192) *-- Set when the splitter is moved. Gets set to SECONDS(). When this value is 0 the splitter is not moving nsplittermove = 0 lverticalsplitter = .F. *-- SECONDS() value saved when display was last updated. Uses the nDisplayRefresh property to determine how often to refresh. nlastdisplayrefresh = 0 *-- Holds the SECONDS() value of the last refresh. ndisplayrefresh = 0.5 Name = "wwsplitter" *-- This method is called when the mouse is dragged, but only in timed intervals based on nRefreshDisplay. PROCEDURE onrefreshdisplay LPARAMETERS nButton,nShift, nXCoord, nYCoord ENDPROC PROCEDURE MouseMove LPARAMETERS nButton, nShift, nXCoord, nYCoord IF nButton=1 && and THISFORM.lSplitterMove < Seconds() - .15 IF THIS.nSplitterMove = 0 THIS.ZOrder(0) THIS.OnStartMove() ENDIF THIS.BackColor=RGB(0,0,0) IF !THIS.lVerticalSplitter THIS.Left = nXCoord ELSE THIS.Top = nYCoord ENDIF lnSeconds = SECONDS() *** Now handle the refresh IF lnSeconds > THIS.nLastDisplayRefresh + THIS.nDisplayRefresh THIS.OnRefreshDisplay(nButton,nShift, nXCoord, nYCoord) THIS.nLastDisplayRefresh = lnSeconds ENDIF THIS.nSplitterMove = lnSeconds ENDIF ENDPROC PROCEDURE MouseUp LPARAMETERS nButton, nShift, nXCoord, nYCoord IF THIS.nSplitterMove # 0.00 THIS.BackColor=THISFORM.BackColor THIS.nSplittermove=0.00 THIS.OnRefreshDisplay(nButton,nShift, nXCoord, nYCoord) THIS.OnStopMove() ENDIF ENDPROC *-- Fires when the splitter was moved. This event fires only when the move operation completes PROCEDURE onsplittermoved ENDPROC PROCEDURE onstartmove ENDPROC PROCEDURE onstopmove ENDPROC ENDDEFINE * *-- EndDefine: wwsplitter **************************************************What I do is hide the two panes while the splitter is moving (you can show them but it can be choppy)
THISFORM.oViewer.visible = .F. THISFORM.oTree.Visible = .F.When done make them visible again AND refresh the page in OnStopMove:
THISFORM.Resize() THISFORM.oTree.visible = .T. THISFORM.oViewer.Visible = .T.You can basically capture the end move operation. The form Refresh then resizes the panes:
THIS.oSplitter.Height = THIS.Height - THIS.oStatus.Height THIS.oTree.Width = THIS.oSplitter.left + 1 THIS.oviewer.Left = THIS.oSplitter.Left + THIS.oSplitter.Width - 1 THIS.oViewer.width = THIS.width - THIS.oViewer.Left + 2 THIS.oViewer.height = THIS.oSplitter.height -THIS.oViewer.Top THIS.oTree.height = THIS.oSplitter.height - THIS.oTree.top - 1This is a super easy implementation and if you really wanted to you could add references to the two sections to resize and have the splitter do the resizing. For me this was a one off thing so I do the resizing as part of my form render code which is easy enough.