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

World: r3wp

[!REBOL3 GUI]

Maxim
15-Jan-2011
[5206]
preventing something to resize bigger is always frustrating to me, 
in any software.
Ladislav
15-Jan-2011
[5207]
the problem with max size is scaling the extra-space.  it never ends 
up scaling, quite right.
 - again, did you see some of the examples?
Maxim
15-Jan-2011
[5208]
I haven't had time to play a lot with the latest R3.  though my notes 
are general in nature.
Henrik
15-Jan-2011
[5209x2]
I've never, ever found MAX-SIZE useful for anything, because it doesn't 
fit intuitively in a layout situation, where there are much simpler 
means to produce a similar result. I suppose it makes sense for Carl 
in his old resize system, where MAX-SIZE was (shudder) tied to weighting, 
which produced some completely unpredictable results.
MIN-SIZE makes perfect sense, though.
Maxim
15-Jan-2011
[5211]
yes, its actually required, there is no way to design resising without 
it.
Ladislav
15-Jan-2011
[5212x2]
Well, relating MAX-SIZE to weithting was a bad idea, and we corrected 
that.
I haven't had time to play a lot

- then don't, just pick one example, try to resize the window, and 
see how it works.
Maxim
15-Jan-2011
[5214]
what examples?
Ladislav
15-Jan-2011
[5215]
E.g. one of the examples in the gui-panels.txt
Maxim
15-Jan-2011
[5216]
do you guys have an html version of that?  I don't have mdp setup.
Ladislav
15-Jan-2011
[5217x2]
no html needed when you just need to copy a part of it and do
...and, it is not mdp
Maxim
15-Jan-2011
[5219]
seems to work good, nice work.
Ladislav
15-Jan-2011
[5220]
thanks
Pekr
16-Jan-2011
[5221x2]
Ladislav: ""I can see you use empty rows...Aren't we wasting memory 
here?" - how can an empty row waste memory?" - :-) This is misunderstanding 
:-) My question relates to my previous discussion with Cyphre, about 
removal of 'faced element. Previously, we had facets, and faced (instance 
locals). Cyphre pointed out, that now everything is instance local, 
and goes into facets. If you want stuff to be shared, new 'intern 
slot should be used.


And that was my question - I can't see intern used anywhere in the 
stlyle definitions. What I noticed is, that in the facets blocks, 
stuff is somehow visually separated by empty rows. Hence my question 
- if I see things like min-size, max-size - aren't those a good candidate 
for items being shared? And if those are not shared (referenced), 
we are kind of "wasting" memory here. I think that it will not be 
significant though ...
In general, if you don't want to use the RETURN keyword, don't use 
the *group styles, they are designed *for the purpose* of supporting 
the RETURN keyword

 - not a big deal, really. My problem is, that what I want is behaviour 
 of panel style, but without gfx borders. But - I could create new 
 style, removing the visual elements of panel. Maybe such a style 
 could be added by default, but not sure others would find it usefull, 
 nor do I know what name to use ...
Ladislav
16-Jan-2011
[5223x2]
Well, empty rows in the source code are just means to organize the 
text anyway ;-)


Regarding your MIN-SIZE and MAX-SIZE - those aren't shared, since 
I thougth (and still think), that it is necessary to allow for every 
face to have individual MIN-SIZE and MAX-SIZE
Example: it is expectable, that two panels have different MIN-SIZE 
and MAX-SIZE, especially if their contents differ
Pekr
16-Jan-2011
[5225]
Really? E.g. think about buttons. I think that all buttons will share 
those values, no? But anyway - this is just speculation on my part, 
and call for "premature optimisations". In fact I don't know how 
to measure memory consumption (even if we have stats function) of 
an object, which has two more fields (slots) plus values. Then you 
can count average number of instances your app has, and you can guess, 
how much more memory your app is going to use. I expect it being 
just KBs ....
Ladislav
16-Jan-2011
[5226x2]
Of course, some styles might "prefer" to use the same MIN-SIZE/MAX-SIZE 
for all their faces, but it is not a general property.
(as demonstrated for panels)
Pekr
16-Jan-2011
[5228x2]
Ladislav - did not read all your posts here, but as you are here, 
and for me to proceed - how do I "easily" create panel, if I have 
layout stored in a block? Carl's demo uses:

view-sub-panel: funct [
	index
	main-pan
	desc
][
	set 'current-panel index
	set-face desc form pick test-notes index
	pan: pick test-panels index
	unless pan [
		pan: make-panel 'group pick test-blocks index [columns: 1]
		poke test-panels index pan
	]
	switch-panel main-pan pan 'fly-right
]

his

 make-panel used three values. OK, options block is not needed, nor 
 supported right now. Function attributes are now reversed (dunno 
 why, the argument order is not compatible with make-face for e.g.). 
 That is still easily fixable. But now "rma's" make-panel accepts 
 face, not dialect block. I tried to use make-face on a dialect block, 
 but no luck ....
I simply need to fix this line: "pan: make-panel 'group pick test-blocks 
index [columns: 1]", if possible. Henrik suggested that the aproach 
is different, and that I should use 'content functions, which I know 
nothing about yet.
Ladislav
16-Jan-2011
[5230]
Maybe such a style could be added by default, but not sure others 
would find it usefull, nor do I know what name to use ...

 - yes, that is possible. The difference between original, Carl's 
 implementation, and the new one is, that you have all the box model 
 attributes accessible, so you can do it easily now on your own.
Pekr
16-Jan-2011
[5231x2]
re min/max-size, here's my take. I don't mind having both, not a 
big deal for me. But - when I tried Carl's examples back then,I tried 
on my nice Samsung FullHD TV. I maximised the screen, and wondered, 
why the heck fields don't resize properly. Then I found out, that 
their max size was set to 900 pixels. I asked Carl - why? And he 
told me, that fields should not be long, or it does not look nice 
anyway. So - as I know myself, my intention for max-size for the 
years to come will always be to cover FullHD displays. But as you 
can see, then it is artificial - I will simply use values, just to 
avoid effect I had with Carl's example.


As for min-size - I was negatively surprised by its removal, because 
I wanted panel of certain min-size to be displayed. But - I found 
there is new item, called initial-size, which fixed the situation 
for me ...
btw - can someone confirm the rendering "bug" with simple example? 
I can see the black box next to "test" text, which is transparent, 
and I can see underlying window content.Resizing causes redraw, and 
corrects it. It still should not happen imo though ...

view [hpanel [text "test"]]
Henrik
16-Jan-2011
[5233]
And he told me, that fields should not be long, or it does not look 
nice anyway.

 The problem is that you can't solve the maximum size restriction 
 issue of a nice-looking interface, by using a MAX-SIZE at the style 
 level. Such a problem would be at a higher layout level and much 
 easier for the UI designer to solve at the layout level. There is 
 simply no reason to have it.
Maxim
16-Jan-2011
[5234x2]
yes, and R2 does the same btw... strange
(that was a reply to pekr)
Ladislav
16-Jan-2011
[5236x5]
Regarding the

	unless pan [
		pan: make-panel 'group pick test-blocks index [columns: 1]
		poke test-panels index pan
	]

code, you should be good with:

	unless pan [
		insert-panel-content/pos/no-show test-panels compose/only [
			pan: hpanel 1 pick test-blocks index
		]
	]
sorry, forgot the paren:

	unless pan [
		insert-panel-content/pos/no-show test-panels compose/only [
			pan: hpanel 1 (pick test-blocks index)
		]
	]
and the index:

	unless pan [
		insert-panel-content/pos/no-show test-panels compose/only [
			pan: hpanel 1 (pick test-blocks index)
		] index
	]
aha, insert is probably not good, since it does not replace the previous 
content - well, the problem is, that change does not work for gobs 
yet, so you need to remove and insert, until change is corrected 
for gobs
or, looking at it, we could temporarily make a work-around, until 
change is corrected
Pekr
16-Jan-2011
[5241]
I will try after the lunch :-) The "poke" above should still be there, 
Carl imo stores already used "forms" with their last values in temporarily 
block called test-panels....
Ladislav
16-Jan-2011
[5242]
Did you have a look at the panels-20.r3 file?
Henrik
16-Jan-2011
[5243]
Do we have a good documentation on how SHOW or screen updates occur? 
There is little point in the user having to figure this out himself 
to optimize display for speed.
Ladislav
16-Jan-2011
[5244]
Another option is to use something like:

pan: make-face 'hpanel [columns: 1]
insert-panel-content pan pick test-blocks index

, etc...
Pekr
16-Jan-2011
[5245x2]
OK, I looked at it now, thanks for pointing that out. I downloaded 
it some time ago, it is not part of the distro, so I forgot about 
those tests ...
btw - I expect that you guys surely know what you do, and so far 
my gui understanding is still minimal :-) But anyway - was there 
really a need to make make-panel internal? Except for the options 
block, I found it nice, that you can easily create panel from the 
stored layout block, just by one function ....
Robert
16-Jan-2011
[5247x3]
Then I found out, that their max size was set to 900 pixels. I asked 
Carl - why? And he told me, that fields should not be long, or it 
does not look nice anyway.

 - This is the main problem I have with VID and the "official" GUI 
 stuff. If I want it that way, I want it. I don't need a framework 
 that makes my life hard. There are zillions of things people want, 
 and others don't like. For commercial apps, we need to deliver what 
 the customer wants, not what we think is best.
And, to do this, all parts of the GUI must be accessible and able 
to describe. Hence, MIN-SIZE & MAX-SIZE make sense on a face level. 
If I need to specify it, at least I can.
Our GUI will not be a toy. It's not for people just starting to play 
around. R3 needs a full blown commercial & enterprise app enabled 
GUI framework. Otherwise it will stay a toy no one cares about.
Pekr
16-Jan-2011
[5250x3]
Robert - agreed - as much as there is a way to override some "defaults" 
by the stuff I want, I am mostly OK. Of course I still care for things 
being easily useable, if possible ...
Is 'switch-panel supposed to work? I get error on the following line:

new-panel/gob/offset: margin
it breaks in the following demo function:

view-sub-panel: funct [
	index
	main-pan
	desc
][
	set 'current-panel index
	set-face desc form pick test-notes index
	pan: pick test-panels index
	unless pan [
		pan: make-face 'hpanel [columns: 1]
		insert-panel-content pan pick test-blocks index
		poke test-panels index pan
	]
	switch-panel main-pan pan 'fly-right
]
Nicolas
16-Jan-2011
[5253]
I think Faced should be renamed Local. What do you think?
Maxim
16-Jan-2011
[5254]
I find other names better, like content or collection.
Nicolas
16-Jan-2011
[5255]
Content isn't bad, but I think local is more descriptive.

http://www.rebol.com/r3/docs/gui/styles.html#section-19

The faced block is similar to facets block, but makes them local 
to each instance of the face. Now, they can be modified without effecting 
any other faces that are of the same circle style.