World: r3wp
[View] discuss view related issues
older newer | first last |
DideC 7-Mar-2006 [4431x2] | As ammon said : view layout [ vh1 "The text" vh1 with [text: "The text"] ] It's the same. |
With is nice i.e. to set the background color of a text style (where colors used in the dialect are assigned to font) : | |
Henrik 7-Mar-2006 [4433] | and everything in that block is equivalent to working with an object block, so you can put in functions, etc. and all the variables are bound to the face |
DideC 7-Mar-2006 [4434] | view layout [ vh1 "Text" blue vh1 "Text" with [color: blue] ] |
Allen 7-Mar-2006 [4435] | Also the facet does not need to already exist in the style, it can be used to add your own custom ones e.g view layout [button "click" with [squid: 3] [alert join "My squid is " face/squid] ] |
Henrik 8-Mar-2006 [4436x3] | I'm testing a tab button group with BTN look. What do you think? http://www.hmkdesign.dk/tabview.png |
the idea is for them to be toggles in a group, where only one of them can be selected. then there needs to be an easy method to perform some kind of action, such as selecting a mode or changing a layout in a pane | |
http://www.hmkdesign.dk/tabview2.png<-- how they would look selected | |
Anton 8-Mar-2006 [4439x2] | view layout [style group-tog tog [print [face/text]] with [related: 'default] group-tog "Anton" group-tog "Henrik" group-tog "other unpeeled vegetables"] |
(using the existing TOG style) | |
Henrik 8-Mar-2006 [4441x2] | anton, that's not the point of it |
the point is to have a button group that actually looks like a button group | |
Anton 8-Mar-2006 [4443x2] | Oh I see. |
view layout [style group-tog tog [remove find face/parent-face/pane face append face/parent-face/pane face print [face/text]] with [related: 'default] across space -5 group-tog "Anton" group-tog "Henrik" group-tog "vegetables"] | |
Henrik 8-Mar-2006 [4445] | not good enough :-) |
Anton 8-Mar-2006 [4446] | what's missing ? |
Henrik 8-Mar-2006 [4447x3] | well, first of all it's easy to tell that it's just buttons layered over eachother |
which makes it look crude and simple and unprofessional | |
I like the BTN style, but it's underused in VID for other applications, such as a tab button group | |
Anton 8-Mar-2006 [4450] | Change the space -5 to -2 and it looks better. |
Henrik 8-Mar-2006 [4451] | second, I use pane switching a lot and it's a hassle to write your own routines for that all the time. it should be much simpler. |
Anton 8-Mar-2006 [4452] | Just write a couple of functions, face-to-front and face-to-back and you can reuse them many times. |
Henrik 8-Mar-2006 [4453x2] | that's not the point either... |
The point is that it should be easy for everyone to do this. VID does not offer a standardized way to do this and you need to study how to switch layouts in panes, etc. It should work out of the box | |
Anton 8-Mar-2006 [4455] | Yes, that would be nice. |
Henrik 8-Mar-2006 [4456x2] | then switching panes wouldn't be any more complex than: |
view layout [tab-view 400 with [tabs: ["One" "Two" "Three"] panes: [layout1 layout2 layout3] ] ] | |
Anton 8-Mar-2006 [4458x3] | or this is quite feasible: layout [tab-panel "One" "Two" "Three" panes [ layout1 layout2 layout3 ] ] |
Default size of the tab-panel is calculated as the maximum of the three layout pane sizes. The three texts are available in face/texts so can be processed by init easily to create the three buttons. PANES would be a dialect word that simply sets face/panes, absolving the need for WITH in the most often used cases. | |
Note that rebgui has a tab-panel with a pretty simple spec, eg: tab-panel data ["one" layout1 "two" layout2 "three" layout3] | |
Henrik 8-Mar-2006 [4461] | good one |
[unknown: 10] 8-Mar-2006 [4462x2] | .. |
Thanks folks!! | |
Pekr 10-Mar-2006 [4464] | someone wante graphing, dunno what group was it posted in - one interesting project using AGG and Python - Matplotlib - done using AGG - http://matplotlib.sourceforge.net/screenshots.html |
Geomol 10-Mar-2006 [4465] | Looks nice, Pekr. Would it advocate REBOL making REBOL versions of those examples? The code should be less, of course. Else there wouldn't be much point in doing it. Maybe it's possible to make a Python -> REBOL converter (cross compiler)? I know zip of Python, so I can't say. |
Pekr 10-Mar-2006 [4466x2] | I am not sure how universal the library is for graphing ... maybe if we want to do graphing, we should look for the best of kind library, then to port ... I am not sure if there is any advantage to matplotlib - it calls agg library, which we have inside of rebol already, so :-) |
http://big.faceless.org/products/graph/examples.jsp?initial=browsershare | |
Geomol 10-Mar-2006 [4468x3] | I see. The examples are in matplotlib syntax. And matplotlib is a python 2D plotting library. So, as you say, it's probably better to find the best plotting library (or make a new one), than making an implementation of matplotlib. It could be the best one around though. |
I think, we have a problem with the way, AGG is implemented. E.g. arguments to LINE are pairs (like 100x100). To be able to make a smooth curve using LINE, the arguments have to be decimals. Try the following code to see: | |
img: make image! reduce [370x290 white] blk: [pen blue line-width 0.7 line] for t 0.0 2.0 0.01 [s: sine 360 * t append blk as-pair round t * 185 round 290 - (s * 145 + 145)] draw img blk view layout [image img] | |
Rebolek 10-Mar-2006 [4471] | Yes, decimal support for pair! I hope this comes in R3 (or sooner? ;) |
Oldes 10-Mar-2006 [4472x2] | Flash is using twips, which seems to be enough. |
And not just Flash - http://www.applecore99.com/api/api012.asp | |
Rebolek 10-Mar-2006 [4474] | Twips are screen-independent units to ensure that the proportion of screen elements are the same on all display systems. A twip is defined as being 1/1440 of an inch. This seems more complicated than decimal pair to me, because you need to recompute from twips to actual pixels, so you need to know screen resolution and size. |
Anton 11-Mar-2006 [4475x3] | I think the ephemeral vector! datatype might have been using decimals. |
Geomol, don't forget you can just use a higher resolution and scale it. | |
scale: 10 img: make image! reduce [370x290 white] blk: compose [scale (1 / scale) (1 / scale) pen blue line-width 7 line ] for t 0.0 2.0 0.01 [ s: sine 360 * t append blk as-pair round t * 185 * scale round 290 - (s * 145 + 145) * scale ] draw img blk view layout [image img] | |
Oldes 11-Mar-2006 [4478x3] | That's the way how the twips works 1px = 20twips so 1.2px = 24twips - the scaling is done on the draw engine side so you don't need to scale it yourself. In my dialect i just have directive 'units twips' and then the interpreter know that 24x24 is equal to 1.2x.1.2 --- if I'm not using twips all values are multiplied by 20 and rounded - that's the way how it's in Flash and in my Rebol/Flash dialect |
(in Flash internals - in actionscript there is not decimal pair datatype, what I know) | |
Anyway, if there will be the decimal pair datatype, I will be very lucky :-)) | |
older newer | first last |