I'm trying to use the SCROLLTEXT option in PB/CC6. The new line of specified text appears as expected at the bottom of the page and uses the desired foreground and background colours. However, the remainder of the line where no text is specified always appears with a white background even though I have not specified a white background anywhere in the coding. How do I make my desired background (it happens to be %BLACK) accepted as the default background for the whole new line?
SCROLLTEXT help please
Collapse
X
-
Thanks for your response. I'm using GRAPHICS mode because the bulk of the program requires it. I have tried inserting (eg) GRAPHIC COLOR %GRAY,%BLACK but that only affects new text, and if I use GRAPHICS CLEAR or GRAPHICS CLEAR %BLACK then that removes all the previous output that I want to show.
Comment
-
-
For what it's worth, I use a workaround to give the imminent 'new' row a black background. Just before the GRAPHIC PRINT statement that specifies the 'new' text and which prompts the page scroll, I insert a GRAPHIC BOX statement specifying a black box covering where the new row will be at the bottom of the page. This achieves the result I want, but it is not 'elegant'!
Comment
-
-
Quick test - see no color problem here.
'Code:FUNCTION PBMAIN LOCAL hWin AS DWORD GRAPHIC WINDOW "Scroll Text", 200, 200, 400, 240 TO hWin GRAPHIC ATTACH hWin, 0, REDRAW GRAPHIC COLOR %YELLOW, %BLACK GRAPHIC SET SCROLLTEXT GRAPHIC CLEAR FOR y& = 0 TO 100 GRAPHIC PRINT "Whatever" + STR$(y&) GRAPHIC REDRAW NEXT SLEEP 2000 END FUNCTION '
Comment
-
-
A quick response to Borje: I ran your suggested code and got the same problem that caused me to raise this issue. The page background colour is fine prior to scrolling. After scrolling, the 'new' rows are ok ONLY where the new text is present. Further along each scrolled row (to the right of the new text) the background has become 'white'.
Comment
-
-
Sample code. The indents have disappeared!
Press Esc to quit. Try running with GRAPHIC BOX line rem'd out.
FUNCTION PBMAIN
DEFLNG i-n: DEFDBL a-h,o-z
REM
REM ------------------- specify graphics window ----------------------
DESKTOP GET CLIENT TO iwin,jwin: REM whole screen except sys tray
GRAPHIC WINDOW NEW " GRAPHICS SCREEN ", 0,0,iwin, jwin TO igraf
FONT NEW "Consolas",16,0,1,0,0 TO ifont16: REM size, normal, ANSI char set, pitch, angle
REM
REM ---------------------- default choices ---------------------------
GRAPHIC ATTACH igraf,0,REDRAW: REM update graphics only with REDRAW
GRAPHIC SCALE (0.,0.)-(1280.,720.): REM user chosen scale
GRAPHIC CLEAR %BLACK: REM desired graphics screen
GRAPHIC SET FONT ifont16: REM default font
GRAPHIC SET SCROLLTEXT 1: REM enable page scrolling
REM
REM
GRAPHIC COLOR %GRAY,%BLACK: GRAPHIC SET POS (36,48)
GRAPHIC PRINT "Colour blu grn red"
REM
REM ----------------- blend colours ----------------------------------
1100 fr=RND:fg=RND: fb=RND: REM 0<random<1
r=INT(fr*255): g=INT(fg*255): b=INT(fb*255)
red$=HEX$(r,2): grn$=HEX$(g,2): blu$=HEX$(b,2)
h$=red$+grn$+blu$: clr=VAL("&H"+h$)
GRAPHIC COLOR clr
REM
REM try running with next statement rem'd out
GRAPHIC BOX (1,696)-(1279,720),,%BLACK,-1
GRAPHIC PRINT USING$(" & ### ### ###",h$,r,g,b)
GRAPHIC REDRAW
GRAPHIC WAITKEY$ TO a$: REM press any key to get next colour
IF a$<>CHR$(27) THEN 1100: REM ... or press [ESC] to quit
REM
END FUNCTION
Comment
-
-
Running your code, I see issues when the GRAPHIC BOX line isn't commented out. With it commented out, it works as expected. But if I change the GRAPHIC CLEAR statement to anything but %BLACK I see the issue. Baffling, it gets even worse with GRAPHIC SET VIRTUAL.
On another front, I suggest DIALOG DOEVENTS immediately after 1100.Rod
In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.
Comment
-
-
Pad the text you are SCROLLTEXT'ing with SPACE$(CON.SCREEN.COL) before SCROLLTEXT'ing.
MCM
Not really a console compiler guy but I am pretty sure this will workMichael Mattias
Tal Systems (retired)
Port Washington WI USA
[email protected]
http://www.talsystems.com
Comment
-
-
Hm, don't see any problem. No white background - all is black. Compiler PB/CC 6.03 and Windows 10. Only time I see white background after printing below edge is when I add -1 (for def. color) last to last GRAPHIC COLOR command. Maybe can try to add %BLACK there, so it looks like GRAPHIC COLOR clr, %BLACK.
Comment
-
-
Originally posted by Michael Mattias View PostPad the text you are SCROLLTEXT'ing with SPACE$(CON.SCREEN.COL) before SCROLLTEXT'ing.
MCM
Not really a console compiler guy but I am pretty sure this will workDale
Comment
-
-
Strange, when I scroll past the bottom of the screen if I don't use the default colours or black, I see what John's talking about. PBWin 10 and PBCC 6 on Win 10.
Even GRAPHIC CLEAR %BLACK has the issue if GRAPHIC COLOR clr alone is used, %BLACK or -2 as the second parameter make it work.Rod
In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.
Comment
-
-
I didn't tell you that I am running Windows 10 Pro 64 bit on a Dell running with Intel i7-3770.
I have tried some of the ideas suggested, but I cannot get away from the basic problem - ie the PRINTED text always has the right foregrd and backgrd, but after scrolling starts the right hand end of the new lines shows 'white' instead of the desired black (unless I use that BOX statement.
Comment
-
-
John, try this code, I don't know that it's much different than what you;re doing but it works here.
Code:FUNCTION PBMAIN DEFLNG i-n: DEFDBL a-h,o-z REM REM ------------------- specify graphics window ---------------------- DESKTOP GET CLIENT TO iwin,jwin: REM whole screen except sys tray GRAPHIC WINDOW NEW " GRAPHICS SCREEN ", 0,0, iwin-100, jwin-500TO igraf ' adjusted to fit my screen. FONT NEW "Consolas",16,0,1,0,0 TO ifont16: REM size, normal, ANSI char set, pitch, angle REM REM ---------------------- default choices --------------------------- GRAPHIC ATTACH igraf,0,REDRAW: REM update graphics only with REDRAW 'GRAPHIC SCALE (0.,0.)-(1280.,720.): REM user chosen scale 'because my monitor is in portrait mode GRAPHIC CLEAR %BLACK: REM desired graphics screen GRAPHIC SET FONT ifont16: REM default font GRAPHIC SET SCROLLTEXT 1: REM enable page scrolling 'graphic set virtual iwin, jwin REM REM GRAPHIC COLOR %GRAY,%BLACK: GRAPHIC SET POS (36,48) GRAPHIC PRINT "Colour blu grn red" REM REM ----------------- blend colours ---------------------------------- 1100 fr=RND:fg=RND: fb=RND: REM 0<random<1 r=INT(fr*255): g=INT(fg*255): b=INT(fb*255) red$=HEX$(r,2): grn$=HEX$(g,2): blu$=HEX$(b,2) h$=red$+grn$+blu$: clr=VAL("&H"+h$) GRAPHIC COLOR clr, %BLACK ' works with -2 instead of %BLACK REM REM try running with next statement rem'd out 'GRAPHIC BOX (1,696)-(1279,720),,%BLACK,-1 GRAPHIC PRINT USING$(" & ### ### ###",h$,r,g,b) GRAPHIC REDRAW GRAPHIC WAITKEY$ TO a$: REM press any key to get next colour IF a$<>CHR$(27) THEN 1100: REM ... or press [ESC] to quit REM GRAPHIC WINDOW END END FUNCTION
Rod
In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.
Comment
-
Comment