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

World: r3wp

[View] discuss view related issues

Anton
23-Jul-2006
[5270]
So the face hierarchy looks like this:

tool-bar
       |
icon-frame
      /  \
    /      \
icon   text


I would suggest blowing away the feels of the icon and text and do 
all your event handling in icon-frame/feel.
Is there any reason you can't do that ?
Henrik
23-Jul-2006
[5271]
that's already what I'm doing. the problem is that the OVER and AWAY 
events seem to be from those faces with FEEL set to none anyway.
Anton
23-Jul-2006
[5272x6]
You're right, that's a confusing aspect of over and away events in 
the engage function.
I am quite positive I solved this before using a combination of feels 
somehow....
Yep, I was an expert on this 11 months ago, apparently.
do http://home.wilddsl.net.au/anton/rebol/doc/event-flow-diagram.r
Have a play with that and see if you can capture all the state changes 
you need.
I think now you probably have to have feel/engage in both the icon 
and text faces.
Henrik
23-Jul-2006
[5278x4]
neat program!
maybe it can be done by measuring the offset instead of relying on 
AWAY
apparently not directly...
making it possible to see where an OVER or AWAY came from would make 
this a whole lot easier.
Anton
23-Jul-2006
[5282]
Are you sure you need subfaces ? Is the text really essential as 
a separate face ? You might avoid all this confusion with feels by 
using a single face, which can show both an image and text natively, 
or use the draw dialect.
Henrik
23-Jul-2006
[5283]
text is required to be centered. this is not possible to do with 
draw accurately.
Anton
23-Jul-2006
[5284x2]
(I suspect you are aiming for a simple specification using existing 
VID styles icon and text. Is that true?)
Yes it is. It's fiddly though.
Henrik
23-Jul-2006
[5286]
I've tried and found it to be too hard to be worth the trouble. It 
depends on the font and the size of the font.
Anton
23-Jul-2006
[5287]
Calculating the size of the text is the most fiddly part. But I can 
help there.
Henrik
23-Jul-2006
[5288]
I won't be using DRAW.
Anton
23-Jul-2006
[5289x2]
I've just been doing that whilst making a tab-bar the last couple 
of days.
Yes, I don't think you need draw for this. What's the link again 
to your tool-bar demo ?
Henrik
23-Jul-2006
[5291x3]
see announce
I've redone some feel code so it responds much better now, but there 
are still problems. this is a different problem now with being unable 
to use the 'over function to determine whether the mouse is over 
the icon frame or not while the left mouse button is pressed.
so if you are clicking on top of the icon frame and move the mouse 
away, you can't cancel a click.
Anton
23-Jul-2006
[5294]
Mmm.. just quickly, looks to me like you don't need subfaces... but 
dinner time..
Henrik
23-Jul-2006
[5295]
highlighting requires two different effects, one for each face. also 
there are differences when showing icons and text, or only one of 
each.
Anton
23-Jul-2006
[5296]
Ok, so you need subfaces for those effects.
Henrik
23-Jul-2006
[5297]
oh well... perhaps DRAW is the right way forward to draw the image 
and then bottom align the text. maybe then it really can be done 
in one face.
Anton
23-Jul-2006
[5298]
can't you use font/valign: 'bottom ?
Henrik
23-Jul-2006
[5299x2]
yeah that seems to work
I think this is something that's worth taking up for VID+
Anton
23-Jul-2006
[5301]
Ah yes, definitely. I found the system quite confusing when trying 
to achieve certain things.
Henrik
23-Jul-2006
[5302]
It's silly that feel/over is blocked when the left mouse button is 
being held down. this prevents me from detecting the face edge properly.
Anton
23-Jul-2006
[5303x3]
After intensive study, you can start to see it has its own twisted 
logic, but it can definitely be improved.
Yes, you have to use engage.
engage and over together.
Henrik
23-Jul-2006
[5306]
the problem with engage is that it blocks when another face is overlapping 
it. the same problem, just in the opposite direction.
Anton
23-Jul-2006
[5307]
yep :) welcome to madness :)
Henrik
23-Jul-2006
[5308]
I've almost made it working now, except that exiting from the icon-frame 
is not detected, when the mouse is held down. I don't know how to 
deal with that. I can easily "exit" to the subface....
Anton
23-Jul-2006
[5309]
The question I tried to answer for a long time was "how do I know 
if the mouse is in this rectangle or not ?"
Henrik
23-Jul-2006
[5310]
hmm.. that would mean the main toolbar might need a feel as well. 
this is getting messy.
Anton
23-Jul-2006
[5311x2]
engage should get away and up events.
Ah yes.. but it's the engage of the subface... yes...
Henrik
23-Jul-2006
[5313x2]
it gets the away event, but too many times. I try to block that by 
asking which face I'm over, using feel/over, but feel/over doesn't 
work exactly when I need it to.
I'll try something with engage instead of over.
Anton
23-Jul-2006
[5315x2]
don't worry, just filter it using a state flag.
(if you get too many events)
Henrik
23-Jul-2006
[5317]
I am using one already, but the state flag can't be changed with 
over where I need it to change :-)
Anton
23-Jul-2006
[5318]
After fiddling with event-flow-diagram.r, I recommend icon-frame 
detect to check the offset for inside/outsideness. It can also check 
if event/type = 'down [mouse-down?: true]      mouse-down? can be 
set false by engage functions when they detect 'up event.
Henrik
23-Jul-2006
[5319]
I think I got it now