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

World: r3wp

[View] discuss view related issues

Anton
27-Sep-2008
[8125]
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
[8136x4]
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?
Ignore the commented out lines...
Henrik
1-Oct-2008
[8140]
if possible, you should append faces in a pane that belongs to the 
text face. you can do that as you want. it's only a matter of regular 
block manipulation and then SHOWing the text face again.
Anton
3-Oct-2008
[8141x2]
Minor update to ARROW360 style:

- Now it's smoother (more is calculated with decimal! instead of 
pair!)
(also updated the demo file).
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
Pekr
3-Oct-2008
[8143]
there is one small "bug". When you move arrow close enough to the 
top or to the left window border, underlying content moves some 1-2 
pixels?
Izkata
3-Oct-2008
[8144]
Bleh, I used to know this...  I can't seem to get 'draw to work with 
text - is there something wrong with this?

view layout [box 200x100 effect [draw [pen black text 10x10 {Testing}]]]
Graham
3-Oct-2008
[8145x4]
Linux?
and 10x10 is very small
works on windows for me
http://www.compkarori.com/vanilla/display/AGG
Izkata
3-Oct-2008
[8149x3]
yeah, on linux..  /view version 2.7.5
10x10 should be the offset
Ah, thanks - that font thing makes it work
Anton
4-Oct-2008
[8152x5]
Pekr, yes. That is a View rendering bug, not a bug of arrow360 in 
particular.
Two pixels:
It can be seen with just:
view layout [text "Will be moved up 2 pixels" pad 28x-50 box effect 
[merge luma -20]]
A quite old bug, if I remember correctly.
Henrik
4-Oct-2008
[8157x2]
Text is only moved up one pixel here.
Is it in RAMBO?
Anton
4-Oct-2008
[8159x2]
Probably the same root as this bug report.
http://www.rebol.net/cgi-bin/rambo.r?id=4269&
Henrik
12-Oct-2008
[8161]
I'm toying around with a VID dialect for postscript. I've done that 
by copying the VID source for LAYOUT, STYLIZE and all related functions 
in the SYSTEM/VIEW/VID. So far so good, but now I want to implement 
styles, so I can write some layouts and am wondering what the formal 
way would be to add the very first style in what is equivalent to 
SYSTEM/VIEW/VID/VID-STYLES ?
Anton
13-Oct-2008
[8162x2]
Hmm.. interesting. Do you have a base object (eg. similar to svv/vid-face 
?)
Not familiar with postscript, I am wondering why you couldn't just 
make a function "to-postscript" that accepts a face argument (similar 
to to-image), instead of reimplementing all of VID.
Henrik
13-Oct-2008
[8164x3]
yes, I have a base face similar to vid-face. I even added it to the 
style list manually to see if that would work, but it doesn't.
Anton, good idea.
Anton, thanks. Now it's moving forward. Got some primitive face renderings 
in postscript now.
Anton
13-Oct-2008
[8167]
I suppose you would be cloning face/color, face/text, face/edge rendering 
(whatever you need first) at a simple level, and gradually improving 
it towards perfection afterwards.
Henrik
13-Oct-2008
[8168x3]
My biggest problem right now is the coordinate system, vertical positioning 
of text and text wrapping. The rest is almost in place.
http://rebol.hmkdesign.dk/files/vid-postscript.png<--- so far so 
good :-)
(I wish I had thought of this sooner!)
Anton
13-Oct-2008
[8171]
That looks like fun, Henrik.
Henrik
13-Oct-2008
[8172]
I've already fixed top/middle/bottom alignment. Text is placed a 
couple of mm too far to the right.
Anton
13-Oct-2008
[8173]
I suppose you don't know how to do the equivalent of SIZE-TEXT in 
postscript yet.
Henrik
13-Oct-2008
[8174]
Actually I rely fully on VID's coordinate system. SIZE-TEXT in PS 
is apparently only possible on the width of the text, not the height, 
which is why just I use VID instead. It seems to work fine, if we 
can live with integer positioning.