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

World: r3wp

[!REBOL3 GUI]

Henrik
11-Mar-2010
[1194]
Anyhow, a form like this:

http://rebol.hmkdesign.dk/files/r3/gui/196.png

can be set in one line of code and retrieved in one line of code.
Pekr
11-Mar-2010
[1195x2]
Nice! Henrik - one question. In Zachary app generator I used in DOS 
era for Clipper, there were basically two options, of how to initialise 
form - 'new, and from DB. Simply put - you set-up new record, and 
you want to have some items to be pre-filled with some default values. 
Is that possible with your concept?
Nice "skin" too :-)
Graham
11-Mar-2010
[1197]
I used Genifer for dBase and Clipper
Henrik
11-Mar-2010
[1198]
Currently the form is bound to one record. Good question, btw. on 
new item. It's simple to do in principle, but I think it requires 
a clearly defined set of functions (reactors) for simple db operations:

I guess one wants these reactors (names not finalized):

emit - get data out of form to table. Done.
obtain - get data from table into form. Done.
next - next record
previous - previous record
first - first record
last - last record
new - new record
delete - delete record
Pekr
11-Mar-2010
[1199]
In Zachary I really liked one feature. There was subtale, where you 
defined On-update ... simply you could add multiple to-update records. 
So - you e.g. added 5 iPhones to stock. The field has registered, 
that on-update updates stock amount. If you deleted order, it was 
automatically withdrawn from the stock ... etc.
Henrik
11-Mar-2010
[1200]
there is also the case for displaying multiple records in one form. 
I've solved that in the VID Extension Kit, by providing an alternative 
form with fields that are disabled. clicking a checkmark enables 
the field and lets you set a value. when the value is set and you 
submit, the involved records have that value updated.
Pekr
11-Mar-2010
[1201x2]
When will we be able to build more complex styles, as tabs, grids? 
I mean - is all infrastruture inside already?
I do remember how I disliked one simple draw block (one gob) to represent 
a style. IIRC BrianH said, that multiple gob styles are possible. 
Would that be a hack? Or is method already supported?
Henrik
11-Mar-2010
[1203x2]
You still use a single draw block, although you can switch between 
different draw blocks for one GOB. One thing I don't want, as a style 
writer, is also to have to manage the GOBs as well. That makes it 
significantly more difficult to write styles, but I suppose there 
will be special styles coming around where you can use dialects like 
MAKE-GOB to freely define what's inside that style.
tabs: we already are able to switch between panels and need a button 
panel for doing this.
grid: big job and cyphre has already volunteered. :-)
Pekr
11-Mar-2010
[1205x2]
ah, fine. Hope that he will use some of mine outlined Rebgui grid 
- virtual rows/columns, so that you can use raw data block directly 
from SQL query, no need to rebuild it into special block. Very usefull 
...
btw - docs are geting better and better. Draw and Shape docs were 
added recently. Gobs too ...
Henrik
11-Mar-2010
[1207]
Has anyone taken a look at Active Records? It looks quite interesting.

http://ar.rubyonrails.org/
Pekr
11-Mar-2010
[1208]
This is quite this kind of nonsense I thought we could avoid :-) 
You simply often might find the case, where it will not fit your 
situation, and then docs say - you can't do everything, using the 
concept. So then you are left with some usefull, but not-in-100%-cases 
usefull case, and between the raw solution. IIRC Chis has similar 
solution with his system? I don't remember the name .... however 
- this does not belong in the GUI group, and this is exactly where 
I thought your form  abstraction aproach will lead you :-)
shadwolf
11-Mar-2010
[1209]
To carl concerning the timing problems noticed on my computer i got 
those result (windows seven; CPU core i 5 750, DRR3 1333 Mhz; R3 
a 97)

>> dt [loop 10 [wait 0.0001]]
== 0:00:00.000016

>> dt [loop 100 [wait 0.0001]]
== 0:00:00.000084

>> dt [loop 1000 [wait 0.0001]]
== 0:00:00.000783

>> dt [loop 10000 [wait 0.0001]]
== 0:00:00.007763


As you can see on my coputer my timings are lower than expected so 
sthis issue is related to CPU horse power.
Steeve
11-Mar-2010
[1210x2]
Not the problem, try this instead, it should return around the same 
time, not the case.


>> repeat i 6 [print [n: 10 ** i "x" j: 0.1 ** i tab "=" dt [loop 
n[wait j]]]]
10.0 x 0.1			= 0:00:01.000137
100.0 x 0.01			= 0:00:01.00159
1000.0 x 0.001		= 0:00:01.023774
10000.0 x 0.0001		= 0:00:00.044802 (strange)
100000.0 x 0.00001		= 0:00:00.459103 (here too)
1000000.0 x 0.000001	= 0:00:05.503772
Conclusion, never use timer below 0.001
BrianH
11-Mar-2010
[1212]
I'll go with Carl's conclusion: It's a bug.
Henrik
11-Mar-2010
[1213]
hmm... when writing a reactor, you can specify any-type! as an argument, 
but GUI parsing halts when encountering a path! for that argument. 
Does anyone know if this is a DELECT thing?
Steeve
11-Mar-2010
[1214x3]
yep, delect is used for
path are evaluated by delect, they can't be used as parameter.
lit-path works
Henrik
11-Mar-2010
[1217]
ok, thanks
Steeve
11-Mar-2010
[1218]
strangly, get-path! works too
Henrik
11-Mar-2010
[1219]
I didn't think that it wouldn't work, since this is inside the dialect 
and so the path shouldn't be evaluated.
Steeve
11-Mar-2010
[1220x2]
well, word are evaluated as-well if they are used for parameters
if they wasn't we counld not use variables in our draw blocks
BrianH
11-Mar-2010
[1222]
The dialect itself evaluates some stuff.
GiuseppeC
11-Mar-2010
[1223x2]
Henrik, I admit I have not read the whole discussion but I have a 
question:
Does this system caches data somewhere before updating the record(s) 
or data is immediately written on the record field ?

When an user edit a file it must be checked for proper input

When multiple fields are edited they may have a relationship on consistency 
and there is a mutual validation

When you save the recordset  there could be errors on writing and 
the whole transaction need to be discarded instead of being partly 
written.
Henrik
11-Mar-2010
[1225x2]
validation is not a part of the UI yet, but it will be.
the idea is simply not to submit the data until the form is validated. 
I've not decided yet, but validation could be a reactor, the way 
things are shaping up right now.
Chris
11-Mar-2010
[1227]
P: Validation ('import) and Active Record (RoughCut) are essential 
components of QM.  Validation (along the lines of 'import) could 
easily be part of a panel/layout's specification...
GiuseppeC
12-Mar-2010
[1228]
Ok Henrik, please do not forget a "record modified" trigger for the 
UI. In multiuser enviromnent it is really useful to know if the record 
has been modified by someone else.
Henrik
12-Mar-2010
[1229]
hmm.. yes, will see what can be done.
Pekr
12-Mar-2010
[1230x2]
any new screenshots? :-)
Henrik - what was last status of resizing? Carl admitted, that resizing 
is broken. But I do remember some discussions about using different 
model to Carl's choosen one. And btw - is 'max-size requirement still 
there?
Henrik
12-Mar-2010
[1232x2]
resizing has not changed yet. it's pretty isolated so we can choose 
to fix that if Carl doesn't get to fixing it. no real show stopper 
yet, other than it's annoying to look at.
screenshots: not really anything interesting. it's the same as before, 
only I'm working on how to error handle reactors. some reactors, 
I think, should be handled in a more friendly way than currently 
(simply crash).
amacleod
12-Mar-2010
[1234]
So we can start using R3-GUI and expect minor changes to use and 
implimentation?


I thought there was going to be some major changes yet to come and 
present functionality might change significantly...
Henrik
12-Mar-2010
[1235]
we change one thing at a time.
amacleod
12-Mar-2010
[1236]
So if I follow the new docs i'm pretty safe?
Henrik
12-Mar-2010
[1237x2]
last I read them a couple of days ago there were some inaccuracies 
compared to Carl's version, so I don't know if he's doing any of 
his own changes.
but general concepts like actors, reactors, faces, styles, etc. shouldn't 
change. it's smaller details that are a little different, like function 
names.
Steeve
12-Mar-2010
[1239x2]
recycle/ballast 50000
screen: system/view/screen-gob
system/view/event-port: open event://
font1: make system/standard/font [size: 20]
fire: [
	line-width 0.5 pen black fill-pen white line-pattern white 
	text vectorial 0x70 [font font1 bold "F I R E !!!"]
]

insert strokes: skip find fire 'line-pattern 2 rand: [0 0 1 1 2 3 
3 4 4 5]
img: make image! xy: 100x100

show append screen gob: make gob! [offset: xy size: xy image: img]

forever [
	change img copy/part skip img 0x1 100x76
	change strokes random rand
	draw img fire
	effect img [blur difference 2.5.10]
	wait 0.03
	show gob
]
better with:

effect img [blur img difference 2.5.10]
Pekr
13-Mar-2010
[1241]
Steeve - nice effects :-)
Steeve
13-Mar-2010
[1242x2]
i optimized it a litlle bit (removed the "change copy/part image" 
that eats memory)
and the flames are dancing :)