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

World: r3wp

[View] discuss view related issues

Pekr
3-Feb-2007
[6693x2]
maybe: feel [
ah, enter ;-)
Henrik
3-Feb-2007
[6695]
LIST-VIEW has a lot of different actions that let you set what it 
should do in particular situations easily. Every single VID element 
should have that. In fact there should be an abundance of placeholders 
for actions, every one that we can think of.
Pekr
3-Feb-2007
[6696]
feel: [
on-single-key            [block of code]
on-left-mouse-click [block of code]
on-double-click        [block of code]
]
Henrik
3-Feb-2007
[6697]
yes, very simple.
Pekr
3-Feb-2007
[6698]
What I just don't know - what if you would like to serve e.g. holding 
down shift key and holding down left mouse button? e.g. for dragging 
something? I mean - you need both functionalities of on-something 
- how do you mix code then in those code-blocks?
Anton
3-Feb-2007
[6699x2]
So to use REFOCUS:
view layout [
	field
	field with [
		refocus: func [shift /local new-field][

               new-field: either shift [ctx-text/back-field self][ctx-text/next-field 
               self] 
               action self data
               focus new-field
		]
	][
		; action
		print "validate" ?? value
	]
	field
]
Pekr
3-Feb-2007
[6701]
That system would be even inspectable, extensible dynamically, not 
like current 'feel, whish is "just rebol code"
Henrik
3-Feb-2007
[6702]
Pekr, then they would work as flags. You should be able to access 
from within the code block, which qualifier keys are pressed. Binding 
the code automatically to the feel object would let you access the 
variables and events in the feel object.
Pekr
3-Feb-2007
[6703x2]
yes, setting flags .... nice ...
I would even simplify low-level View aproach - no native redraw, 
over - it could be part of one feel, no?
Anton
3-Feb-2007
[6705x2]
Current feel objects can be inspected and extended dynamically.
I think the feeling is to have more higher level types of events 
derived from the raw event stream and provided to you in a more separate 
kind of fashion.
Pekr
3-Feb-2007
[6707x2]
imo our aproach is non-intuitive, non-traditional. Feel is definitely 
not granular enough to be familiar to newcomers, who are used to 
on-something.
... maybe that is what we are talking about?
Anton
3-Feb-2007
[6709x2]
But if this is done for every face, would this not slow down the 
event system ? (Maybe it would, maybe it wouldn't, significantly, 
I'm not sure.)
As far as I see it, RT uses objects when speed is needed. They can 
map down to C structures better I think.
Henrik
3-Feb-2007
[6711]
I don't think it's noticable. Every time I've done optimizations 
on events, removing redraws are causing the biggest slow downs. Everything 
else is hardly noticable.
Anton
3-Feb-2007
[6712]
Maybe we can make a dialect which maps the simple representation 
you've suggested above into an actual working FEEL.
Pekr
3-Feb-2007
[6713]
yes, I start to like the aproach - one 'feel, like today, but dialect 
abstraction ....
Anton
3-Feb-2007
[6714]
You are probably right.
Henrik
3-Feb-2007
[6715]
1. You have direct event handling with on-XYZ [do-program-code]

2. Then you have dynamic flags for, say, qualifier keys inside that 
program code, from the event system

3. Then you have face flags. Some things like size limiting a field 
should be simple. It can _probably_ be mapped to 1.
Pekr
3-Feb-2007
[6716]
do we still need all - redraw, detect, over, engage? (just asking 
:-)
Henrik
3-Feb-2007
[6717]
Pekr, I don't know. What actually calls those four functions?
Pekr
3-Feb-2007
[6718]
View kernel
Henrik
3-Feb-2007
[6719]
Then I guess we need them?
Pekr
3-Feb-2007
[6720x3]
I e.g. don't like 'over. Maybe they are there from arcane View period? 
;-) Once you press mouse button and do 'over, it no more goes into 
'over iirc, but engage. Then I wonder, if having native 'over was 
not meant only as a helper because of speed? But I regard it inconsistent
Then it leads to special sections od docs, as Note: use 'engage for 
drag and drop. For me, the 'over, as is, is unnecessary complication 
- you have to explain it, and it could be done in 'engage too.
btw - 'engage, for me, is not good word selection. Well, I am not 
native english speaking person, but even after all those years, I 
don't know its exact meaning, in relation to events ...
Henrik
3-Feb-2007
[6723]
I'm not sure either. Replacing the current FEEL system would be a 
tremendous amount of work. I was originally thinking more in line 
of extending it to those placeholders. I'm no expert on dialects 
and combining it with FEEL, but if it's possible to do, then OK. 
:-)
Anton
3-Feb-2007
[6724]
Hang on a minute.. The big revelation I had above about using REDRAW 
instead of DETECT was probably premature. Of course I must have experimented 
with both ways a long time ago and I would have settled on using 
DETECT for a reason. You have to be careful in REDRAW to avoid recursive 
SHOWs etc. It's worth more experimentation, anyway.
Henrik
4-Feb-2007
[6725]
I tried some things with REDRAW, but was only more confused than 
before as it now completely refuses to redraw the contents.
Maxim
4-Feb-2007
[6726x9]
pekr, the way the feel is built is very optimised.  there are reasons 
why engage separates the over.  I just would like access to the func 
which splits up the calls to feel. which is what I did in regraph. 
 since all events are virtual I was able to separate them differently, 
and support drag and drop directly in the graphic element's feel.
redraw realy slows down performance and can be a very dangerous memory 
clogger to.  when I replaced (long ago) all redraws in VID with better 
code in the actual engage and other feels, many views started feeling 
snappy when they had been hogs before.
I experimented a stream system for glass and it works very well. 
 it changes the way we approach events and can allow plugins to manipulate 
the way events are handled (and adding handlers for those changes) 
without the faces even knowing.
basically, each event is passed down a stream which applies the event, 
changes it or even creates new events out of it.
again, the speed is no concern as one view refresh is 10000 times 
slower than anything I have ever thrown in the event loop itself.
each node in the stream handles only one condition or type of manipulation. 
  the most obvious way to show how this is cool, is when you handle 
keys.
you can have a special node in the stream which replaces certain 
strokes with others... executing macros, or inserting a whole stream 
of text, even if the app doesn't really support it.
so you could insert the clipboard right in the inputs instead of 
having to support it explicitely in the various face styles... as 
a high-level example.
I even realised that we could add drag and drop OVER a fully working 
apps, sending the events to an external handler.. this allows things 
like interactive face manipulations while the app is running...  
:-)  cool for visual app dev... and its completely non-intrusive 
to the code of the running app.  the app just never receives certain 
events when a series of events occurs... and no need to play in the 
face's individual handlers either  (which is the biggest feature 
IMHO:-)
Pekr
4-Feb-2007
[6735]
is that what liquid does?
Maxim
4-Feb-2007
[6736x2]
I built the stream using a purpose built liquid node.  liquid is 
a generic core reference for dataflow programming.
and it comes with a reference (and fully functional) multi-purpose 
node called a plug which allows you to mix and match many types of 
dataflow nodes using the same node.
Henrik
11-Feb-2007
[6738]
I propose a very simple enhancement to BTN to the official VID to 
allow the inclusion of images directly via layout. It adds 7 lines 
of code to the BTN init: http://hmkdesign.dk/rebol/img-btn/img-btn.r

Please study the source for commenting/enhancements. Thanks.
Geomol
11-Feb-2007
[6739]
I have a problem with field and key in the same layout:

view layout [
	field
	key #"t" [alert "key: t"]
]


If I click in the field and try to enter a "t", the alert pop up. 
I'm doing this under OSX. Is it the same on other versions of View?
Henrik
11-Feb-2007
[6740]
Geomol, it's the same in Windows
Geomol
11-Feb-2007
[6741x2]
I'm wondering, why I haven't noticed this before, or maybe I have 
and forgot about it.
Is there a work-around?