Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - YASD - Yet Another Scroll Demo

Author
Message
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Nov 2012 09:24
An updated snippet on something I've probably made countless times. I've seen a few questions about scroll bars over the recent months and have had a personal request for it.

Load a text file into a scrollable window frame. You can use the mouse wheel to scroll or drag the scroll bar. Press 'b' to toggle a line number border (much like the one in the DBP editor).

This will not account for lines of text that go beyond the width of the window. That's a more advanced topic beyond the scope of this demo. If anyone needs an example of that I can post something for that as well.




"You're not going crazy. You're going sane in a crazy world!" ~Tick
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 9th Dec 2012 11:15
This doesn't seem to work. I think I know why but I don't have the time to look into it at the mo, so just thought I'd let you know.
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Dec 2012 17:35
It's working perfectly fine for me. Can you be more specific?

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Sasuke
18
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 11th Dec 2012 20:46
I got it working eventually by making a project folder to put the test.txt file in. For some reason CodeSurge doesn't like the DBP temp folder very much. Well for me anyway
Mr909
11
Years of Service
User Offline
Joined: 2nd Jun 2012
Location:
Posted: 26th Dec 2012 18:39
Also, Phaelax, don't know if I told you yet, you solved the problem with scrolling manually with less nothing to scroll, but your solution didn't account for your mousewheel commands. Don't know if you fixed it yet, but I removed mousewheel control anyway because I have two lists to scroll through
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Jan 2013 20:09
You could leave mousewheel scrolling in, and simply differentiate which list gets scrolled by determining which list the mouse is hovering over.

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Chris Tate
DBPro Master
15
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 23rd Jan 2013 16:29
Quite a cool solution for a list box also; could through in some icons on the left if one wanted.

Login to post a reply

Server time is: 2024-03-28 13:29:49
Your offset time is: 2024-03-28 13:29:49