r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Rebolek
18-Jan-2007
[6588]
display just visible lines. but i don't think i've something right 
here to show you.
Anton
18-Jan-2007
[6589]
That's a good question.
Chris
18-Jan-2007
[6590]
How much is large?
Anton
18-Jan-2007
[6591x2]
mold system
but yeah, Henrik, what's your data ?
Henrik
18-Jan-2007
[6593x2]
I had about 1 MB of text (output in Tester). It took 2-3 minutes 
at 100% cpu before it finished formatting it.
(or what ever it was doing)
Volker
18-Jan-2007
[6595]
can you split the  text in paragraphs yourself? then you could use 
 multiple faces.
Rebolek
18-Jan-2007
[6596]
split in lines and use just that part that fits the screen
Henrik
18-Jan-2007
[6597]
copy/part at text first-visible-line <areasize> ?
Volker
18-Jan-2007
[6598x2]
should do the  trick. if  you do not  wrap
but even then should be good enough for theslider.
Henrik
18-Jan-2007
[6600]
to get it precisely, it would be a matter of calculating the number 
of lines based on line height. A little more difficult if you are 
wrapping text.
Volker
18-Jan-2007
[6601]
yes. would  drop that.
Henrik
18-Jan-2007
[6602]
actually, I found another thing: The data was really consisting of 
an almost 1 MB large line without linebreaks. It could be that it's 
very difficult to calculate the size of the text this way, but I'm 
not sure.
Maxim
18-Jan-2007
[6603x7]
henrik, yes, the engine to calculate line breaks can be manually 
harnessed and its *VERY* slow.
it is used when you set face/para/wrap?: true.
you're best bet is to use a monospace font and do a very fast char 
count instead.
using scroll offset, window width you can select a line of text immediately.
using parse you can also break up a big text pretty quickly.  but 
you need to have a way to re-assemble the text later on, when you 
export the face's data.
obviously, you shouldn't using area, and well, the complexity is 
that you have to implement all the cursor managment manually..  :-(
glayout has an integrated function which can give you a line-block 
of wrapped text.  I had done tests for large files and this engine 
really is inadequate.
Oldes
18-Jan-2007
[6610]
1MB line without breaks would kill my favourite text editor so it's 
not so bad:-)
Maxim
18-Jan-2007
[6611x2]
this is direct REBOL useage...  a simple  loop using native rebol 
calls.  no fancy code... so it really is RT implementation which 
is ugly.


they should have made a native which returns a block of  lines directly 
using a face
Oldes.. thats not a very good editor then ;-)

Using Ultra edit I've loaded a 400MB one line file.  :-)
Jerry
19-Jan-2007
[6613]
In 2005, I developed an simple English sentence parser in REBOL. 
It was a small experiment. It didn't support much grammar yet. The 
screen shot is here. http://city.udn.com/v1/blog/photo/photo.jsp?uid=JerryTsai&f_PHOTO_ID=471974
Henrik
19-Jan-2007
[6614]
oh, that looks interesting, what can it do?
Oldes
19-Jan-2007
[6615]
Maxim: I'm lucky that I don't need to edit such a large files:-) 
And Jerry, it's really interesting.
Jerry
19-Jan-2007
[6616]
Not much. It just parses the English sentence inputed by the user, 
makes a REBOL block, and draws the REBOL block as a syntax tree. 
That's all. I am thinking about using it to "help" people translate 
documents or something. I might combine it with an REBOL Chinese 
Editor that I developing. Check it out here http://city.udn.com/v1/blog/photo/photo.jsp?uid=JerryTsai&f_PHOTO_ID=472052
Maxim
19-Jan-2007
[6617]
so you decided to show off your stuff finaly  :-)
Jerry
19-Jan-2007
[6618]
Maxim, yes. It took me a lot of nerve to show them, because they're 
just semifinished.
Maxim
19-Jan-2007
[6619]
but they are both very impressive.  when looking at your font output, 
we don't even realise that all of that is draw shapes!  you've coded 
your own font engine.. its a pretty cool result.  They look like 
high-quality system fonts to me!
Jerry
19-Jan-2007
[6620]
Thanks, Maxim.
Anton
19-Jan-2007
[6621]
Both look very good, Jerry.
Janeks
20-Jan-2007
[6622]
Is it possible to catch program close event - when windows shut down 
and do something (save data)? The same appies when somebody closes 
all program windows or terminate process from task manager.
PeterWood
20-Jan-2007
[6623]
Does this help http://www.rebolforces.com/view-faq.html#sect3.3.
Janeks
20-Jan-2007
[6624]
It help for window face, but what if there is no windows(faces) open 
at closing time. F.ex. application at that moment is witout opened 
windows
and there is only taskbar icon.
Anton
21-Jan-2007
[6625]
maybe the system:// port will receive a windows message.. not sure.
Cyphre
21-Jan-2007
[6626]
Very nice, Jerry!
Jerry
21-Jan-2007
[6627]
Thanks, Anton and Cyphre. I am still improving it. : )
Jerry
22-Jan-2007
[6628]
REBOL[]
font-C: make face/font [style: [ bold ] size: 64]
draw-block: [ ]
for i 0 9 1 [
    append draw-block compose/deep [
        pen (to-tuple reduce [ 255 

                                to-integer (255 / 10.0 * (i + 1)) 

                                to-integer (255 / 10.0 * (i + 1)) 

                                to-integer 255 - (255 / 10.0 * (i + 1)) ] )
        line-width (10 - i)
        line-join round        
        font font-c
        text 30x0 vectorial "REBOL BAR"
    ]
]
view/title layout [
    box black 450x200 effect [
        draw draw-block
    ]
] "NEON"
Maxim
22-Jan-2007
[6629]
hehe... do we have new demo contender here?
Jerry
22-Jan-2007
[6630x2]
just for fun  : )
The Truth is that... I did the same "Neon" program in C# too. Guess 
what? REBOL version is much faster than C# (.NET).
Anton
22-Jan-2007
[6632]
nice
Rebolek
23-Jan-2007
[6633]
Jerry that's really nice! BTW. how big is C# version? :)
Jerry
23-Jan-2007
[6634]
Rebolek, C# version is about 100 lines of source code.
Rebolek
23-Jan-2007
[6635]
Jerry thanks, I though that. On one hand, there's 600kB REBOL/View 
with 20 lines of source code, on the other hand, there's ~100 lines 
C# source code on 20+MB dotNET...but that's the power of marketing 
:)

Anyway, very nice demo.
Jerry
23-Jan-2007
[6636]
Well. the .NET 3.0 Runtime is 49 MB, not 20+MB. .NET 2.0 is 23MB 
though.
Rebolek
23-Jan-2007
[6637]
Oh. I didn't know there's NET 3.0. I just need 2.0 for work and that's 
enough for me ;) Anyway, REBOL's result is much more interesting 
with .NET 3.0 than with .NET 2.0 :o))