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

World: r3wp

[View] discuss view related issues

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.
Maxim
16-May-2009
[8789x2]
new style with this trick enabled....

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
					unless face/size [face/size: -1x-1] ; prevent error below
					if face/size/x = -1 [					

      face/size/x: frame/size/x + any [all [face/edge/x 2 * face/edge/size/x] 
      0]
					]
					if face/size/y = -1 [					

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

				]
			]
		]
	]
graham: wrt scp copy... I'll finish writting it and see if it can 
be posted to rebol.org... I need it to setup my linode server.

 so it will definitely be done shortly.
Henrik
16-May-2009
[8791]
I think I'll borrow that style if you don't mind. :-)
Maxim
16-May-2009
[8792x3]
Henrik: realize that in the above, you can add other faces in the 
group layouts on the fly, I sometimes do so to provide title bars 
to my panes.


in which case I use the multi and add another callback with the function 
name to 'text   and set the string to some internal buffer, then 
reuse that text in the dynamically created group/frame title bar 
instead of the group's text itself.

;-)
sure.
thats why I posted it  :-)
amacleod
16-May-2009
[8795x2]
Sorry Anton, Yes I'm using your scroll-panel  in R2. I was not the 
scroll panel that was the issue but how to get each occurance of 
a specific word from the face/text
Sorry, I just brought up the wrong topic there...but yes that is 
your scroll-panel...
Brock
16-May-2009
[8797]
Max, is there a specific version of View that the above code works 
with?  R2 all, R2 specific, or R3?
Maxim
16-May-2009
[8798x3]
ALL view even 1.3  AFAIK
this scp management tool is fun to build.  :-)  I've got full remote 
site browsing, add folder, and now working on delete (folder+dirs)
although the access is slower than ftp, its much more stable.  the 
ssh protocol is much more constistent AFAIK.
Henrik
16-May-2009
[8801]
is it REBOL/Command only?
Maxim
16-May-2009
[8802]
nope... I'm using command-line tools for the access.  putty et al.