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

World: r3wp

[View] discuss view related issues

Anton
14-Sep-2006
[5501x2]
Good question. I think it may be a deliberate offset added to the 
some edges of polygons, so polygons with common edges can be drawn 
in any order without any overlap. This is used in 3D modeling, where 
lots of triangles with common edges are drawn.
I would check the AGG documentation to confirm that though.
Cyphre
14-Sep-2006
[5503x3]
Thi si because the defual mode for LINE-JOIN is MITER. It is enough 
for your case to change it to BEVEL,ROUND or MITER-BEVEL mode. For 
example:


view layout [box black 600x600 effect [draw [line-join bevel line 
490x473 490x8 line 45x8 490x8 polygon 45x473 156x357 490x8]]]
You can see the effect of different LINE-CAP/JOIN modes in Rebol 
Desktop: REBOL/View Tests/Line Cap Join


(or directly from console: do http://www.rebol.net/tests/line-cap-join.r)
Thi si because the defual mode...=This is because default mode...
Henrik
15-Sep-2006
[5506]
are there tutorials anywhere on writing your own style with stylize/master?
Graham
15-Sep-2006
[5507]
I haven't seen it, but apparently Cyphre did one in at the last devcon 
.. so have a look at his presentation?
Henrik
15-Sep-2006
[5508]
I know that one but was looking for one that would explain the different 
parts better.
Anton
16-Sep-2006
[5509x2]
Ask all your questions here about any facets, then we can collect 
the answers into a document.
Someone made a very nice colour-wheel requester (at least I think 
it was a requester) at one time. I've found Oldes' color-lab.r which 
is just awesome, but I'd like to also find any others.
Robert
17-Sep-2006
[5511]
This would be really a needed doc. I haven't done it myself yet, 
because the startup time to collect all information snippets is to 
high.
Anton
17-Sep-2006
[5512]
It's a pretty huge task.
Volker
17-Sep-2006
[5513x2]
There isnt much different to plain faces. There is a block /init 
which is called after all arguments are loaded by 'layout. Arguments 
are put in the appropriate facets, if there are some of the same 
type, they are put in a block instead. so two colors go into /colors. 
There is some magic with keywords, which needs more space to explain. 
but for quick things you can pass args in 'with. Styles have their 
own source in /facets, so you can look there. Best with deskop/tools/vid-style-tree. 
Start fresh things with 'image or 'box,  examine things by with[probe 
self]. The rest is the same as plain faces, and there are some docs 
now.
/init is a block so its extensible by appending own stuff to it, 
so 
text  with[append init[ print "all args here" ]]
Anton
17-Sep-2006
[5515]
Henrik, are you wondering what stylize/master does or how to use 
it ? Or are you looking more for a style-creation guide ?


Usage of stylize/master itself is pretty simple, it takes a style 
spec and adds the new styles in it to system/view/vid/vid-styles, 
where all the default styles are kept, eg:
	stylize/master [my-box: box blue "hello"]
	view layout [my-box]


I often felt the need for an official document explaining all the 
things a style should satisfy to be "VID-compliant" and explaining 
each facet in detail, where and how facets are used by existing styles. 
But no such doc exists. I've been growing a pile of demos and text 
documents as I discover things.
Henrik
17-Sep-2006
[5516]
I'm not wondering about it. I used Cyphre's video to kickstart LIST-VIEW 
development. :-) But I think this is an area of VID that remains 
a mystery to most users, as there is very little documentation around 
to explain how it works. Maybe that's why there isn't that many custom 
VID faces around. I seem to remember a ton of custom classes for 
MUI on the Amiga.
Janeks
18-Sep-2006
[5517]
If I am calling (loading) a layout  from web server script  with 
http://someurl?some=cgivarsand then displaying, than I cannot it 
unview:

								info-resp: read browseUrl
								reduce load info-resp

								either viewed? infowin [
									unview infowin ;Does not work!?
									view/options/title/new infowin [all-over] "Info:"
								][
									view/options/title/new infowin [all-over] "Info:"
								]

F.ex. I want that there does not appear  new windows. But I need 
to use /new refinement, because I need possibility for user to go 
back (activate) on another window.
Is it connected with Rebol scopes?
And how to avoid new window?
Graham
18-Sep-2006
[5518]
unview/only infowin .. is the syntax for closing a single named window
Janeks
18-Sep-2006
[5519x2]
I alredy tried it but - no success!
I solved it so that loaded just info win definition block:
								either value? 'infowin [
									unview/only infowin ;Šitais nestrādā nezkāpēc
									infowin: layout info-layout
									view/options/title/new infowin [all-over] "Info:"
								][
									infowin: layout info-layout
									view/options/title/new infowin [all-over] "Info:"
								]
Than it works.
But why it is so?
Anton
18-Sep-2006
[5521]
You must tell us what the value of INFOWIN is.
Janeks
18-Sep-2006
[5522x2]
Info-win is block  for layout definition.
But in first case it was layout
Anton
18-Sep-2006
[5524x2]
Ok, there is confusion between the layout spec block and the resulting 
window face.
A pattern I use very often:

infospec: [ area button ... ] 
infowin: layout infospec

either viewed? infowin [
	; bring the window to the front (or do the taskbar flash thing)
	infowin/changes: [restore activate]
	show infowin
][
	view/new infowin
]
In your first code, UNVIEW does not work because it does not take 
any arguments.
As Graham said, to name the window to close, you must write:

	unview/ONLY your-window
Maxim
18-Sep-2006
[5526x3]
or even better
unview/ONLY find-window face
which closes the window relative to an actual button...
Janeks
19-Sep-2006
[5529x2]
Anton, my first code unview does not wor also with /only. I tried 
it!
The problem was that I could not unview (also with only) if I loded 
layout from remote script formed on web server.
I can unview when I formed layout locally.
Anton
19-Sep-2006
[5531]
How does the remote script look ?
How do you load the layout spec from the remote script ?
Janeks
19-Sep-2006
[5532]
Remote script is mapserver template that returns map layer feature 
data based on coordinates:
Something like:
info-win: layout [
	text "Fld:"

 text "[fldName]" ;this finaly looks just - text "value from table"
	etc
]
Anton
19-Sep-2006
[5533]
Ok, so remote script looks like:
--------------------------
rebol []
info-win: layout [ ...]
--------------------------
Local script looks like:
--------------------------
rebol []
info-win: do remote-script-url
; Now info-win is a FACE object

; Only do the above line once, otherwise you will create a *new* 
face and set 'info-win to it, forgetting the old one !!

; The following code is done more than once:

either viewed? info-win [
	info-win/changes: [restore activate]
	show info-win
][
	view/new info-win
]
Janeks
20-Sep-2006
[5534]
So, did I got idea right:
The remote script is treated as new scope.

Note: In may cases there are some differences remote script is without 
rebol header and is loaded with "reduce load"
Anton
20-Sep-2006
[5535x2]
So remote file looks like this:
-------------------------------
[
	text "Fld:"
	text "[fldName]"
	etc.
]
---------------------------
Local script should maybe look like this:
---------------------------
rebol []
if all [ value? 'info-win   viewed? info-win ][
	unview/only info-win
]
info-resp: read remote-script.r
replace info-resp "[fldName]" "value from table"  ; etc....
spec: load info-resp
info-win: layout spec
view/new info-win 
do-events
There is no "scope" in rebol. When you read from a url, you create 
a new string. That is, READ returns a new string.

When you set a word to that new string, you "switch" the word away 
from its old value (if it had one.) Eg:


 At the beginning of this example, the word  'info-resp  has no value 
 (It is unset!).
	Now, we set its value to the string returned by READ:

		info-resp: read url

	Now,  'info-resp  points to a string  "[ text ... ]"
	Let's do it again:

		info-resp: read url


 We have re-set  'info-resp  to a new string!  (even though old string 
 and new string look exactly same.)

 The old string may still exist as a value somewhere, but  'info-resp 
  does not know about it anymore.
	Normally this is not a problem.
--
	However, look at this example:
	
	1)	window: layout [box red]
	2)	view/new window
	3)	window: layout [box red]
	4)	unview/only window


 On line 1, LAYOUT creates a face object which we assign to the word 
  'window . (So  'window  points to a face.)
	On line 2, VIEW opens the value of  'window  as a window.

 On line 3, LAYOUT creates a *new* face object which we assign to 
 the word  'window.

  So  'window  points to a *new* face, and it has forgotten about the 
  old face.
		However, the old face is **still open as a window**.

  So we have lost our reference to the old window face, and it is now 
  more difficult for us to close it.
		So line 3 has created a problem.

 On line 4, we try to close the new window face, but we are unsuccessful 
 because the new window face is not open.
Janeks
20-Sep-2006
[5537]
Now I believe, that I understood.

If it is just a variable with a value, than there is not problem, 
but layout are not doing just a face value assignment to a variable, 
but <b>creates new</b> one face and add reference to that face to 
variable.
Anton
20-Sep-2006
[5538x3]
No, LAYOUT only creates a face. It does not add a reference to a 
variable. The set-word (eg.  info-win: )  takes the value that LAYOUT 
returns, and associates it with the word (eg.  'info-win ).
Actually, I think you understand ok. Yes, LAYOUT creates a *new* 
face every time.
For those creating documentation involving a face hierarchy, here's 
a function which may help to visualise it:
do http://anton.wildit.net.au/rebol/doc/demo-to-3d-layout-image.r
Graham
21-Sep-2006
[5541]
Anyone any ideas of how to take a plain paper form and turn it into 
an electronic form that can have text entered into it and then print 
it ?
Henrik
21-Sep-2006
[5542x2]
as in X-forms?
in open office you can create X-forms that can be converted to PDF, 
opened in adobe reader as a form which then can be printed
Graham
21-Sep-2006
[5544x3]
Looking for a Rebol solution :)
But interesting ..
So, open office can create a pdf form ?
Henrik
21-Sep-2006
[5547]
yes, straight out of the box
Graham
21-Sep-2006
[5548]
So, how then to prepopulate the form ?
Henrik
21-Sep-2006
[5549]
I haven't played too much with that, but I think it's possible.
Graham
21-Sep-2006
[5550]
So, you create an xml form which acrobat can read??