BBC BASIC for Windows
« Scrolling »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:27pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Scrolling  (Read 344 times)
Ken Down
Guest
xx Scrolling
« Thread started on: Jun 14th, 2013, 11:16am »

I'm probably teaching my grandmother to suck eggs, but I had a program that scrolled a window and displayed pictures as you scrolled. It was all very slow and eventually I realised that for every click on the scrollbar, the program redrew the pictures twice.

After a lot of mucking about - I guess I'm not one of your top-flight programmers - I finally found the problem.

I had:
DEFPROCscroll(msg%,wp%)
CASEmsg%OF
WHEN277
CASEwp%AND&FFFFOF
WHEN0
WHEN1
ENDCASE
SYS"SetScrollPos",@hwnd%,1,vscroll%,1
PROCupdate
ENDCASE
ENDPROC

What I didn't realise was that you can get the msg% of 277 with values other than the permitted 0,1,2,3,5. In fact, 8 is what I was getting.

So now my routine reads

DEFPROCscroll(msg%,wp%)
CASEmsg%OF
WHEN277
CASEwp%AND&FFFFOF
WHEN0tongueROCupdate
WHEN1tongueROCupdate
ENDCASE
SYS"SetScrollPos",@hwnd%,1,vscroll%,1
ENDCASE
ENDPROC

(There is, of course, more code after the WHEN0 etc, setting vscroll% by a suitable amount.)

I hope this helps others who may be as dense as me.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls