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

World: r3wp

[View] discuss view related issues

ICarii
2-Sep-2008
[8089]
you can use data: to hold any user data.
amacleod
2-Sep-2008
[8090]
given data dat how do I store it in button_a and retrieve it?
dat: "Bob"
button_a: btn "hello"
ICarii
2-Sep-2008
[8091x2]
button_a: btn "hello" with [data: dat]
so button_a/data will be for the post build access
amacleod
2-Sep-2008
[8093x2]
ok...
Got it...Thanks

I'm building a panel dynamicaly and need to assign data to the face 
as its being built. 
I was not sure of the format: of the with refinement.
back to choose function...
can't get the styl attribute to work. 

If I want my choose menu to be a certain width what syntax do I use?

choose/offset/styl ["One" "Two" "Three"] func [face] [print sec] 
'offset' size = 200] ????
Oldes
2-Sep-2008
[8095]
view layout [choice 200x20 "one" "two" "three" [probe face/data]] 
;??
amacleod
2-Sep-2008
[8096]
sorry oldes...

Not vid's Choice button style but the choose function from which 
its derived.
Anton
2-Sep-2008
[8097x3]
(The CHOOSE function uses the CHOICE style, yes.)
view window: layout [
	style choice choice 200x50
	size 300x200 button "choose" [
		choose/window/offset/style ["one" "two"] func [face value][
			probe face/text
		] 
		window 
		(face/size * 0x1 + win-offset? face)
		window/styles/choice
	]
]
http://anton.wildit.net.au/rebol/doc/choose-choice.txt
shadwolf
2-Sep-2008
[8100x2]
soany of you have ideas for the new nale of view ?
nale = name
amacleod
2-Sep-2008
[8102]
new name for vid3.4...
Henrik
2-Sep-2008
[8103]
no new name has been decided yet
Pekr
2-Sep-2008
[8104]
the first name was GIDI ....
amacleod
2-Sep-2008
[8105]
Anton,
That works great..Thanks again.

I was looking for syntax where you describe the layout in hte function 
but I guess that's not how its done. 

Funny how I only saw one example of using choice as a drop down menu 
system. It works perfect for what I need witout hte any bloat. (unless 
you need sub-menus this is fine.

You can even leave out hte window refinement and the menu will drop 
outside the main window. Perfect for when you have a need for a menu 
at the bottom of a window.
Anton
2-Sep-2008
[8106x5]
and in that case, you would use SCREEN-OFFSET? instead of WIN-OFFSET? 
to help calculate the offset of the popup window.
But note, currently in linux, on KDE at least, the popup window has 
a title bar and borders... A limitation of rebol at the moment.
Fresh meat
http://anton.wildit.net.au/rebol/gui/para-control-row.r
http://anton.wildit.net.au/rebol/gui/font-control-row.r
do-thru http://anton.wildit.net.au/rebol/gui/demo-para-control-row.r

do-thru http://anton.wildit.net.au/rebol/gui/demo-font-control-row.r
amacleod
2-Sep-2008
[8111]
screen-offset? 
I actually figured that one out myself...for once.
how about OSX? Does it display properly?
Louis
5-Sep-2008
[8112]
Does ToSystemTray work on a  Linux box?
Izkata
12-Sep-2008
[8113]
Doesn't look like rebview supports any trays on linux
Alan
14-Sep-2008
[8114]
.
Anton
27-Sep-2008
[8115x5]
I've revised (and am still working on) my arrow360 style:
load-thru/update http://anton.wildit.net.au/rebol/gui/arrow360.r

do-thru/update http://anton.wildit.net.au/rebol/gui/demo-arrow360.r
And here's why I wanted it - I wanted to explore the abilities of 
TEXT facet rendering, changing parameters in FONT and PARA objects.
do-thru http://anton.wildit.net.au/rebol/doc/text-facet-rendering.r
(still in development, but you can click and drag the pair-edit fields 
to see the arrows appear.)
Henrik
27-Sep-2008
[8120x3]
neat. I'm looking at it through a 256 color remote desktop. Is there 
supposed to be a darker box around the arrow? Maybe it's just an 
artifact of my remote desktop.
http://rebol.hmkdesign.dk/files/arrow.png
Your text-facet-rendering.r gives an error back about 'push has no 
value.
Anton
27-Sep-2008
[8123x3]
darker box:  Yes. I'm making the face visible to help develop the 
face/offset and size calculations, and also to help demonstrate how 
the arrow360 is implemented.
Henrik, try this to update some dependencies of text-facet-rendering.r 
(1-level deep only), then try it again.
site: http://anton.wildit.net.au/rebol/

foreach [file words] select load-thru site/doc/text-facet-rendering.r 
[include][
	print file load-thru/update (do file)
]
Brock
27-Sep-2008
[8126]
Anton, that's a great style.
Anton
27-Sep-2008
[8127]
Thanks, Brock. I agree ! :-) It's very useful right now, though to 
make it perfect I need to do the vector calculations using decimal! 
instead of pair! to avoid visible loss of precision (when using not-too-extreme 
parameters).
Brock
27-Sep-2008
[8128x2]
Graham, forgive me if I am wrong but I recall you made a simple draw 
program with annotations and undo feature.  Did you ever publish 
it?
I see Paint.r in the Demo folder from the Rebol Desktop, had you 
done more work than that?  I'm also considering trying something 
with the vector graphics to allow for drawing of arcs etc.
Anton
27-Sep-2008
[8130x4]
Henrik, I can't figure out the reason for the "'push has no value" 
error you got above. I had an issue with 'push in some other code 
of mine (dir-utils.r, I think), but there's apparently no push in 
any of the dependencies of text-facet-rendering.r.  The only thing 
I can think of is that some files are out-of-date, or perhaps you 
didn't start with a fresh rebol ? What version did you try running 
? I've tested on View 2.7.6.4.2 and 2.7.6.3.1 on linux.
I think I got it... hang on..
My .... memory is getting worse. This was a dependency bug I caught 
and fixed just 7 days ago. :)
Please try:
load-thru/update http://anton.wildit.net.au/rebol/library/window.r

do-thru http://anton.wildit.net.au/rebol/doc/text-facet-rendering.r
amacleod
1-Oct-2008
[8134]
Is there a way to append an image object (a box for example) to a 
face that has already been displayed. I'm looking to get  simple 
highlight functionality in an app in which a string is scanned for 
in a series of text faces. 


I've been  able to highlight the search word in each face but if 
I click in any of the text faces the face looses the highlight effect 
sort of like loosing focus on normal highlighting. 
I would like the highlight to remain until no longer needed.
Graham
1-Oct-2008
[8135]
you could have the boxes there already and just hide them until you 
need them.
amacleod
1-Oct-2008
[8136x3]
The string is meant to be a search keyword which can change. No predicting 
what one might seach for...
What I got working:

rebol []
pad: 20x30
window: layout [
	bx: box red 0x0
	panel: panel [

  text 400 "Here is a simple example how to use DRAW dialect for into 
  alpha channel of the image. I think with the function make-alpha 
  (bellow in the example) you can draw almost any kind of transparent 
  shape though it is not the fastest method....IMO the possibility 
  to use DRAW pens for alpha channel should be done at Rebol's native 
  level"

  t: text 400 "Here is a simple example how to use DRAW dialect for 
  e-alpha (bellow in the example) you can draw almost any kind of transparent 
  shape though it is not the fastest method....IMO the possiinto alpha 
  channel of the image. I think with the function make-alpha (bellow 
  in the example) you can draw almost any kind of transparent shape 
  though it is not the fastest method....IMO the possibility to use 
  DRAW pens for alpha channel should be done at Rebol's native level"

  text 500 "can draw almost any kind of transparent shape though it 
  is not the fastest method....IMO the possibility to use DRAW pens 
  for alpha channel should be done at Rebol's naHere is a simple example 
  how to use DRAW dialect for into alpha channel of the image. I think 
  with the function make-alpha (bellow in the example) you can draw 
  almost any kind of transparent shape though it is not the fastest 
  method....IMO the possibility to use DRAW pens for alpha channel 
  should be done at Rebol's native level"]

button "Highlight" [foreach face panel/pane [if face/style = 'text 
[
	system/view/focal-face: face

 system/view/highlight-start:  find face/text "into alpha channel 
 of the image"

 system/view/highlight-end: find/tail face/text "into alpha channel 
 of the image"
	show face
	]]]
button "Paint" [foreach face panel/pane [if face/style = 'text [
	;system/view/focal-face: face
	keyword: "transparent"

 ;xy: caret-to-offset face system/view/highlight-start: find face/text 
 k

 ;yx: caret-to-offset face system/view/highlight-end: find/tail face/text 
 k
	xy: caret-to-offset face find face/text keyword
	bx/offset: face/offset + pad + xy 
	bx/size: as-pair (5.9 * length? keyword) 15
	show face
	;unfocus face
	;wait 1
	]]]

]
view window
The first button hilights a string.
The second button "paint" the string in red.

The last painted string in hte last face remains when  clicked in 
the face but the others disappear when clicked. How can I prevent 
that from happening?