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.

Newcomers DBPro Corner / scroll bars

Author
Message
smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 6th Oct 2005 11:02
using dbp.
Was printing data to the screen yesterday when i realized after it gets to the bottom of the screen it keeps going and you can no longer see the output. Was wondering if there was a way to scroll down the screen in dbp. i CANNOT find any commands in the index. I searched the whole thing or anything reguarding repositioning the screen other than the windows pos itself. i would like to build a windows like file browser with icons so i will need to be able to scroll.
ty for your help

A child's dream never dies.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 6th Oct 2005 15:03 Edited at: 8th Oct 2005 00:49
First off I recommend using TEXT instead of PRINT. It gives you more control over how the text looks, where it's positioned and how it behaves.

Ok, I've never done this before so I'll just be stating how I'd do it...

I'd do something like this:



That should do it, just put that in the loop. Change/add more TEXT commands to suit the program, and change the amount the Scroll command adds to the y position for faster or slower scrolling, and finally change the upkey/downkey control to whatever you want to move the text up and down.

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 6th Oct 2005 17:00 Edited at: 6th Oct 2005 17:10
firt off i would like to say awesome man. second how the heck.
does the dec and inc command do it all?

i have no idea where to start to implement it into my code though;

looks to me that is should work just my using my current l=l+1 as the scroll# variable. serves the same purpose however i cannot get it to work i am still very new to programming.

A child's dream never dies.
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 6th Oct 2005 18:15 Edited at: 6th Oct 2005 18:15
try this



btw, how do you stand all those capital commands! ... my eyes hurt

--Peter

"We make the worst games in the universe."

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Oct 2005 18:39 Edited at: 6th Oct 2005 20:42
It depends whether or not you want to just scroll the screen as you are printing, or you want to be able to manually scroll back up to see what has disappeared off the top of the screen.

Below is my function for screen scrolling in a box positioned anywhere on the screen, but it doesn't include any ability to look at lines which have scrolled off the top. Shouldn't be too difficult to add that though. (Will take a look at that aspect later and add it to the Code Hints section on my web site).

DBC code, but AFAIK does not contain anything to prevent it working in DBP...

Basically, you provide it with the X and Y position on the screen you want to print, the width of the scroll box, the string you want to print and finally, how many lines of text fit into the box before it starts scrolling.



TDK_Man

smerf
19
Years of Service
User Offline
Joined: 24th Feb 2005
Location: nm usa
Posted: 7th Oct 2005 07:59
THANKS ALOT GUYS.
i dont intentinally use capslock either i just accidentally hi it instead of shift and instead or retyping it i just go along with it.
thanks guys you have been much help

A child's dream never dies.

Login to post a reply

Server time is: 2024-11-13 21:27:02
Your offset time is: 2024-11-13 21:27:02