April 30, 2024, 01:05:52 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Setting the scroll range on a window.

Started by TexasPete, July 22, 2009, 05:23:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TexasPete

I have found the following command.
SETSCROLLRANGE win2,1, 1250       +++++++          " I know this line is not right."
It seems to want a control id in addtion.
This confuses me a little because I added the scroll bars to the second window, not a control .

Should I be using a combobox or other control to print graphics to . Or Can I do this?
When I added the scroll bars tot he window . It did take it. I just don't know how to set the scroll range for the window. Below is what I found.

SETSCROLLRANGE window | dialog, ID, min, max

SETSCROLLRANGE Sets the minimum and maximum range of a scrollbar control to min and max. All values returned by the scrollbar will be between min and max.  If ID = -1 then sets the range of the windows horizontal scrollbar. If ID = -2 then sets the range of the windows vertical scrollbar. ID must be a scrollbar control.

Thanks
Texas Pete



LarryMc

where did you find:
SETSCROLLRANGE win2,1, 1250       +++++++     
Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

ZeroDog

SETSCROLLRANGE win2,   -1,   1,1250

would set the scroll range of the horizontal scrollbar of win2 (which is the -1 ID) as 1 to 1250.

SETSCROLLRANGE win2,   -2,   1,1250

would set the scroll range of the vertical scrollbar of win2 (which is the -2 ID) as 1 to 1250.

You use the -1 or -2 ID when the scrollbars are created with the window instead of creating them with the control function.

You will have to respond to the scrollbar messages in your message handler routine as well.  Something like this:


SUB win2proc
SELECT @CLASS
CASE @IDVSCROLL : ' Scrollbar handler
SELECT @CODE
CASE @SBLINEUP
SETSCROLLPOS win2, 1, (GETSCROLLPOS(win2, 1))-10
CASE @SBLINEDOWN
SETSCROLLPOS win2, 1, (GETSCROLLPOS(win2, 1))+10
CASE @SBPAGEUP
SETSCROLLPOS win2, 1, (GETSCROLLPOS(win2, 1))-50
CASE @SBPAGEDOWN
SETSCROLLPOS win2, 1, (GETSCROLLPOS(win2, 1))+50
CASE @SBTHUMBPOS
SETSCROLLPOS win2, 1, @QUAL
CASE @SBTHUMBTRACK
SETSCROLLPOS win2, 1, @QUAL
ENDSELECT
SetSize win2,15,-GETSCROLLPOS(win2, 1),215,1000
ENDSELECT
RETURN



TexasPete

Larry, Thanks I knew that line was not right. I was just trying to figure out what I was going to use as the id. Thanks to everyone else let me study on this a while. I will get back to you when I can.
Texas Pete