World: r3wp
[View] discuss view related issues
older newer | first last |
Anton 12-Jul-2005 [1889] | I am sure this demo will be useful to you. |
shadwolf 12-Jul-2005 [1890x3] | What I want to symbolise is the wind speed and direction and the humidity |
this will brings me 4 dynamic images built according to METAR/TAF informations ;) | |
My idea was to make a images that symbolise the cardinal direction (rose of the wind) and using draw effect over draw information like arrow or text :) | |
Anton 12-Jul-2005 [1893x2] | Well, adding the image is simple. Adding the text should be fairly quick too. |
Kru, yep, definitely like your style Kru. Just skimming your codes, nice and clean. Your multiple colours handling looks smart, too. Something I haven't implemented so fully and nicely. | |
Rebolek 12-Jul-2005 [1895x2] | Anton your knobs are nice too, more posibilities than in my design |
Anton if you want, use my code - this is probably enough for my purpose so I'm going to focus on other elements (now I've got sample window in my mind). BTW design of the knobs is inspired by Roland SH1000 :) | |
Gregg 12-Jul-2005 [1897] | Kru and Anton. Both excellent demos! Should we add a folder on Viewtop for custom styles? |
Rebolek 12-Jul-2005 [1898] | Probably yes. There are some good styles around there but it might be hard to find them |
DideC 12-Jul-2005 [1899x2] | Draw style constest ? Can I play too ? :-) |
do http://membres.lycos.fr/didec/rebol/stick-style.r | |
Rebolek 12-Jul-2005 [1901] | DiceC that's really nice! I really like it. Did you tried it with non-fixed positions of the stick? |
DideC 12-Jul-2005 [1902] | Yep, but : - Not easy to set value by mouse (as said before). - Effect (fill-pen) is not "mathematicaly" link to stick angle (don't find a formula), so hard to do for any value. |
shadwolf 12-Jul-2005 [1903x9] | très joli !! (very nice ) |
there is a tiny bug in your algo didec | |
drag the stick at what ever position stay with the mouse button down and you will see the pair position text to be increment every seconds | |
Kru nice job why not to include this kind of mad widgets to rebgui ? | |
mad but beauty full and original way to symbolise things like meters etc | |
can be used for example to symbolise network in/outgoing trafic :) | |
can ease t | |
some configuration range too instead of having a silder and a progress bar | |
I like the 3 kind of widgets both of you shows ;) | |
Rebolek 13-Jul-2005 [1912] | shadwolf why not, what's the difference between VID and REBGui widget? |
DideC 13-Jul-2005 [1913] | It's not a bug but an intented behavior : it's a pair input style. There is for steps, each step can add any value to the pair. The repeat speed is also a parameter. ie: stick-style speed 8 steps [1 2 5 10] ==> 8 is the repeat speed (rate) and 1, 2, 5 and 10 are the values added to the pair!, depending how you move the stick. stick-style value-mode decimal! ==> value is a block of 2 decimal! values rather than a pair! |
Anton 13-Jul-2005 [1914x10] | Nice Dide. :) |
I have been looking at feel/redraw in more detail for the last couple of days. | |
And feel/redraw is a nice place to detect changes to the face, eg. when face/data changes, you can update the visual state of the face. | |
You can also do face/action when face/data changes. However, I found that it is *not* a good place to use TO-IMAGE (which might be in the face/action), because the latest image of the face has not been rendered yet. Redraw's 'draw action occurs just *before* the face is rendered. So to get a chance to make a snapshot of the face using TO-IMAGE, I propose a new redraw action, 'view, be sent after the face has fully rendered, allowing TO-IMAGE to be used at the right time. | |
Here is a demo showing the problem: | |
view layout [ pic: image b: box 100x100 sky with [data: 1] effect [draw []] feel [ redraw: func [face action position][ ?? action if action = 'draw [ insert clear face/effect/draw compose [ fill-pen navy box 10x0 (as-pair 30 face/size/y * face/data * 0.01) ] pic/image: to-image face ;show pic ; causes a stack overflow ] ] ] btn "change" [print "change" b/text: form b/data: random 100 show b show pic] ] | |
The top image gets the result of TO-IMAGE of the box. | |
Does anyone else think that might be useful, and should I post a rambo ticket to request that ? | |
I understand that this extra action might slow View down a bit, so perhaps it could be switched on using a flag like face/options: [redraw-view] | |
Kru, I noticed some things in your demo code: tachomtr.r - COPY COMPOSE not needed, COMPOSE does a copy for you already. - repeat i 10 [...] where i is not used in the code block (you have a couple of those) can become loop 10 [...] This saves creating a context with the word 'i in it each time (which is what REPEAT does internally). | |
Rebolek 13-Jul-2005 [1924] | Anton thanks, I'll fix it |
Anton 14-Jul-2005 [1925x4] | Ok, I don't need the new action anymore; I simply avoid recursion possibly caused by the face/action by setting flag. Here is a demo showing face action trying to recurse, and redraw catching this using the flag: |
view layout [ pic: image b: box 100x100 sky with [data: 1 old-data: none doing-action?: none] effect [draw []] feel [ redraw: func [face action position][ if all [ action = 'draw not face/doing-action? face/data <> face/old-data ][ insert clear face/effect/draw compose [ fill-pen navy box 10x0 (as-pair 30 face/size/y * face/data * 0.01) ] face/doing-action?: yes face/action face face/data ; action may cause recursion face/doing-action?: no face/old-data: face/data ] ] ][ ; the action block show face pic/image: to-image face show pic ] btn "change" [print "change" b/text: form b/data: random 100 show b show pic] ] | |
It's good (took me hours to arrive at this simple solution :) Now the action block can do whatever it likes, including showing the face, and redraw can handle it. | |
Yep, I'm so happy about this. I'll be running around all my old styles updating them with this trick. Now I can continue with my more robust rotate-knob. | |
Ashley 14-Jul-2005 [1929x2] | Good find, I think it may be the answer to a few of my redraw problems as well! ;) |
Might make a good cookbook entry as well. | |
BrianW 20-Jul-2005 [1931] | Is it possible to make View evaluate an expression and send the output to STDOUT under Windows? I'm not having any luck with my attempts: C:\Program Files\rebol\view\rebol.exe --do "print probe system" This just opens the View Desktop, and doesn't seem to eval the statement. |
Sunanda 20-Jul-2005 [1932] | I think this is as good as it gets: rebol -s --do "echo %out.txt probe system quit" type out.txt |
BrianW 20-Jul-2005 [1933x2] | hmm ... that doesn't do it either. I decided to get Core and use that for my purposes. |
(Working on rebol-helper functionality for Vim) | |
Gabriele 20-Jul-2005 [1935x3] | rebol -qw some-script.r | more |
(you don't see the output if there is no redirection) | |
also, try -c | |
BrianW 20-Jul-2005 [1938] | My problem was that invoking View's rebol.exe always seems to pull up the Desktop. |
older newer | first last |