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

World: r3wp

[!REBOL3 GUI]

Ladislav
4-Feb-2011
[5867x2]
%trunk/r3-gui/source/panel-make.r3 and %panel-sizing.r3 committed. 
Changes:

- SPACING initialization moved to the INIT-PANEL function
sorry, crying right, but on a wrong toom here ;-)
Pekr
4-Feb-2011
[5869x4]
ok, so let's think what does it mean? Because - most of the time, 
I use maximized windows, so:


1) for maximized window, if there is an area - let's think above 
message pane in Altme for e.g., if I insert new button there, there 
is no place to enlarge the panel to, so what happens? Do panel scrollers 
appear? And if so - am I kept at the beginning (top-left) of the 
panel, or am I scrolled to the location of last inserted element? 
Please note, that those concept are relevant for grid/table navigation, 
etc., it is just similar


2) if the window is not maximized, and panel is about to be resized 
- is window enlarged automatically?



So PANEL ENLARGEMENT preferred behaviour (note - say nothing about 
auto or manual update preference though):


If I would be for the auto-update, what I would probably hate would 
be if the size/position (let's think of always centered window) of 
the window would be automatically moved.

PANEL SHRINKING:


So - what should happen, if you remove elements? The same as above 
apply? Does the whole window shrinks? Or just scrollers get eventually 
removed, or the panel is simply smaller, whereas the window remains 
to be sized as-is?


As you can see, I need an answer to above questions too. It is all 
about what is the most pleasan vs unnerving to use. And it relates 
to what happens to Window, not to panel, that is just secondary question, 
if it stretches automatically ....
I can see following possibilities:

PANEL ENLARGEMENT:

- panel is not enlarged, it adds scroller

- panel is enlarged, but it does not affect window - window adds 
scrollers

- panel causes enlargement of the window (hence window moves, and 
we should be carefull, because new size of the window does not need 
to fit to the screen - it is a special case)

PANEL SHRINKS (content removed):

- panel just stays as is, eventually removes scrollers

- panel shrinks, to fit its content, but window remains of the same 
size

- panel shrinks to fit the content, window shrinks to fit the panel

All above plus the combination of auto, vs manual
Sorry for the color, but the latest message is as I can see the possible 
scenarios, just wanted to distinguish it. Leaving for work now, online 
back in 40 minutes ...
So - one more note - if above would be wisely implemented, I am for 
auto-update with manual override not to update for the style author. 
But if I would get unexpected results, I prefer not to auto-resize 
probably (but not 100% sure, unless giving it a try for a while)
Ladislav
4-Feb-2011
[5873x5]
 if I insert new button there, there is no place to enlarge the panel 
 to, so what happens?

 - that is actually not true; when resizing, the algorithm resizes 
 proportionally to the INIT-SIZE, which means, that a change to INIT-SIZE 
 of an element changes the proportions of displayed parts, while no 
 change to the INIT-SIZE does not
example: if a (maximized) window contains two panels, and you enlarge 
the init-size of one of them, leaving the other as-is, the proportions 
change, and the panel with enlarged init-size will become greater
(at the expense of the other panel, which becomes smaller)
if the window is not maximized, and panel is about to be resized 
- is window enlarged automatically?

 - that depends - if the window INIT-SIZE does not change, its actual 
 size does not change as well
As you can see, I need an answer to above questions too. It is all 
about what is the most pleasan vs unnerving to use.

 - frankly, you can at least try the examples provided and see what 
 happens now; and, eventually, present your observations here
Pekr
4-Feb-2011
[5878x2]
Ladislav - I might be too dumb to understand :-) What should I actually 
try? Do you suggest some panel test scripts, which are in the distro? 
Or what do you mean by "examples provided"?
I still miss simple style to group things. I always wanted a panel, 
with border, gradient, etc., but then also exactly the same style, 
but with zero visuals ...


IIRC, in Carl's GUI, it was panel vs group - except the fact, that 
it group used opposite coordinate system - very unwise btw


In RMA's GUI, if I am not mistaken, group is internally completly 
different - it is here for those users, used to VID2 - you have to 
use RETURN keyword, it does not align in grid cells, etc.


So - how do I easily define inline style, which removes panel visuals? 
I don't want to create new style for such a simple and usefull thing. 
And I start to think, that 'group style is here just to confuse users 
...
Rebolek
4-Feb-2011
[5880]
Per, look at TIGHT, it's variant of PANEL that serves some of purposes 
you want and it's done using just redefining some facets, so you 
can make your PANEL variant based on it.
Ladislav
4-Feb-2011
[5881x2]
Pekr: looks, that you will get more examples from Cyphre, who promised 
to pack some and make them available. So, I am afraid, that at the 
time being, you only have the examples from the gui-panels.html text 
available.
Andreas: "A quick question: is proper alignment along font baselines 
planned for the GUI?" - no, it is not, since the understanding is, 
that it has already been implemented... In case you see some quirks, 
please, let us know.
GrahamC
6-Feb-2011
[5883]
I haven't kept up .. how does the GUI event model work ... is it 
comparable to DOM 2 event handling?
Rebolek
7-Feb-2011
[5884]
Yes, it can be compared, events are handled by event-handler and 
on-* actors are called in appropriate face(s).
GrahamC
7-Feb-2011
[5885]
So can you have multipe listeners for each event?
Rebolek
7-Feb-2011
[5886]
I'm not sure what do you mean by that. By design, every event must 
have some unique face where it should end. But if you want run multiple 
actions with one event, that's possible.
GrahamC
7-Feb-2011
[5887]
In the original DOM 0 model, each event had one handler attached 
to it.  In DOM 2, you instead have listeners, as many as you want, 
listening for an event.  Each of those are triggered by the event. 
 So, it's like have 10 actions on a button, each of which are triggered 
on a mouse click.
Robert
7-Feb-2011
[5888]
That's possible.
GrahamC
7-Feb-2011
[5889]
In JQuery, it's called bind() and unbiind()
Pekr
7-Feb-2011
[5890]
GrahamC: well, as for browser, I recently looked into FF 4 featureset 
- video, audio, smooth fonts (open type), transitions effects via 
CSS 3, 4x faster JS ... we are somehow starting to lag behind :-)
GrahamC
7-Feb-2011
[5891]
Yeah ... I was thinking that maybe we should be using a similar event 
model to make it easier for us to learn both :)
Pekr
7-Feb-2011
[5892]
GrahamC: the event does not necessarily have to be "consumed". In 
REBOL, we simply have events, and you can always return just the 
same event when processed by our handler. Remember insert-event-func 
from R2? You could create transparent event filters ...
Rebolek
7-Feb-2011
[5893]
It's much better than R2, because it's actually possible to work 
with events.
Pekr
7-Feb-2011
[5894]
We need the ability to create events, and we should also be sure, 
that we are able to obtain modern events, as e.g. above mentioned 
FF4 can now handle multi-touch native Windows 7 event. And we are 
not even receiving such things as ctrl tab for tab handling. What 
I still don't understand is - the system port? Is that port still 
available in R3? And what was it good for? It would be e.g. nice, 
if by opening the system port, you would insert such a listener to 
the OS event model, registering for particular events. Well, that 
might be slow, if you are not carefull, but that way you might be 
able to receive any system event possible .... but not sure it is 
even possible :-)
GrahamC
7-Feb-2011
[5895]
Yeah, they also have event bubbling .. so a click can propagate outwards 
for other things to deal with
Rebolek
7-Feb-2011
[5896x2]
We need the ability to create events
 - so you should try make event!
event bubbling - that's part of R3GUI.
Pekr
7-Feb-2011
[5898]
Rebolek - I know make event! is possible, but does it actully work? 
IIRC it was not fully working in early alphas? So you say I am able 
to simulate e.g. a keypress, mouse event, etc.?
GrahamC
7-Feb-2011
[5899]
is make event! attached to a particular GUI object?
Rebolek
7-Feb-2011
[5900x2]
Yes. I haven't got use for it yet, so I tested it only briefly. But 
I was able to create event!, send it to another face and process 
it.
Graham no. It's up to you what are you going to do with that event.
Pekr
7-Feb-2011
[5902]
Graham - why should it be? I expect it being just a structure/object, 
you fill in the data, and it gets inserted into the event queue, 
then your objects react accordingly, like if the event would be generated 
by normal action.
GrahamC
7-Feb-2011
[5903x2]
So, how you would you simulate a mouse click on a button then?
a button that might be buried by another window on top of it?
Rebolek
7-Feb-2011
[5905]
I would simply call on-click for that particular button
Pekr
7-Feb-2011
[5906]
graham - the gui has many nice features/handlers. There are things 
like do-face, do-style, not sure if cause-action is there (IIRC it 
was part of Gab's GUI)
GrahamC
7-Feb-2011
[5907]
resize on a window?
Rebolek
7-Feb-2011
[5908]
do-style window 'on-resize win-size
Henrik
7-Feb-2011
[5909]
eventually we'll need the automated test system, so an "event machine 
gun" is needed.
GrahamC
7-Feb-2011
[5910x2]
and a way to record macros?
is there a way to enter characters into a field ?  Like the DEL, 
and Backspace ?
Henrik
7-Feb-2011
[5912]
macros could be derived from the undo system
GrahamC
12-Feb-2011
[5913]
Is Pekr's port of the demo available yet?
Pekr
12-Feb-2011
[5914x3]
I am going to work on it a bit today, and tomorrow, then I can release 
what I have ...
I am really nervous about things like removing the easy ability of 
changing the color of something easily, and if it will unnerve me 
in the future, I will fork it ... :-)
I want freaking to change the color of the scroller, the way Carl 
did it easily, via span-colors, easily changing the gradient. Material 
system is useless for me, if I can't do so easy things the esay way 
...