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

World: r3wp

[View] discuss view related issues

Henrik
14-May-2009
[8739x2]
Maxim, do you know how the iterated faces function is used in View? 
I'm stuck in a situation where the index is sometimes returned as 
none.
never mind, I think I got it.
Anton
14-May-2009
[8741]
You can't do event-transparent faces. I figured out a huge hack (simulating 
DO EVENT) which was not quite able to go the whole way. :-(
Steeve
14-May-2009
[8742]
your transparent face can throw back the events to the underllying 
faces, you just have to locate them with the offset of the events, 
i used this trick several times
Anton
14-May-2009
[8743]
Can I see a demo of your technique, Steeve?

I wanted transparent events along with transparent regions of a face 
(eg. a face with rounded corners, the events should pass through 
the corner regions, but the rest should land on the face).
It just couldn't be done properly - see my file
http://anton.wildit.net.au/rebol/gui/transparent-events.r
Steeve
14-May-2009
[8744]
even in R3 Carl use the same trick
Anton
14-May-2009
[8745x4]
Try click on the button at the left and drag to the right.
I want to see code. (But got to go - I'll check back later.)
(My stuff all relates to R2, by the way.)
(and not at all to R3)
Steeve
14-May-2009
[8749]
Hmm Anton, you can't do like that, you must hack the global event 
handler with insert-event-function
Steeve
15-May-2009
[8750x2]
Hmm what you are trying to do anton is tricky, i never did that, 
i always had the transparent area covering the whole unerlying faces.
It was much simple than your use case.
I don't use VID styles as underlying faces but my owns to discard 
the default dispatch of events (no feel object).

But in your case, you'll have to translate all move events comming 
from the global handler into OVER, AWAY events depending of the sub-face.
Lot of work...
Anton
15-May-2009
[8752]
Yes, what I tried was a definitive solution. But after working on 
it for a very long time, I found it can't be done completely. (At 
least, I am 99% certain.)
Maxim
15-May-2009
[8753]
well, it allowed you to build skewed windows, which isn't a small 
feat within windows   :-)
Anton
15-May-2009
[8754]
Well, yes, but it still wasn't a complete solution.
amacleod
15-May-2009
[8755x2]
Is there a delay with view when working with internal values?


For example if I change the offset of a scroll-panel after showing 
it it reverts to the changed value but if I put a wait of .1 the 
offset viewed remains as expected and does not show the new value.

Am I making sense?
the wait is after show but before the offset value is changed...
Steeve
15-May-2009
[8757]
the function SHOW, pushes a new show event in the events stack,but 
is not dispatched until your program enter in a wait loop.
So it's normal.
amacleod
15-May-2009
[8758]
Thanks steeve. I thought I was loosing it..again.
Steeve
15-May-2009
[8759]
It's the main difference between procedural programming and event-driven 
programming.

When you develop event-driven applications, you must use a different 
flow in your code
amacleod
15-May-2009
[8760]
Don't exactly get that but I will keep it mind, thanks.
Steeve
15-May-2009
[8761]
Eheh, you have no choice, when you are programming a visual interface 
with Rebol, it's an event-driven flow
Anton
16-May-2009
[8762x2]
amacleod, doesn't make sense to me. Are we talking about R2?
Which scroll-panel are you using ?
Maxim
16-May-2009
[8764x2]
anyone interested in an SCP based file copy software? this uses SSH 
port, so no need for ftp on the server  :-)  I've already got file 
browsing working.
this is view based client.
Graham
16-May-2009
[8766]
sure ...
Henrik
16-May-2009
[8767]
does View set parent-face for a layout internally?
Maxim
16-May-2009
[8768]
it is set after a show
Henrik
16-May-2009
[8769]
so it's internal
Maxim
16-May-2009
[8770x2]
but you can set it manually.   :-)  as long as its the actual parent, 
its totally safe.
some view functions require the parent-face to be set in order to 
work.... this is sometimes usefull when you want to create stuff 
between a call to layout and one to show.
Henrik
16-May-2009
[8772]
I guess it comes from the fact that you can build face trees manually 
and therefore would need to set them with SHOW directly.
Maxim
16-May-2009
[8773]
glayout has always set parent-face directly after creating panes 
on the fly and its never been an issue.
Henrik
16-May-2009
[8774x2]
I'm altering the VID model and so all faces are required to have 
a parent-face set.
Yeah, I guess I need to do the same.
Maxim
16-May-2009
[8776]
btw, you know that creating row/colum styles in VID is really easy?
Henrik
16-May-2009
[8777]
example?
Maxim
16-May-2009
[8778x3]
you can do directly within a call to style :-)
give me a minute... will load code to be sure I give a proper working 
example.
row: box edge none with [
		color: none
		multi: make multi [
			block: func [
				face 
				blks
				/local frame tt
			][
				if block? blks/1 [
					frame:  layout compose [
						origin 0x0
						space 10x10
						across
						(blks/1)
					]
					face/pane: frame/pane
					

     face/size: frame/size + any [all [face/edge 2 * face/edge/size] 0]
				]
			]
		]
	]
Henrik
16-May-2009
[8781x2]
I see. :-)
maybe I'll use that for forms.
Maxim
16-May-2009
[8783x2]
the nice thing is that you get R3/Glayout style layout blocks  :-)

adding the column...

column: box edge none with [
		color: none
		multi: make multi [
			block: func [
				face 
				blks
				/local frame tt
			][
				if block? blks/1 [
					frame:  layout compose [
						origin 0x0
						space 10x10
						below
						(blks/1)
					]
					face/pane: frame/pane
					

     face/size: frame/size + any [all [face/edge 2 * face/edge/size] 0]
				]
			]
		]
	]



view layout [
	column [
		row [
			vtext 100 "first name"
			field
		]
		row [
			vtext 100 "last name"
			field
		]
	]
]
layout is totaly obvious at first glance and all alignment is perfect.
Henrik
16-May-2009
[8785]
ok, can you decide the size of a column? say you want to share column 
sizes across multiple panels.
Maxim
16-May-2009
[8786x2]
I never understood why these where never added to VID.
if you look at the styles above, they inherit their sizes from the 
content... but you can easily do a simple trick  :-)


only inherit the size in the direction of the size which is set to 
-1

so if you do: 	

column 200x-1 [ 

then it would staticaly size the x but inherit the y
Henrik
16-May-2009
[8788]
I see.