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

World: r3wp

[!RebGUI] A lightweight alternative to VID

Vincent
3-Mar-2005
[26]
Ashley: just one little fix to make it work with /View 1.2.1:

(in display.r, line 99, word -> :word) if :word [set :word last-face]
else, 'if is confused (can't find then-block)
Ashley
3-Mar-2005
[27]
Done.
Robert
4-Mar-2005
[28]
Terms: I'm all for using "standard" terms. I must say that View always 
forces me to map the words and rethink them. I would like to see:
	Window
	Canvas instead of face

 Attribute instead of facet (please keep non-native speakers in mind)
	Action instread of feel
	Widget instead of style

For me a Widget can have different styles: Windows, Mac etc.
Anton
4-Mar-2005
[29x2]
I have almost forgotten all those old words. :)
I suggest to stick with official, rebol-documented terminology. It's 
more accurate, then, as it's definitely in the rebol domain.
Robert
4-Mar-2005
[31]
Yes, but it makes switching to Rebol really hard. I still get confused. 
It's the same with Maxims Steel! stuff. The words just don't help 
me to undestand what it's about. It's contra-productive. Even if 
wording might not be perfect it's known and people willl know for 
about 80% what it's talked about.
Anton
4-Mar-2005
[32x2]
The more standard the terminology used, the more "standard" expectations 
people will have. I think the rebol way is quite different to other 
languages, so it shouldn't restrict its language (and thus ideas) 
to other standards.
Well, you can see it both ways. And I don't think this argument is 
winnable by either side.
shadwolf
4-Mar-2005
[34x3]
in C widget libraries the names are quite the same but with a prefix
gtk_button, QButton, wx_button, etc ... why not retake the comon 
denomination adding rg_ suffixe to them ?
like rg_button, rg_field, rg_image, rg_check, rg_radio, rg_menubar, 
rg_statusbar, rg_table, rg_scoller, rg_slider etc...
Anton
4-Mar-2005
[37x2]
Yuck.
That's not why I came to rebol, to repeat myself endlessly.
shadwolf
4-Mar-2005
[39x2]
but if we clone the VID widgets naming how to diferenciate the both 
engines ?
and i hope rebGUI will integrate new widgets that doesn't exist in 
common VID engine so
Anton
4-Mar-2005
[41]
Why would you need to differenciate them ? The same words can be 
interpreted differently by LAYOUT or DISPLAY.
shadwolf
4-Mar-2005
[42]
that's a suggestion nothing more
Anton
4-Mar-2005
[43]
Ok :)
shadwolf
4-Mar-2005
[44]
It's not a commandement ;)
Anton
4-Mar-2005
[45]
Ahh.. getting tired. Got to go sleep. :)
DideC
4-Mar-2005
[46x7]
Ashley!
Reading this page http://www.dobeash.com/it/rebgui/facets/
I see you have put a "?" for edge/image.
You can simply use an image as an edge :
view layout [box edge [size: 10x10 image: logo.gif]]
I remenber reading somewhere (maybe ML) that an edge is a face pretty 
like other face.
I seems to be true:
view layout [box edge [size: 12x12 image: logo.gif effect: [tile 
gradcol 1x1 255.0.0 0.0.2
55]]]
I = It (seems to...)
Another "?" on 'restore word (face/changes). It's simple:
view/options lay: layout [
	box "Bouncing window !!" 300x200 rate 1 feel [
		engage: func [f a e] [
			if a = 'time [lay/changes: 'restore show lay]
		]
	]
	text "Minimize me (if you can ;-)"
] 'resize
Vincent
4-Mar-2005
[53x2]
a 'progress version without sub-face:
progress: make face [
	    effect: copy [draw [pen blue fill-pen blue box 0x0 0x0]]
		data:	0
		font:	none
		para:	none
		feel:   make feel [
		    redraw: func [face act pos] [
		        if act = 'show [
		            face/data: min 1 max 0 face/data

              face/effect/draw/box: to-pair reduce [to-integer face/size/x * face/data 
              face/size/y]
		        ]
		    ]
        ]
    ]
Ashley
4-Mar-2005
[55]
1) Terminology: I'm starting to gravitate towards Window, Face, Attribute, 
Widget and Feel.

2) Widgets: will have simple VID-like names; e.g. button, icon, image, 
bar, progress, etc ... I'm compiling a list of the required base 
widgets and will publish here for discussion when done

3) Facets document: updated 'restore, 'activate and 'edge/image descriptions

4) Vincent's 'progress widget ... exactly what I was after; added 
it to next build

Did I miss anything? ;)
Vincent
4-Mar-2005
[56]
just a detail: in facets document, /span datatype is pair! . you 
could use it to store other data, but if you set a pair! to /span, 
/view will use it as virtual size for face (it still works in later 
betas, so one should be careful to not use it to store coordinates) 
ie:
f: layout [
   banner "Testing /span" guide 
   box 400x400 effect [gradient 1x1 0.0.0 255.255.255] 
   button "Hello!" return 
   text-list data ["just" "a" "list"] 
   image logo.gif logo.gif/size * 2
]

f/span: f/size  ; here we tells /view to use virtual coordinates 
for all subfaces

view/options f 'resize ; will give a fully resizable window (widgets 
included), but it only works for reducing window's size.
Ammon
4-Mar-2005
[57]
That's an interesting effect!
Vincent
4-Mar-2005
[58]
with it, a program designed for a 1024x768 display can work on a 
640x400, or even a 320x200 screen :-) there's a known bug in /view 
betas with alpha channel, the transparency use real coordinates, 
not virtuals.
Ashley
5-Mar-2005
[59x2]
Good diagnosis. I knew assigning a pair! to span did *something*, 
I could never quantify exactly what though. As Ammon said, an interesting 
effect but somewhat useless in an age where screen ratios are all 
over the place and resizing needs to occur both vertically and horizontally.
First stab at a list of required base widgets

	area
	bar
	box
	button
	check
	droplist - text display + drop-down list
	editlist - edit box + drop-down list
	field
	groupbox - encloses a group of gadgets in a titled border
	icon
	image
	list – single column
	listview – multi-column
	progress
	radio
	scrollbar

 spliter – a “spliter window” which affects the width / height and 
 position of other gadgets
	tab -  arranges multiple gadgets into logical groups
	text
	slider
	treeview

 updown – scrollbar minus the bar (used with a field to increment 
 / decrement numbers, etc)
	menu
	popup-menu - context menu
	status – status bar with one or more “segments”
	toolbar


The aim is to have as few widgets as neccessary to build the majority 
of required GUI's. Take a look at the applications you use on a day 
to day basis, what widgets do they use? Are they in the list above? 
How are they named? Are there any widgets in the above list we can 
do without? (not that *someone* won't need it, just that it isn't 
common enough to be part of the base widget set).
Graham
5-Mar-2005
[61x2]
tabbed panels
use them all the time
Gregg
5-Mar-2005
[63]
As long as there is a glossary that let's you translate from familiar 
terms, I think you're OK using REBOL's native terms, though they 
were foreign to me when I started.

Window or dialog?

 Or Screen or Form or Layout. A Dialog is usually something other 
 than the main screen in an app. You sometimes need to use all those 
 terms if you're speaking in the domain of an application, so use 
 wha'ts appropriate in each context. 

Face or graphical object?

 Or Control or Widget. Tough call on this one. I was used to Control 
 from VB, and Face confused me as it could be a layout as well. I 
 like distringuishing between layouts and controls. Hmmm Maybe a hierarchical 
 tree.

Facet, attribute, property or descriptor?

 I like either Attribute or Property. I can live with Facet in REBOL, 
 it's shorter, and it makes sennse if you think in terms like "let's 
 discuss this facet of the business". 

Style, widget or template?
	Style, definitely.
eFishAnt
5-Mar-2005
[64]
Styles (and Stylize) are also a user-friendly way to get massive 
code-reuse, as well as being the widgets... maybe widget-styles (I 
have seen people say VID-styles before) or something like that could 
describe subsets of styles in use...VID is a package of styles...(just 
some outloud thoughts)
Vincent
5-Mar-2005
[65x4]
bug: the last widget in a rebgui layout determine the width of the 
face - if the last widget is narrow, the window is narrow.

fix: in %display.r, you have to keep track of the maximum x value:

- near "xy: origin-size" you can initialize a 'max-width: "max-width: 
origin-size/x"

- in parse loop, just after xy update "xy/x: xy/x + last-face/size/x", 
you can update the 'max-width: "max-width: max max-width xy/x"

- after (outside) the parse, near where the y size is last updated 
"xy/y: xy/y + last-face/size/y", you can set the x size to be the 
'max-width: "xy/x: max-width"
(it fixes the "crash if 'return is the last word in specification" 
bug too)
for widgets, I would add a basic 'anim - it's just too easy to implement 
to miss it (ie. a looping anim widget) :
anim: make face [
	    image:  none
	    rate:   1
		edge:	none
		font:	none
		feel:	make feel [
			engage: func [face act event] [
			    if event/type = 'time [
			        face/image: first face/data

           face/data: either tail? next face/data [head face/data][next face/data]
				    show face
	    		]
 		    ]
		]
	]
DideC
5-Mar-2005
[69]
editlsit = droplist with a read-only mode in the field IMO
shadwolf
5-Mar-2005
[70x2]
for droplist the edit field must have an auto completion according 
to entries in the dropped list
example you have paris, boston, new-york in the list you type "ne" 
it"s completed automatically by "new-york"
DideC
5-Mar-2005
[72]
There is auto-fill on R-forces Rebsite.
Vincent
5-Mar-2005
[73x3]
a 'check with 'text in one face :
check: make face [
    edge: none
    data: false
    para: make para [origin: 14x0]
    effect: copy [draw [
        pen 96.96.96 fill-pen 255.255.255 box 0x0 12x12
        pen none line 0x7 5x12 11x0 line 0x6 6x12 12x0
    ]]
    feel: make feel [
        redraw: func [face act pos][
            if act = 'show [

                face/effect/draw/9: either do face/data [255.0.0][none]
            ]
        ]
        engage: func [face act event][
            if event/type = 'down [
                face/data: not do face/data
                show face
            ]
        ]
    ]
]
usage: 
check [
    text "a label"
    size 100x15
    data true
]