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

World: r3wp

[View] discuss view related issues

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
[8802x2]
nope... I'm using command-line tools for the access.  putty et al.
for now... I need something that just "works".  speed is secondary... 
the actual file copy is quick, its the login at each command which 
takes about a second ...
Henrik
16-May-2009
[8804]
is it possible to make sessions for multiple f ile copy or do you 
have to log in for each single operation?
Maxim
16-May-2009
[8805x2]
basically at each operation, like clicking on a folder to view its 
content, I use call with an ssh related command.

I retrieve the output, report any errors or parse the return data 
and refresh the ui.


currently, it starts with root dir list, and you click on folders 
to go into them, or click on a checkbox to select it for other file 
manipulations.


each time I use call, the command-line must do a log-ing, since a 
system call is an atomic operation.
the file copying, is recursive within the command-line , so only 
one login is done and the recursive folder content is xfered at max 
bandwith.
Henrik
17-May-2009
[8807]
anyone know where RESET-RELATED-FACES comes from? I see it in CHECK 
and RADIO.
Maxim
17-May-2009
[8808]
I'll uses glayou't inspector to find out for you if you want
Henrik
17-May-2009
[8809x2]
thank
...you :-)
Maxim
17-May-2009
[8811x2]
its in system/view/vid-feel
you should ckeck out glayout's inspector... its a MacOS like finder 
to browe ANY rebol structure... and the end of a tree of data, if 
you click on something, you can then see what is inside  :-)
Graham
17-May-2009
[8813]
Does it work with rebgui?