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

World: r3wp

[View] discuss view related issues

Maxim
22-Dec-2006
[6521x3]
in any case, a way to automate this is pretty easy IMHO. just do 
drawing and measure the amount of pixels which overlap wrt previously 
defined recurring shapes.  generate a view app which shows the highest 
matches in order and then a simple yes/no to confirm.
in a short amount of time you surely will have a sizeable amount 
of the glyphs reduced to a few recurring shapes!
since draw can reduce words on the fly, this also reduces the actual 
draw blocks used to express the glyphs... again, a sizeable memory 
saver.
Jerry
22-Dec-2006
[6524x3]
Cyphre, the bitmap cache is done. It improves the performance a lot, 
like you said.
Maxim, my idea is just the same as yours. I might just do that after 
what I doing is done.
And even better, I have collected the Chung-Jay code for every Chinese 
character. Chung-Jay can tell us what parts are in a character. I 
plan to use both Chung-Jay code and the pixel-matching method to 
speed up the analysis process.
Graham
22-Dec-2006
[6527x2]
In the VID area widget, what's the right mouse click used for?  Can 
that be used to trigger an action block?
I want to bring up a context sensitive menu
Geomol
23-Dec-2006
[6529x4]
Graham, sure:

view main: layout [b: box 200x200 [b/color: red show b] [append main/pane 
layout [origin 0 box beige "Context Menu"] show main]]
Graham, ups. I didn't notice, you meant AREA.
New version with AREA:

view main: layout [b: area 200x200 feel [engage: func [f a e] [if 
a = 'alt-down [append main/pane layout [origin 0 box beige "Context 
Menu"] show main]]]]
I ruined the AREA engage function. You have to implement the original 
also. The source can be reached with:
layout [a: area]
e: get in a/feel 'engage
source e
Graham
23-Dec-2006
[6533]
Thanks .. I can work with that.
Jerry
23-Dec-2006
[6534x3]
When drawing, I would like to translate the X to 0 and Y to ( Y + 
28 ). What the Matrix should be? Thanks.
I mean using the Matrix command in Draw, like MATRIX [a b c d e f]. 
The Matrix command would premultiply the current transformation matrix 
with the given block. What should I assign this block to translate 
the X to 0 and Y to ( Y + 28 )?
Forget about my previous question, I am not going to use matrix in 
this case.


For rendering cahracter images, I thought that relative-positioning 
could be a good idea. After drawing a character image, then shift 
(translate) to the next position, and the next character would be 
in the right position. So I made my draw block some thing like [ 
image char1-img translate rp1 image char2-img translate rp2 ]


It worked, but the rendering performance was slow, way too slow. 
So I go back to my good old absolute positioning. [ image char1-img 
ap1 image char2-img ap2 ]. No more "translate", no more matrix.
Geomol
27-Dec-2006
[6537x2]
Do we need a "User Interface Style Guide"? It may be part of the 
wikibood. I came to think of it when revising some of my scripts. 
I often program the key "Q" to be used to quit my scripts. But maybe 
it should be <ctrl>-q to quit, like it is with AltME!? Then I thought 
about, if anyone of you has made a style guide regarding user interfaces 
in REBOL? REBOL/View is made for different platforms, each with their 
own style guides. Should we stick to those guides, so our scripts 
have to use different keyboard shortcuts on different platforms? 
No, probably not! A REBOL script should work the same across all 
platforms, I think. Then we need a "User Interface Style Guide", 
so us developers can stick to the standard when developing REBOL 
applications, shouldn't we?
*wikibook*
Pekr
27-Dec-2006
[6539x3]
Geomol - such an userguide, would be usefull, because first all usage 
schemas would have to exist on the paper first. It would be clear, 
we first have to think, because it would be even clearer, that new 
VID without things like proper focus system, keyboard support, etc. 
- is a no go ....
I several times posted Gnome usage guide as a reference ...
http://developer.gnome.org/projects/gup/hig/
Geomol
27-Dec-2006
[6542x2]
If someone make such a guide, it should be cleared with Carl, I guess. 
He probably has some ideas, and the wanted user interface should 
be within the frame of how REBOL work (and will work in the future).
I can't get this to work under OSX, so I want to know, if it works 
under Windows.

Does this example make the text position change when pressing the 
button?


view layout [button "Test" feel [redraw: func [face act pos] [if 
face/edge [face/edge/effect: pick [ibevel bevel] face/state] face/para/origin: 
pick reduce [face/para/margin + 0x1 face/para/margin] face/state]]]
Pekr
27-Dec-2006
[6544]
it seems to change ....
Geomol
27-Dec-2006
[6545]
Down one pixel? Try change 0x1 to e.g. 0x4 to better see the change!
Pekr
27-Dec-2006
[6546]
yes ... I have small dot effect on my notebook LCD, so I moved text 
to align with it. I can see it really goes down certain amount of 
pixels
Geomol
27-Dec-2006
[6547x2]
LOL this is really strange! I can get the text to move, if I change 
the position more than 0x1. 0x4 works, so does 0x2. Strange!??
Here under OSX, the text doesn't move, if I only tell it to move 
0x1. I'll report it somewhere.
Pekr
27-Dec-2006
[6549x3]
it definitely seems to move even 0x1 under W2K here ...
maybe OS-X uses two pixel precision ;-)
or isn't kind of font antialiasing on OS-X, which can "blur" it?
Geomol
27-Dec-2006
[6552]
The text is rock solid here when using 0x1. Using 0x2 moves it one 
pixel down.
Henrik
27-Dec-2006
[6553x2]
geomol, noticed the menu bar in the viewtop? looks like it's the 
same thing.
the first item is sitting a pixel too high.
Geomol
27-Dec-2006
[6555]
Just noticed. Weird!
Anton
27-Dec-2006
[6556]
Sounds like a font rendering bug.
Henrik
27-Dec-2006
[6557]
wonder if the cursor bug is also related. on OSX the cursor is sitting 
1-2 pixels too far to the right.
Geomol
27-Dec-2006
[6558]
Yes, and it's not just to the side, it's also a couple of pixels 
too far up.
Henrik
27-Dec-2006
[6559]
geomol, here's another one.

view layout [area 400x400]


paste a large amount of text in it. place the cursor to the far right 
on the top line and press cursor down. the cursor also moves to the 
left.
Geomol
27-Dec-2006
[6560]
It's a bit weird. I had thought, code to control these things were 
the same on all platforms.
Maxim
4-Jan-2007
[6561x3]
anyone know the algorythm by which I can convert raw event/time values 
(an integer which seems to be in milliseconds) into a time value?
event/time is different when comming from the wake-event, it seems.
I need to skip events which are too old... my current event mungings 
work, but are hard to adapt as refresh slows down... having this 
time accurately would allow me skip events
Geomol
4-Jan-2007
[6564]
If it's in milliseconds, try: to-time event/time / 1000
Maxim
4-Jan-2007
[6565]
hum  good guess.
Joe
15-Jan-2007
[6566x2]
resize-image: func [
	dest [file!]
	size [pair!]
	file [file!]
	/local im
][	
	im:		load-image file
	save/png 	dest to-image layout [origin 0x0 image (im) (size)]
	im:		none
]
i use the above function to resize images but it leaks on 1.3.2.4.2 
 Am I doing something wrong or is it a bug ?
Ryan
16-Jan-2007
[6568x3]
code looks good to me, though try: draw size [image im 0x0 size]
You might ask rambo group about it being a bug.
(notice you did)