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

World: r3wp

[!REBOL3 GUI]

Henrik
8-Mar-2011
[6643]
And, what about tagging? How do you discern a visible frame from 
an invisible one, in case we decide that skins should rely on tags?
Pekr
8-Mar-2011
[6644]
tagging is good. But it is just another way of how to make options. 
Other is regular facet fields ...
Henrik
8-Mar-2011
[6645]
Tagging is neither facets nor options. They are information that 
usually relates to the GUI system to describe the state and capability 
of the style.
Ladislav
8-Mar-2011
[6646x3]
To Pekr - here is a layout you might not know how to lay out:

stylize [lab: label [align: 'right]]

view/options [
	hpanel 2 [
		lab "name: " field
		lab "last name: " field
	]
	hpanel [button button button]
][break-after: 1]
correction:

stylize [lab: label [facets: [align: 'right]]]

view [
	hpanel 2 [
		lab "name: " field
		lab "last name: " field
	]
	hpanel [button button button]
]
but, this is somewhat "indirect", and it should be possible to do 
otherwise
Pekr
8-Mar-2011
[6649]
as for your examples - this is method I used before. I thought that 
you might find a way of how to do it in terms of just one panel, 
which is not imo possible?
Cyphre
8-Mar-2011
[6650]
Pekr, we don't have cascade styles...do you think this would be worth 
doing?
Pekr
8-Mar-2011
[6651]
I am not sure what exactly you do mean? The ability to inherit or 
redefine particular parts of the style?
Cyphre
8-Mar-2011
[6652x2]
BTW you can do it for one panel this way for now:
label-right: [align: 'right]

view [
	hpanel 2 [
		label "name: " options label-right field
		label "last name: " options label-right field
	]
	hpanel [button button button]
]
Pekr
8-Mar-2011
[6654x3]
Guys - to make it obvious - I can find out the way of how to make 
things work. I was just curious, if mine example could be done in 
some easy way. I hope you don't take it as a complaint.
Cyphre - your method is OK with me, with just a small note, that 
I would welcome the option to have borderless panel in the case of 
buttons in your above example ....
But everything is solvable ....
Cyphre
8-Mar-2011
[6657]
cascading styles: I meant you could write for example:

stylize [
	#my-panel label [
		facets: [
			align: 'right
		]
	]
]

view [
	my-panel: hpanel 2 [
		label "name: "field
		label "last name: "field
	]
	hpanel [button button button]
]
Pekr
8-Mar-2011
[6658]
hmm, interesting :-) I am curious what others think. It kind of adds 
another level of possibilites into the system, but maybe it makes 
it a bit more complicated too? :-)
Cyphre
8-Mar-2011
[6659x2]
borderless panel: we are working on a feature that makes the box 
model configurations easier to use
cascadign: that's how CSS works with HTML
Pekr
8-Mar-2011
[6661]
Hmm, I can't imagine, how should it work? Because on the low level, 
there is just a face, and a gob. So how do you internally distinguish, 
if the panel is separate, or nested in my-panel, and hence needs 
to use different styling?
Cyphre
8-Mar-2011
[6662x2]
the implementation id different topic...the question is though: do 
we need such feature?
id=is
Pekr
8-Mar-2011
[6664]
It depends - I would welcome more broader input here. But I am not 
sure much ppl will contribute here :-(
Cyphre
8-Mar-2011
[6665]
anyway, this is not hi-priority at the moment...just something to 
think about.
Pekr
8-Mar-2011
[6666x2]
The reason why I might be interested in inmplementation detail is, 
that maybe I will be style author too, and hence I would like to 
know, how things get complicated in the low level. So in your above 
example - what does stylize do? Does it create internally named label 
style, to keep its visual configuration somewhere? And then during 
the layout phase, you would have to check on nesting, and use  those 
internal styles in the low-level?
There are two concepts, which might be helpfull (maybe it is one 
concept?):


1) having the same style in various sections of your GUI styled differently


2) having the option to style differently the same style in the same 
level (that can be done by options)
Cyphre
8-Mar-2011
[6668]
There are multiple ways how to doit....But If you are going to be 
style author you just need to know the syntax used in stylize command, 
nothing more ;)
Pekr
8-Mar-2011
[6669]
ad 2) e.g. my example of having panel style, with borders, without 
the borders ...
Ladislav
8-Mar-2011
[6670]
re "I thought that you might find a way of how to do it in terms 
of just one panel" - it is possible to do it in "just one group". 
Do not forget, that R3-GUI H/Vgroups are more similar to R2 layouts 
than R3-GUI (H/V)panels.
Pekr
8-Mar-2011
[6671x3]
I am trying to come up with usage cases here ....
I think (and maybe I am wrong), that even with VID we kind of had 
cascaded styles. If you needed different style configuration, you 
used stylize, and stored new config under different name, e.g. H1, 
H2, H3, LAB in above example, etc.


While CSS allows you to use just one name, and multiple styling set-ups. 
The question is here, how you identify it in the layout flow, what 
set-up should you use, and if it would be obvious. In CSS, you have 
ID, CLASS helpers ...
I mean "if it would be obvious looking into the layout source code"
Cyphre
8-Mar-2011
[6674x2]
Pekr, I think you are wrong here...I suggest to study for example 
this: http://css.maxdesign.com.au/selectutorial/
(especially the 'selectors' part)
Pekr
8-Mar-2011
[6676]
I have not intention right now to burry deep into CSS, as I think 
I know enough to understand consequences. Your "you are wrong here" 
does not work for me :-) Wrong in what aspect? I still think, that 
I do understand how you style html pages :-)
Cyphre
8-Mar-2011
[6677x2]
By 'you are wrong' I meant your understanding whe 'cascading styles' 
really are is a bit blurry...if you check the 'selectors' section 
you'll see that this topic can be a bit more complex.
And the question still stands the same: Do we really need this? If 
so do we really need it all? If not what we really need? :)
Pekr
8-Mar-2011
[6679x2]
CSS is clearly much more flexible in setups. You use tree of definitions, 
which are then applied in particular cases in document hierarchy. 
 If I am not mistaken, right now we don't have no easy way, of how 
to make e.g. first button in a last row of the panel e.g. red, unless 
you first define red button, and use it in the source of the layout 
:-)
If we need it? Who knows. Maybe not for the business graphics. Maybe 
so, if we would like to make model closer to CSS, from various reasons 
...
Cyphre
8-Mar-2011
[6681]
yes, no hi-priority at the moment...
Pekr
8-Mar-2011
[6682]
Cyphre - I can simply imagine, how we extend stylize to allow such 
definitions. But - in terms of html, you have IDs, CLASSes, and you 
have also the document tree, so you might know, where to apply which 
part of an CSS. What I can't imagine is - we have layout flow ... 
and no ID, CLASS definitions, we also don't keep tree information 
of the layout (faces), or do we? So how do you instruct, in your 
layout, that first button in the panel should use button-red definition? 
Just curious about what possibilities there are :-)
Rebolek
8-Mar-2011
[6683]
why ID, when you can call face directly? And of course there's tree 
of gobs, that's how gobs works.
Maxim
8-Mar-2011
[6684]
I've done a few quite complex CSS setups working with jquery, and 
at some point, CSS selectors become very brittle because the priority 
rules become a bit hard to properly prioritize.   


To reflect this, in some setups not all browsers actually match the 
same CSS selection rules.
Pekr
8-Mar-2011
[6685]
Rebolek - what has an ID in common with the face name? Short answer 
- nothing :-)
Henrik
8-Mar-2011
[6686]
In R3 GUI, style names themselves act as classes, where in HTML you 
have a fixed set of tags that need to have classes. IDs are set-word!s, 
so there is no need to add any superfluous layer to identify specific 
faces.
Maxim
8-Mar-2011
[6687x2]
Henrik, not quite.


using CSS you effectively "tag" your gui and then you can apply effects 
to multiple types of things which match a tag or pattern.
a tag is a cross-cutting concept, not a family or class/type  like 
concept.
Pekr
8-Mar-2011
[6689]
OK, let's say set-words can simulate IDs, then Rebolek is correct, 
sorry.
Cyphre
8-Mar-2011
[6690]
yup, Rebolek was right.
Henrik
8-Mar-2011
[6691]
Maxim, this is necessary in HTML, because of the fixed naming of 
HTML tags. set-words in the R3 GUI do this.
Pekr
8-Mar-2011
[6692]
But - it might be a bit different anyway. If you make b1: button, 
it is a set-word, a name. And now how do you use stylize, to refer 
to such a name? Stylize creates new style name, e.g. b1, but that 
is direct name for the style itself