Author |
Topic: Scrolling (Read 1198 times) |
|
nitwit
Guest
|
 |
Scrolling
« Thread started on: May 1st, 2010, 08:03am » |
|
Vertical scrolling is fairly easy. Between the PDF manual page 795 and example VSCROLL its done although I don't know why 'columns' are needed.
Horizontal scrolling is trickier, some hints but my solution is to use VDU30 and reprint to the whole screen taking into account the 'columns'. Is that right? (I don't really want to think about VDU23,7).
Where is this going? Well it doesn't seem to matter whether you have to scroll 500 lines or 5 lines the slider is the same size. I want a bigger slider for short scrolls. How do I do that?
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Scrolling
« Reply #1 on: May 1st, 2010, 9:49pm » |
|
on May 1st, 2010, 08:03am, Guest-nitwit wrote:I want a bigger slider for short scrolls. How do I do that? |
|
You need a 'new style' scroll bar (variable thumb-box size) rather than an 'old style' scroll bar (fixed thumb-box size). Using SetScrollPos results in the old style scroll bar, using SetScrollInfo results in the new style scroll bar.
For an example of using SetScrollInfo see the supplied example program SCROLL.BBC (in the EXAMPLES\GENERAL folder).
Richard.
|
|
Logged
|
|
|
|
nitwit
Guest
|
 |
Re: Scrolling
« Reply #2 on: May 21st, 2010, 6:32pm » |
|
Yes, that gives me the sliders I want BUT there appears to be a conflict with MULTIWIN. Scrolling (main window only) does not work any more when this is added to the program. Advice please.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Scrolling
« Reply #3 on: May 21st, 2010, 9:49pm » |
|
on May 21st, 2010, 6:32pm, Guest-nitwit wrote:Yes, that gives me the sliders I want BUT there appears to be a conflict with MULTIWIN. Scrolling (main window only) does not work any more when this is added to the program. Advice please. |
|
I can't reproduce the effect. I've tried adding a vertical scroll bar to the main window in MULTIDEM.BBC, and the ON MOVE scroll events are received normally.
However, using MULTIWIN undoubtedly makes your life more difficult, because of the way it changes the value of @hwnd% 'on the fly'. Both the supplied scroll bar examples (VSCROLL.BBC and SCROLL.BBC) assume that @hwnd% is constant - as it is in all normal circumstances - so extra care is needed if you try to combine them with MULTIWIN.
If there's any way you could avoid the use of MULTIWIN, e.g. by using a dialogue box instead, it would make the implementation of scroll bars more straightforward (@hwnd% would be constant again).
Richard.
|
|
Logged
|
|
|
|
nitwit
Guest
|
 |
Re: Scrolling
« Reply #4 on: May 24th, 2010, 5:46pm » |
|
VSCROLL works fine with MULTIWIN (even after I adapted it to do horizontal scrolling as well as vertical).
With SCROLL (to add a bit more info.), the sliders are the right size and do move but no scrolling takes place. The problem seems to be the line in MULTIWIN SYS"SetWindowLong"",@hwnd%,-4,M% (near the bottom of DEF_PROCmultwin(Q%). If I REM this, then scrolling works fine BUT printing to the 'other' windows goes wrong.
Any ideas before I revert to VSCROLL?
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Scrolling
« Reply #5 on: May 24th, 2010, 9:56pm » |
|
on May 24th, 2010, 5:46pm, Guest-nitwit wrote:The problem seems to be the line in MULTIWIN SYS"SetWindowLong"",@hwnd%,-4,M% (near the bottom of DEF_PROCmultwin(Q%). If I REM this, then scrolling works fine |
|
You MUST NOT disable that line; it's fundamental to the correct operation of MULTIWIN. Indeed, don't ever mess around with the code in a library unless you understand exactly what it does.
Anyway, your problem is probably related to the fact that MULTIWIN disables the action of the @ox% and @oy% offsets, which SCROLL.BBC relies upon. Although it would be possible to modify MULTIWIN.BBC to enable those offsets, it's not straightforward.
Using MULTIWIN to create additional output windows whilst using the @ox%/@oy% offset facility on the main window is something I never envisaged! I've updated the library documentation to make the limitation clear:
http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#multiwin
You only need to use MULTIWIN if you are outputting standard BBC BASIC text or graphics to the child windows. If not, there are alternative ways to create child windows which won't interfere with the offsets. For example you could create them using WINLIB5, or use a dialogue box.
Of course, even if you decide to base your code on VSCROLL.BBC you can still have 'proportional' scroll bars of the sort that SCROLL.BBC provides. The style of scroll bar is unrelated to the method used for scrolling.
Richard.
|
« Last Edit: May 24th, 2010, 9:59pm by admin » |
Logged
|
|
|
|
|