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

World: r3wp

[!REBOL3 GUI]

Pekr
6-Mar-2011
[6518x2]
I remember style of such a name from some prior gui attempts, and 
it used tight spacing between the elements. What I am looking after 
is precise copy of vpanel, hpanel, with just zero graphics, or at 
least different border
I can see there is a backdrop style, but dunno what kind of functionality 
it uses ....
Henrik
6-Mar-2011
[6520]
yes, naming should be:

tight: no spacing, frameless
tightframe(?): no spacing, frame
panel: spacing, frameless
frame: spacing, frame
Rebolek
6-Mar-2011
[6521]
it's windows backdrop, kind of special style
Henrik
6-Mar-2011
[6522]
Pekr, backdrop is the window back drop. it's automatically added 
to any window to force proper redraw of the entire window frame.
Pekr
6-Mar-2011
[6523]
hmm, there seems to be so much of colors, etc. I sometimes almost 
feel, that we overload GUI once again. In R2, there was a face. We 
introduced gob, as a means of having smaller object in memory. In 
fact, there is a face linked to each gob, no? And just print recent 
styles structure - it is now bigger than R2's face. And you also 
don't use 'intern for things which could be shared between the instances 
= wasting memory again?
Rebolek
6-Mar-2011
[6524]
You're confusing GUI with graphical subsystem. In R2, face was used 
in graphical subsystem, R3 uses gob! instead. Face in R3GUI stores 
all GUI-related informations and cannot be compared with R2 face.
Pekr
6-Mar-2011
[6525]
R2/View starts at 7.4MB here. And running RebGUI Tour.r (containing 
all styles), goes to 16MB. R3 starts at 2.4MB, running all-styles.r3 
goes to 11.8 MB
Henrik
6-Mar-2011
[6526]
Also, the size of the face structure is not at question. It hardly 
eats any memory, a few bytes at worst.
Pekr
6-Mar-2011
[6527x2]
Studying GUI I have following psychological problem - I never know, 
what possible elements it might contain. The problem is evident, 
when you create style using stylize. Even Carl was aware of that, 
and e.g. for actors he created comments, so that user know, what 
argument it takes. Looking at various styles, I always wonder, if 
I can make any facet I want, or is there any MEGA FACE object, containing 
all possible fields? :-)
e.g. look at button facets:

	facets: [
		init-size: 28x28
		bg-color: 80.100.120
		border-color: 0.0.0.128

		pen-color: ; set by on-draw
		area-fill: ; set by on-draw
		material: 'chrome
		focus-color: red
		draw-mode: 'normal
		materials: none
		face-width: none
	]
Henrik
6-Mar-2011
[6529]
There is no limit to what facets you can create, but facets are inherent 
to the style as tools for storing intermediate information for draw 
blocks, states, etc.
Pekr
6-Mar-2011
[6530]
so many colors above. I wonder if draw blocks, containing drawing 
info, should not contain static varialbe definitions? E.g. focus-color 
relates only to the draw mode, when button is in focus.
Henrik
6-Mar-2011
[6531]
So you want to create additional contexts, such as SIZE? Then you 
would have size/init instead of facets/init-size. Is that what you 
mean?
Pekr
6-Mar-2011
[6532x4]
I am not sure, just brainstorming loudly. I can as well push my brain 
to accept the fact, that face/facets is a junk block, containing 
whatever you want ....
we should at least segment the code by empty lines
And now you introduced another group of settings:

			;turn auto-sizing on		
			init-hint: 'auto
			min-hint: 'auto
			max-hint: 'auto
btw - I am not sure "hint" is a good name? I know term hinting, being 
related to fonts. But - above is the way - group values together, 
add comment, use empty line as a separator from other group of settings 
...
Henrik
6-Mar-2011
[6536x2]
By creating new contexts, we would have to have an advantage to using 
them. In a way, I don't mind it, as it could be used to apply particular 
groups of facets, in a standardized way, so you know that a particular 
context will have these items. But FACETS does technically not prevent 
this. From a technical perspective, I'm not sure I can find an advantage, 
since there is no difference from R3's perspective on speed or efficiency 
in accessing size, color or hinting information.

However, I can see the following groupings or contexts:

- color
- hint
- size
hint and size would be standardized map!s, as they are used by the 
system.
Pekr
6-Mar-2011
[6538]
you would have to access them by path, not sure how it would look 
like in the source-code, as in draw block? e.g. pen color/pen-color?
Henrik
6-Mar-2011
[6539]
you would say: color/pen. not much difference in typing.
Rebolek
6-Mar-2011
[6540]
yes
Pekr
6-Mar-2011
[6541x2]
if you look into box model, items are grouped too (well, because 
they contain identical field names). Anyway - you have another food 
for thought, I am just not sure if it would help the understanding 
or clarity of the code, it depends ....
btw - when I met Ladislav, I asked him, why there is a face/gob, 
and face/facets/gob, and he was not sure it is like that IIRC. Later 
on I checked it, and it is really like that. But I don't remember, 
if he gave me an answer - are those identical gobs? Why I am seeing 
them in two places, when I mold the face?
Rebolek
6-Mar-2011
[6543x2]
Yes, they are two identical gobs a the reason why it's also in facets 
is binding for draw block.
a=and
Pekr
6-Mar-2011
[6545]
so in memory it exists just once?
Rebolek
6-Mar-2011
[6546]
yes
Pekr
6-Mar-2011
[6547]
with prior gui, I could see 'draw-results, or something like that 
in the structure. Was it removed? What was it good for? :-)
Rebolek
6-Mar-2011
[6548]
I am not sure, but I think it's result from translating draw dialect 
to draw commands, this will be simplified later.
Ladislav
6-Mar-2011
[6549x6]
Pekr: 'btw - I am not sure "hint" is a good name?' - actually, yes, 
since the INIT-HINT is a hint (look up the word in the dictionary), 
how the algorithm should determine the INIT-SIZE value
(for a panel)
The 'AUTO hint just tells the algorithm to calculate the panel INIT-SIZE 
"automatically" (= using an algorithm) taking into account the panel 
contents. This means, that you, as a user, do not have to specify 
the panel INIT-SIZE, which might seem less comfortable to you.
Of course, if you know, what is the INIT-SIZE you want to have, you 
can specify it as well using a different hint.
'Yes, they are two identical gobs' - funny, that is a nice contradiction
In fact, you cannot have 'two identical gobs', you can have only 
one
Pekr
7-Mar-2011
[6555x2]
R3 still hard crashes with the GUI :-( unreproducible ....
I have a question towards the aproach to design a form. Following 
code does not work for me (result-wise):

view [hpanel 2 [label "Name:" field button "ok"]]


Simply put - button is on a new row, but it probably causes field 
to align to the right? Or more precisely - button extends the column 
cell, and so the field is pushed to the right in an undesirable (albeit 
expected) manner. Should I put buttons supporing the form out from 
the panel containing fields?
Rebolek
7-Mar-2011
[6557]
you use panel style, so you've got 2x2 grid. "ok" button is simply 
on 1x2 position and 2x2 position is empty. If you don't want grid, 
use group style.
Pekr
7-Mar-2011
[6558]
I don't like the group style :-)
Rebolek
7-Mar-2011
[6559]
why is that?
Henrik
7-Mar-2011
[6560]
the group style is not for forms
Pekr
7-Mar-2011
[6561]
I am just not sure. What I am still confused about is the different 
semantics of particular styles. I wonder, if there could be just 
panel-like semantics, so I could use:

hframe 2 []
hpanel 2 []
hgroup 2 [] ; with no need for return keyword


But that would be limiting to the group style, as it has no cells 
- each row is separate IIRC ....
Rebolek
7-Mar-2011
[6562]
That's why there's different semantics.
Pekr
7-Mar-2011
[6563x2]
But my above example is some food for thoughts. When I think of forms, 
I know that form might be enclosed in some pane (being it group or 
panel or frame I don't care - just visually separated from the background). 
Then it usually contains pairs of labels and fields. Btw - in R2 
it was easy to right-align label - is that possible with R3 GUI? 
And I think that some buttons belong to the form - e.g. Edit, Submit, 
Cancel, and some might belong to the Window.
So the question is, how do I get button visually together with labels 
and fields, not influencing my design? Put buttons into subgroup 
or subpanel?
Henrik
7-Mar-2011
[6565]
yes, buttons should be in a subpanel
Pekr
7-Mar-2011
[6566x2]
Does not work for me:


 view [hpanel 2 [label "name: " field hpanel 3 [button button button]]]
The nice thing is, that I do know, what it does not work, and I do 
know that the behaviour is correct, it is just - undesirable ... 
:-)