Presuming you're only drawing this while dragging a marker you would make a panel - attached to the window client area - all your other gadgets are on the window as usual (not the panel).
Then you would handle the drawing of the marker until the mouse was released - thus preventing redrawing of the other gadgets... let me modify the code to show you what I mean....
there... hold the left mouse to drag the marker....
[edit] actually this example doesn't quite work because it doesn't get the input onto the other controls - but you get the idea - in your case it wouldn't be a problem because you are only handling the input to your splitter[/edit]
SuperStrict
Extern "win32"
Function ExtCreatePen:Int(style:Int, width:Int, logbrush:Byte Ptr, stylecount:Int, stylePtr:Byte Ptr)="ExtCreatePen@20"
Function ReleaseDC( hwnd:Int, hdc:Int )
Function GetCurrentObject( hdc:Int, objectType:Int )
Function MoveToEx( hdc:Int, x:Int, y:Int, point:Int )
Function LineTo( hdc:Int, x:Int, y:Int )
Function GetCursorPos( pPoint:Byte Ptr )
Function SetROP2( hdc:Int, mode:Int )
Function GetAsyncKeyState:Short( key:Int )
EndExtern
Global win:TGadget = CreateWindow("LineTest", 0,0, 400,400 )
Global panel:TGadget = CreatePanel( 0,0,400,400, win, PANEL_ACTIVE )
Global button1:TGadget = CreateButton( "Button1", 10,10, 60, 24, win )
Global button2:TGadget = CreateButton( "Button2", 90,10, 60, 24, win )
SetPanelColor panel,100,0,200
SetGadgetLayout panel,1,1,1,1
Type TLogBrush
Field style:Int
Field colour:Int
Field hatch:Int
EndType
Global logBrush:TLogBrush = New TLogBrush
logBrush.style = 2 'BS_HATCHED
logBrush.colour = $ffffffff
Type TPoint
Field x:Int
Field y:Int
EndType
Global cursorpos:TPoint = New TPoint
Const VK_LBUTTON:Int = 1
While WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
Case EVENT_MOUSEDOWN
DrawCursor()
Case EVENT_MOUSEMOVE
EndSelect
Wend
Function DrawCursor()
Local oldX:Int = -1, oldY:Int = -1
Local erase:Int = False
Local pen:Int = ExtCreatePen( $00010000,6,Byte Ptr(logBrush),0,Byte Ptr(0))
Local hwnd:Int = QueryGadget( panel, QUERY_HWND )
Local hdc:Int = GetDC( hwnd )
SelectObject( hdc, pen )
SetROP2( hdc, 7 ) ' R2_XORPEN
Repeat
GetCursorPos( Byte Ptr(cursorpos) )
' Draw over old line (clears it because it was drawn with XOR)
If( oldX<>cursorPos.x And oldY<>cursorPos.y )
If( erase )
MoveToEx( hdc, 0, oldY, 0)
LineTo( hdc, ClientWidth(panel),oldY )
MoveToEx( hdc, oldX, 0, 0)
LineTo( hdc, oldX, ClientHeight(panel) )
EndIf
' Draw new line
oldX = cursorpos.x
oldY = cursorpos.y - 50
MoveToEx( hdc, 0, oldY, 0)
LineTo( hdc, ClientWidth(panel),oldY )
MoveToEx( hdc, oldX, 0, 0)
LineTo( hdc, oldX, ClientHeight(panel) )
erase = True
EndIf
Until Not (GetAsyncKeyState(VK_LBUTTON) & $8000)
If erase
' erase marker
MoveToEx( hdc, 0, oldY, 0)
LineTo( hdc, ClientWidth(panel),oldY )
MoveToEx( hdc, oldX, 0, 0)
LineTo( hdc, oldX, ClientHeight(panel) )
erase = False
EndIf
ReleaseDC( hwnd, hdc )
DeleteObject( pen )
EndFunction