Canvas: How to retrieve scroll bar thumb positions when in virtual mode?
So I have a very large canvas, which I'm using in virtual mode. This allows me to draw very long graphs, and have the user scroll left and right using the thumb of the virtual canvas horizontal scroll bar.
But I need to be able to retrieve the value of that scroll thumb - i.e., I need to know to which point in the graph they've scrolled.
How can I read that value out?
*Brian
Here is the code that demonstrates what I'm talking about :
Code:
Uses "UI"
Begin ControlID
%ID_Canvas
End ControlID
Function TBMain() As Long
Local hDlg As DWord '---Used to store window handle of main dialog
hDlg = Dialog_New Pixels, 0, "ABC ", -1, -1, 1200, 775,
%WS_DLGFRAME |
%DS_CENTER |
%WS_CAPTION |
%WS_SYSMENU |
%WS_OVERLAPPEDWINDOW
Dialog Show Modal hDlg, Call cbDialog
End Function
CallBack Function cbDialog() As Long
Select Case CBMSG
Case %WM_INITDIALOG
Control Add Canvas, CBHNDL, %ID_Canvas, "", 200, 10,1000, 400, %WS_BORDER | %WS_CHILD | %WS_VISIBLE
Canvas_Attach(CBHNDL, %ID_Canvas, %FALSE)
Canvas_SetVirtual(100000, 380)
Canvas_SetView(0,0)
Canvas_Width(2)
End Select
End Function