[REBOL] Re: XHTML Rebol browser help
From: carl:cybercraft at: 27-Jan-2003 17:51
On 27-Jan-03, iNetW3 wrote:
> Hello Reboller's
> I've put together an XHTML DOM parser in Rebol that automatically
> build VID's, and one for mBED (multimedia language)
> to embed my GUI code in all browsers with animation,
> scores, streamed audio, etc.
> but....... for the work in progress XHTML browser.....
> Does anyone know an easy way to change RGB code
> like this, "#FF00FF00" to a correct tupple color ?
I had a vague feeling there's a function in View to do this, but I may
be wrong. Anyway, the following isn't too ungainly...
>> rgb: "#ff00ff00"
== "#ff00ff00"
>> binary: load rejoin ["#{" next rgb "}"]
== #{FF00FF00}
>> to-tuple binary
== 255.0.255.0
Obviously the binary word isn't needed - I just did it that way to
show the interim result. This will do it in one...
>> to-tuple load rejoin ["#{" next rgb "}"]
== 255.0.255.0
> Is it possible to make everything in a panel scroll like
> you see in a browser?
The short answer is yes, but you'd have to write specific code to do
it (I think). Hmmm, I did a test a while back to see how big a layout
View can handle. I didn't attempt to make it scroll smoothly, but it
definately can handle very big layouts. Will attach the code to the
end of this, since it's not too long. ;-)
> And how do you make all your VID code set to a margin
> so it will automatically wrap for you, or is this not
> possible?
Not sure what you mean by the code "automatically" wrapping. You can
make text wrap and you can set a guide so your styles will be in
line, but neither of those features seem quite what you mean.
> And one more. When my series is built from the html page,
> i can't just say, " view layout series" and have it just pop
> up how do i do that?
What type of series is it? If a block, it should work. If it's a
string though, (which it could be I guess if it started out as HTML),
then you'd need to convert it to a block. ie...
>> series: {text "hello"}
== {text "hello"}
>> view layout series
** Script Error: layout expected specs argument of type: block
** Near: view layout series
In that simple case, just a to-block would work. ie...
view layout to-block series
but with anything complex, you may need to add the block-ends to the
string and use load. ie...
view layout load rejoin [ "[" series "]" ]
> I would really appreciate it if someone could share these
> tidbits with me if possible. Thanks in advance.
This is definately the place to ask.
And now for that test script I did, with full apologies for its size.
(I know, I know - I don't need any suggestions on how to improve on
this, okay?;)
REBOL []
inner-lo: layout/offset [
box purple 700x100 "Scrolling Layout Test - 740 x 34492 in size."
box yellow 700x100 "First 15x4"
box red 700x100 "1"
box green 700x200 "2"
box blue 700x100 "3"
box red 700x100 "4"
box green 700x200 "5"
box blue 700x100 "6"
box red 700x100 "7"
box green 700x200 "8"
box blue 700x100 "9"
box red 700x100 "10"
box green 700x200 "11"
box blue 700x100 "12"
box red 700x100 "13"
box green 700x200 "14"
box blue 700x100 "15"
box red 700x100 "a 1"
box green 700x200 "a 2"
box blue 700x100 "a 3"
box red 700x100 "a 4"
box green 700x200 "a 5"
box blue 700x100 "a 6"
box red 700x100 "a 7"
box green 700x200 "a 8"
box blue 700x100 "a 9"
box red 700x100 "a 10"
box green 700x200 "a 11"
box blue 700x100 "a 12"
box red 700x100 "a 13"
box green 700x200 "a 14"
box blue 700x100 "a 15"
box red 700x100 "b 1"
box green 700x200 "b 2"
box blue 700x100 "b 3"
box red 700x100 "b 4"
box green 700x200 "b 5"
box blue 700x100 "b 6"
box red 700x100 "b 7"
box green 700x200 "b 8"
box blue 700x100 "b 9"
box red 700x100 "b 10"
box green 700x200 "b 11"
box blue 700x100 "b 12"
box red 700x100 "b 13"
box green 700x200 "b 14"
box blue 700x100 "b 15"
box red 700x100 "c 1"
box green 700x200 "c 2"
box blue 700x100 "c 3"
box red 700x100 "c 4"
box green 700x200 "c 5"
box blue 700x100 "c 6"
box red 700x100 "c 7"
box green 700x200 "c 8"
box blue 700x100 "c 9"
box red 700x100 "c 10"
box green 700x200 "c 11"
box blue 700x100 "c 12"
box red 700x100 "c 13"
box green 700x200 "c 14"
box blue 700x100 "c 15"
box yellow 700x100 "Second 15x4"
box red 700x100 "1"
box green 700x200 "2"
box blue 700x100 "3"
box red 700x100 "4"
box green 700x200 "5"
box blue 700x100 "6"
box red 700x100 "7"
box green 700x200 "8"
box blue 700x100 "9"
box red 700x100 "10"
box green 700x200 "11"
box blue 700x100 "12"
box red 700x100 "13"
box green 700x200 "14"
box blue 700x100 "15"
box red 700x100 "a 1"
box green 700x200 "a 2"
box blue 700x100 "a 3"
box red 700x100 "a 4"
box green 700x200 "a 5"
box blue 700x100 "a 6"
box red 700x100 "a 7"
box green 700x200 "a 8"
box blue 700x100 "a 9"
box red 700x100 "a 10"
box green 700x200 "a 11"
box blue 700x100 "a 12"
box red 700x100 "a 13"
box green 700x200 "a 14"
box blue 700x100 "a 15"
box red 700x100 "b 1"
box green 700x200 "b 2"
box blue 700x100 "b 3"
box red 700x100 "b 4"
box green 700x200 "b 5"
box blue 700x100 "b 6"
box red 700x100 "b 7"
box green 700x200 "b 8"
box blue 700x100 "b 9"
box red 700x100 "b 10"
box green 700x200 "b 11"
box blue 700x100 "b 12"
box red 700x100 "b 13"
box green 700x200 "b 14"
box blue 700x100 "b 15"
box red 700x100 "c 1"
box green 700x200 "c 2"
box blue 700x100 "c 3"
box red 700x100 "c 4"
box green 700x200 "c 5"
box blue 700x100 "c 6"
box red 700x100 "c 7"
box green 700x200 "c 8"
box blue 700x100 "c 9"
box red 700x100 "c 10"
box green 700x200 "c 11"
box blue 700x100 "c 12"
box red 700x100 "c 13"
box green 700x200 "c 14"
box blue 700x100 "c 15"
box yellow 700x100 "Third 15x4"
box red 700x100 "1"
box green 700x200 "2"
box blue 700x100 "3"
box red 700x100 "4"
box green 700x200 "5"
box blue 700x100 "6"
box red 700x100 "7"
box green 700x200 "8"
box blue 700x100 "9"
box red 700x100 "10"
box green 700x200 "11"
box blue 700x100 "12"
box red 700x100 "13"
box green 700x200 "14"
box blue 700x100 "15"
box red 700x100 "a 1"
box green 700x200 "a 2"
box blue 700x100 "a 3"
box red 700x100 "a 4"
box green 700x200 "a 5"
box blue 700x100 "a 6"
box red 700x100 "a 7"
box green 700x200 "a 8"
box blue 700x100 "a 9"
box red 700x100 "a 10"
box green 700x200 "a 11"
box blue 700x100 "a 12"
box red 700x100 "a 13"
box green 700x200 "a 14"
box blue 700x100 "a 15"
box red 700x100 "b 1"
box green 700x200 "b 2"
box blue 700x100 "b 3"
box red 700x100 "b 4"
box green 700x200 "b 5"
box blue 700x100 "b 6"
box red 700x100 "b 7"
box green 700x200 "b 8"
box blue 700x100 "b 9"
box red 700x100 "b 10"
box green 700x200 "b 11"
box blue 700x100 "b 12"
box red 700x100 "b 13"
box green 700x200 "b 14"
box blue 700x100 "b 15"
box red 700x100 "c 1"
box green 700x200 "c 2"
box blue 700x100 "c 3"
box red 700x100 "c 4"
box green 700x200 "c 5"
box blue 700x100 "c 6"
box red 700x100 "c 7"
box green 700x200 "c 8"
box blue 700x100 "c 9"
box red 700x100 "c 10"
box green 700x200 "c 11"
box blue 700x100 "c 12"
box red 700x100 "c 13"
box green 700x200 "c 14"
box blue 700x100 "c 15"
box yellow 700x100 "Forth 15x4"
box red 700x100 "1"
box green 700x200 "2"
box blue 700x100 "3"
box red 700x100 "4"
box green 700x200 "5"
box blue 700x100 "6"
box red 700x100 "7"
box green 700x200 "8"
box blue 700x100 "9"
box red 700x100 "10"
box green 700x200 "11"
box blue 700x100 "12"
box red 700x100 "13"
box green 700x200 "14"
box blue 700x100 "15"
box red 700x100 "a 1"
box green 700x200 "a 2"
box blue 700x100 "a 3"
box red 700x100 "a 4"
box green 700x200 "a 5"
box blue 700x100 "a 6"
box red 700x100 "a 7"
box green 700x200 "a 8"
box blue 700x100 "a 9"
box red 700x100 "a 10"
box green 700x200 "a 11"
box blue 700x100 "a 12"
box red 700x100 "a 13"
box green 700x200 "a 14"
box blue 700x100 "a 15"
box red 700x100 "b 1"
box green 700x200 "b 2"
box blue 700x100 "b 3"
box red 700x100 "b 4"
box green 700x200 "b 5"
box blue 700x100 "b 6"
box red 700x100 "b 7"
box green 700x200 "b 8"
box blue 700x100 "b 9"
box red 700x100 "b 10"
box green 700x200 "b 11"
box blue 700x100 "b 12"
box red 700x100 "b 13"
box green 700x200 "b 14"
box blue 700x100 "b 15"
box red 700x100 "c 1"
box green 700x200 "c 2"
box blue 700x100 "c 3"
box red 700x100 "c 4"
box green 700x200 "c 5"
box blue 700x100 "c 6"
box red 700x100 "c 7"
box green 700x200 "c 8"
box blue 700x100 "c 9"
box red 700x100 "c 10"
box green 700x200 "c 11"
box blue 700x100 "c 12"
box red 700x100 "c 13"
box green 700x200 "c 14"
box blue 700x100 "c 15"
] 0x0
outer-lo: layout [
page: box black 700x200
across
button "Up" [inner-lo/offset/y: inner-lo/offset/y + 100 show page]
button "Down" [inner-lo/offset/y: inner-lo/offset/y - 100 show
page]
]
page/pane: inner-lo
view outer-lo
--
Carl Read