started using frame.js a bit tonight to see what it can do. I saw that it has a 'scrollbars' property, but it seems that even when I set it to true, it isn't displaying scrollbars. I tried making sure v_scroll and h_scroll
started using frame.js a bit tonight to see what it can do. I saw
that it has a 'scrollbars' property, but it seems that even when I
set it to true, it isn't displaying scrollbars. I tried making sure
v_scroll and h_scroll
Those properties are placeholders and don't do much of anything at the moment.
You can use the ScrollBar object from scrollbar.js (note the camelCase - there is also a Scrollbar object in that same file, which is not Frame compatible) to add scrollbars to frames. See comments at the top of the file for options and instructions.
properties actually do something. For now, just attach a ScrollBar to a Frame prior to calling Frame.open(), and call .cycle() on your ScrollBar as often as you call .cycle() on the Frame.
You can use the ScrollBar object from scrollbar.js (note the camelCase - there is also a Scrollbar object in that same file, which is not Frame compatible) to add scrollbars to frames. See comments at the top of the file for options and instructions.
- When first displaying the file, it looks like the scrollbar has "holes" in it. This is a screenshot I made as an example (using white as the scrollbar foreground and light grey as the scrollbar background):
- I have an input loop in my script that waits for a keypress and scrolls the Frame when the user presses the up or down arrow, PageUp, PageDown, Home, or End. The scrollbar refreshes when I scroll up & down one line (using the Frame's scroll() method), but after using the Frame's scrollTo() method (which I'm using for PageUp, PageDown, Home, and End), the scrollbar doesn't refresh until cycle() is called a 2nd time (which happens when I press PageUp, PageDown, Home, or End in my script).
For the 2nd issue, I'm not sure if it's something I'm doing wrong in my script or if it's an issue in the scrollbar/frame class.
- When first displaying the file, it looks like the scrollbar has
"holes" in it. This is a screenshot I made as an example (using white
as the scrollbar foreground and light grey as the scrollbar
background):
Not sure. Are you setting the background colour to LIGHTGRAY or BG_LIGHTGRAY? Is the ANSI content being loaded before or after the scrollbar is opened / cycled for the first time?
- I have an input loop in my script that waits for a keypress and
scrolls the Frame when the user presses the up or down arrow, PageUp,
PageDown, Home, or End. The scrollbar refreshes when I scroll up &
down one line (using the Frame's scroll() method), but after using the
Frame's scrollTo() method (which I'm using for PageUp, PageDown, Home,
and End), the scrollbar doesn't refresh until cycle() is called a 2nd
time (which happens when I press PageUp, PageDown, Home, or End in my
script).
The ScrollBar doesn't actually redraw itself when you call .cycle() on it; it just updates its position info. The drawing takes place when .cycle() is called on the parent Frame. You could try calling .cycle() on the ScrollBar after you have called Frame.scrollTo() but prior to calling Frame.cycle(). (That may or may not help, but it's worth a shot.)
I was using LIGHTGRAY. I tried BG_LIGHTGRAY just now, and I think it actually looks/behaves better with LIGHTGRAY.
The ANSI content is being loaded before the scrollbar & frame are opened for the first time. Should it be loaded after?
Ah, that seems to help. So it seems that the documentation (comments) in scrollbar.js are wrong -
if(f.cycle()) {
s.cycle();
console.gotoxy(console.screen_columns, console.screen_rows);
}
That seems to suggest that if the frame cycle succeeds, then cycle the scrollbar. But as you suggested, it seems to work better when the scrollbar's cycle() is called before the frame's cycle().
I was using LIGHTGRAY. I tried BG_LIGHTGRAY just now, and I think it
actually looks/behaves better with LIGHTGRAY.
Only the BG_* values in sbbsdefs.js should be used for background colours; using the others may result in strange-looking things.
LIGHTGRAY incidentally looks better as a background here because - since WHITE is your foreground - it's like not setting a background colour at all. The foreground and background colours are OR-ed together to make an attribute number. In this case you end up with WHITE|LIGHTGRAY, which is 15|7, which is 15, which is WHITE. (You should see the same result when using any other non-BG_* colour as your background, so long as WHITE is your foreground.)
The ANSI content is being loaded before the scrollbar & frame are
opened for the first time. Should it be loaded after?
Not sure - I was just curious. How are you loading the ANSI stuff into the Frame - using Frame.load(), or some other way (Frame.putmsg(), etc.)?
Ah, that seems to help. So it seems that the documentation (comments)
in scrollbar.js are wrong -
Not really. The example works, but there's a crucial difference between it and what you're doing. (Which isn't to say that your way is wrong.)
if(f.cycle()) {
s.cycle();
console.gotoxy(console.screen_columns, console.screen_rows);
}
That seems to suggest that if the frame cycle succeeds, then cycle the
scrollbar. But as you suggested, it seems to work better when the
scrollbar's cycle() is called before the frame's cycle().
Frame.cycle() returns true if something changed, false otherwise. In my example, I'm only updating the ScrollBar if something changed in the Frame it's attached to. However changes to the ScrollBar's position won't be displayed until the Frame is cycled again. In my example, that next Frame.cycle() happens right away. In your code, there's presumably a blocking input prompt (console.getkey perhaps) in between.
The best solution would be for me to just bring ScrollBar into frame.js, and tie it into the Frame.cycle() method. Then you would use those currently-placeholder properties of Frame to enable scrollbars, and the rest would work behind the scenes - no need to manage the scrollbars separately.
Another thing I've noticed about using frame.js to display ANSI content is that it doesn't seem to totally refresh the background text when scrolling the ANSI up & down - Some text from some of the lines is left over when scrolling. For example, in the following screenshots, the ")" in the origin line at the bottom is left over when scrolling the message down (as the message text moves up):
http://bit.ly/1Ntklt5
http://bit.ly/1Ndg5Mj
http://bit.ly/1Ib9YI5
Would that break existing scripts that are currently managing them separately?
Would that break existing scripts that are currently managing them>
separately?What I think I'll do is leave scrollbar.js where it is,
and then have frame.jsload it. That way any script currently
loading scrollbar.js will still have itavailable. Frame will then
create ScrollBar instances if scrollbars aretoggled on, and maintain
them for you.Even if some script is already using scrollbar.js and
setting 'scrollbars' to'true' on a Frame, it probably won't break
anything. You'd just end up withtwo scrollbars, one layered over
the other, doing the same thing, with only thetopmost one
visible.---echicken electronic chicken bbs -
bbs.electronicchicken.com - 416-273-7230
===
þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
--- SBBSecho 2.27-Linux
* Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)
(723:1/1)
Just an FYI, your replies are coming in here all mangled up. I think part of what you posted is in the above quote, but some of it is NIghtfox's comments.
Another thing I've noticed about using frame.js to display ANSI
content is that it doesn't seem to totally refresh the background
text when scrolling the ANSI up & down - Some text from some of the
Is this something that you think would need to be fixed in my script? I'm
Another thing I've noticed about using frame.js to display ANSI
content is that it doesn't seem to totally refresh the background
text when scrolling the ANSI up & down - Some text from some of the
Is this something that you think would need to be fixed in my
script? I'm
Probably an issue with Frame itself. As a workaround you might try using Frame.invalidate() to force a redraw (on the next .cycle) after the user scrolls the Frame (but only if they scrolled it - otherwise you'll be redrawing needlessly.) May or may not make a difference.
Are you dumping that message body to a temp file in order to use it with Frame.load()? If so, any chance you could post the file somewhere? I'd like to see if I can reproduce the problem and come up with a fix.
Thanks. Some sort of newline problem that only shows up ... sometimes, for some people, apparently. I'll sort it out eventually. :|
Just an FYI, your replies are coming in here all mangled up. I think part of what you posted is in the above quote, but some of it is NIghtfox's comments.
Regards,
Nick
Just an FYI, your replies are coming in here all mangled up. I think
part of> what you posted is in the above quote, but some of it is
NIghtfox's comments.> Regards,> NickI'm not sure if this will be any
better ...... but I'm spanning this message across multiple ......
lines because it's fun to do. Anyway, pls respond and let me know
if thiscontinues to be mangled kthnx.---echicken electronic chicken
bbs - bbs.electronicchicken.com - 416-273-7230
Yep, still mangled. kwlcme. :D
Grr, what the fuck. I must sort this out.
Grr, what the fuck. I must sort this out.
Relax, angry guy. You might have just fixed it.
Or maybe not. We'll see.
:|
---
echicken
electronic chicken bbs - bbs.electronicchicken.com - 416-273-7230
þ Synchronet þ electronic chicken bbs - bbs.electronicchicken.com
Hello echicken,
On 09 Dec 15 22:54, echicken wrote to echicken:
That's how it appears here. Looks a helluva lot better!
Regards,
Nick
--- GoldED+/LNX 1.1.5-b20151129
* Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (723:1/701)
â– Synchronet â– thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin)
Just an FYI, your replies are coming in here all mangled up. I think part of what you posted is in the above quote, but some of it is NIghtfox's comments.
Regards,
Nick
I'm not sure if this will be any better ...
... but I'm spanning this message across multiple ...
... lines because it's fun to do. Anyway, pls respond and let me know if this continues to be mangled kthnx.
Not mangled here... maybe because I've to the newest, most awesomeest word_wrap() implementation?
Sysop: | Ree |
---|---|
Location: | Toronto, ON |
Users: | 2 |
Nodes: | 10 (0 / 10) |
Uptime: | 00:59:09 |
Calls: | 369 |
Files: | 2 |
Messages: | 38,903 |