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

World: r3wp

[View] discuss view related issues

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))
Pekr
23-Jan-2007
[6638]
The question is, if we can compare. Isn't NET self contained runtime 
environment? Rebol calls to OS, so can we say, that Rebol has only 
1MB?
Jerry
23-Jan-2007
[6639]
We have a software product. The version one used .NET, which made 
our software 10 MB in size. The version two uses C/C++ and some third 
party GUI components, it's 6 MB. but that's still too large for us. 
Few days ago, my boss asked me  whether I could redesign the GUI 
part of our software using REBOL. and I said ... maybe, if I could 
make my REBOL code call GetGlyphOutline successfully. Our product 
needs Chinese character support.
Rebolek
23-Jan-2007
[6640]
Pekr: Actually, REBOL's runtime is about same size on different operating 
systems (OSs?). dotNET is for Windows only. OK, there's MONO for 
Linux but I've never tried it. So dotNET may be some blablablamarketingchitchatblablabla 
but what si more useful in real life?
Pekr
23-Jan-2007
[6641]
Rebol :-)
Rebolek
23-Jan-2007
[6642x2]
well, there you go :)
Jerry: I just hope R3 will have better localization support. Lot 
of my work is localization to east-asian languages and REBOL is already 
helping me with localization to European languages. I hope for Unicode 
support and other enhancements to R3.
Jerry
23-Jan-2007
[6644]
If REBOL/view supported native codepage, my life could be much easier.
Rebolek
23-Jan-2007
[6645]
oh, yes. can't say more
Jerry
23-Jan-2007
[6646]
Many religions and cultures believe that if we pray hard enough, 
and if there are many of us, our dream could come true. "please support 
local codepage, please support local codepage ... "
Rebolek
23-Jan-2007
[6647]
I'm not sure if this does not belong to chitchat ;)
Ingo
24-Jan-2007
[6648]
Pekr ... I may be wrong here, but doesn' t .Net call Windows libs, 
too?
Janeks
24-Jan-2007
[6649]
Hi!
How to keep selection after show for text-list?

F.ex. code changes text-list data, for selected row, than after show 
a-text-list, selection of selected row disapears.