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

World: r3wp

[View] discuss view related issues

Gregg
17-Dec-2006
[6394]
Yup. Made that kind of mistake plenty of times.
Anton
19-Dec-2006
[6395x2]
Here's a document (using LAYOUT spec) which tries to explain a proportional 
resizing algorithm.
do http://anton.wildit.net.au/rebol/doc/resizing-algorithm-doc.r
And here's a demo implementation: A HPANEL style implements the algorithm 
(additionally with wrap) and you can play with it by dragging with 
the mouse:

do http://anton.wildit.net.au/rebol/doc/proportional-resizing-example.r
Graham
19-Dec-2006
[6397]
what exactly does the demo do?
Anton
19-Dec-2006
[6398]
Did you try click and drag with the mouse near the bottom of the 
window ?
Graham
19-Dec-2006
[6399]
yeah .. the window resized but nothing inside the window changed.
Anton
19-Dec-2006
[6400]
Click in the window.

It resizes the HPANEL, which then distributes the space inside itself 
to its subfaces.
Graham
19-Dec-2006
[6401]
Oh .. got it!
Anton
19-Dec-2006
[6402]
I am interested to know if people think it's a good system or not, 
with the four limits.
Gabriele
19-Dec-2006
[6403]
anton, what is the advantage of having hard-min, min, max and hard-max?
Anton
19-Dec-2006
[6404x3]
Gabriele, the four limits create, in between them, 3 zones where 
the available space is distributed proportionally. Having three zones 
allows the faces to behave differently depending on whether space 
is at a premium, whether there's an "normal" amount of space, or 
whether there's lots of available space.
(Has anyone ever seen a proportional sizing system with different 
zones like that ?)
The example faces in the demo are a bit abstract from reality, so 
I'll come up with some real-life examples...
Cyphre
19-Dec-2006
[6407]
hmm, I think if you are resizing proportionally the space between 
elements can be also distributed proportionally so no need to care 
about it? But maybe I just didn't get it so looking forward to some 
examples ;)
Anton
19-Dec-2006
[6408x3]
Yes, looking at it again I realise it's too abstract like this :)
Just fixing up the demo so it's easier to change the subfaces.
(Can't upload for some reason... must go to sleep, until tomorrow...)
Gregg
19-Dec-2006
[6411]
A more concrete demo will help, but it's a cool demo none-the-less. 
:-)
Maxim
19-Dec-2006
[6412x5]
anton, Glayout already does this and much more...
and again, its VID based.
GLayout really is only a stylesheet.

with extra hooks included in window managers and stuff.  you hpane 
is the same concept as my hgroup...
if you'd put a little time you could very easily put your vid styles 
within GLayout and benefit from all of this done and debugged for 
the last 2 years... I am using it commercially.
the looks are just a VID skin, you can very easily change that...
Anton
19-Dec-2006
[6417]
Ok, uploaded a new version

do http://anton.wildit.net.au/rebol/doc/proportional-resizing-example.r
Maxim
19-Dec-2006
[6418]
the wrapping is neat :-)
Anton
19-Dec-2006
[6419x3]
So, starting small and increasing the size, you can see the buttons 
have a "compressed" state (hard-min), and they stay compressed until 
the location field reaches its min-size, which is the size at which 
the field has "enough" room for most normal location strings. So 
the field has reached its "preferred minimum" size.
Increasing further, the buttons expand to have enough room on either 
side of their text for some nice visual padding, but they don't need 
to get any wider. It is preferred for the field to get all the space.
Maxim, the problem for me with GLayout is the "and much more...", 
if only because it will take me longer to understand it.
Maxim
19-Dec-2006
[6422x2]
its very simple, really...
but I do understand your point.
Anton
19-Dec-2006
[6424]
I think it's better to be modular. But anyway, maybe you could make 
a small demo which shows how each of Glayout's parameters work:

min-size, def-size, init-def-size, manual-min-size, static-size, 
elasticity, stretch... and any other I do not see.
Maxim
19-Dec-2006
[6425x6]
although having someone like you on the wagon would help cleanup 
GLayout itself... Using it for myself has ironed out many little 
issues in the latest week... I've added some new facets like margins...
as I see your demo I see how these two approaches are similar, in 
many respects.  although I don't have a preset max size...
the way GLayout is built is that it just adds a few hooks where you 
can implement the calls themselves.
the actual attributes are style specific.
so you could implement your hpane directly within GLayout, but you'd 
have an automatic way to call the resizing, for example...
but anyways, I understand that at some point we'd have to get a few 
hours so I could explain (and then document the discussion) on the 
basics of those hooks.
Anton
19-Dec-2006
[6431]
Well, for a start -  replace/all read %glayout.r "self/" ""
Maxim
19-Dec-2006
[6432x9]
I've already implemented henrik's toolbar in about one hour
and added a pop up to select icon, or text or both right on the toolbox 
 ;-)
those are details to improve readability.
you are free not to use self in your own code... but I can say that 
the 1 micro second which is spent  to look up a few hundred self/ 
 is nothing when compared to displaying 20x20 pixels of draw.
just ONE field with a linear fill in AGG, I have discovered, will 
bog down the whole display!
in normal view we don't notice as much because its static... but 
when you start adding dynamic resizing and real time scrollpane movement... 
its just sooo slow ... so much that I added a property in the field 
to remove all the prettyness!
so that large GUIs didn't become unuesable.
but I'd be happy to go over the engine with you in another group... 
(just to reduce the noise)
but hey if the above replace is a big turn off... I guess I could 
remove most (probably all) occurences of self/
Anton
19-Dec-2006
[6441]
Sorry, Maxim, now is not the time, I am afraid I must attend to other 
things.
Maxim
19-Dec-2006
[6442]
no problem, meet me in the glayout group in a few days?
Jerry
20-Dec-2006
[6443]
According to the DRAW Document, the shape is closed automatically, 
i.e. as a polygon, unless you specify a move command at the end of 
the shape block. However, the following example is different. why?


view layout [ box 300x300 black effect [draw [anti-alias on pen red 
fill-pen none shape [move 35x12 curve 35x12 line 53x96 curve 53x96 
54x101 57x104 61x104 line 61x108 line 37x108 line 37x104 curve 37x104 
42x104 44x103 44x101 curve 44x101 44x100 44x98 44x97 line 38x72 line 
19x72 line 14x98 line 14x100 curve 14x100 14x102 16x104 20x104 line 
20x108 line 3x108 line 3x104 curve 3x104 7x104 9x102 10x99 line 29x14 
move 20x68 curve 20x68 line 37x68 line 29x29]]]]