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

World: r3wp

[AGG] to discus new Rebol/View with AGG

Pekr
23-Nov-2005
[658]
(well, except the blitting :-)
Graham
28-Nov-2005
[659]
Rebolek's AGG demo called "Cyphre" reminds me a bit of Tempest 2000 
- anyone planning on a Tempest 2000 clone ?? :)
shadwolf
5-Dec-2005
[660x5]
Hello folks  ^^
Here is a little somthing i was working on some month ago when the 
 Ritchtext edit  topic pops out -> RTE ...
the code is ugly but tiny there is some bugs but i think the idea 
is good  ^^
REBOL [
 Author: "Shadwolf"
 Starting_Date: 21-05-2005
 Purpose: {Research work on rebol draw capability to be 
 used to write a Ritch text editor} 
]
stylize/master [
	rte: box with [
		color: gray 
	    tampon: ""
	    buffer: []
	    line-index: 0
	    char-sz: none
	  	current-text-offset: 0x0
	  	cursor-text-offset: 0x0
	  	max-text-offset: 0x0
	  	text-color: black
	  	pane: []
	  	
	  	set-font-style: func [ font-s [word!]] [
	  		switch font-s [

      bold [insert tail buffer compose/deep [[ [size: 11 style: [(font-s)]] 
      (either cursor-text-offset/x <> 0 [cursor-text-offset] [as-pair 0 
      (line-index * 20)]) "" ]]]

      normal [insert tail buffer compose/deep [[ [size: 11 style: []] ( 
      either cursor-text-offset/x <> 0 [cursor-text-offset][as-pair 0 (line-index 
      * 20)]) "" ]]]

      underline[insert tail buffer compose/deep [[ [size: 11 style: [(font-s)]] 
      (either cursor-text-offset/x <> 0 [cursor-text-offset][as-pair 0 
      (line-index * 20)]) "" ]]]

      italic [insert tail buffer compose/deep [[ [size: 11 style: [(font-s)]] 
      (either cursor-text-offset/x <> 0 [cursor-text-offset][as-pair 0 
      (line-index * 20)]) "" ]]]
	  		]
	  	]
	  	
		feel: make feel [
			engage: func [f a e] [
				switch a [
				   
					key [ probe e/key
						switch/default e/key [
							#"^M" [
							line-index: line-index + 1

       f/current-text-offset: as-pair 0 f/current-text-offset/y + 20]

       insert tail f/buffer compose/deep [[ [size: 11 style: [(font-s)]](as-pair 
       0 (line-index * 20)) "" ]]
							
						][
							f/tampon: rejoin [f/tampon to-string e/key]
							draw-text: []
							print "f/buffer:"
							probe f/buffer
							foreach line-to-draw f/buffer [
								print "line-to-draw"
							;line-to-draw: f/buffer/1
								;probe line-to-draw
							;set [font-style start-offset text-to-show ] line-to-draw
							
								font-style: line-to-draw/1
								start-offset: line-to-draw/2
								line-to-draw/3: rejoin [line-to-draw/3 to-string e/key]
							;probe font-style 
							;probe start-offset
							
								font-obj: make face/font font-style
							;probe font-obj 
								text-to-show: line-to-draw/3
								;probe text-to-show

         insert tail draw-text  compose [ font (font-obj) pen (f/text-color) 
         text (start-offset) (text-to-show)]
							] 
							;print "draw-text:"
							;probe draw-text
							

       ;draw-text: compose [ pen (f/text-color) text (f/current-text-offset) 
       (f/tampon)]
				    		f/effect: make effect reduce [ 'draw draw-text  ]
				    		draw-text: none 
				    		;probe f/current-text-offset

       f/cursor-text-offset: as-pair (f/cursor-text-offset/x + 9) f/current-text-offset/y 
				    		;show f
						]
						f/pane/1/offset: f/cursor-text-offset 
						show f
					]
					down [
						;insert f/buffer compose [(as-pair 0 (line-index * 20)) ""]
						focus f show f
					]
					
				]
			]
		]
		append init [

   insert buffer compose/deep [[[size: 11 style: []] (as-pair 0 (line-index 
   * 20)) ""]]
			probe buffer

   insert pane make face [ color: red size: 2x20 offset: cursor-text-offset 
    ]
			show self 
		]
	]
]


view layout [
  across
  	btn "bold" [test-rte/set-font-style 'bold]
  	btn "underline" [test-rte/set-font-style 'underline]
  	btn "italic" [test-rte/set-font-style 'italic]
  	btn "normal" [test-rte/set-font-style 'normal]
  return
  	test-rte: rte 300x300
]
Henrik
5-Dec-2005
[665]
shadwolf, well, it's a start :-)
shadwolf
5-Dec-2005
[666x4]
i will be really glad if  some AGG guru could have a look on this 
script and modify enhace it and maybe make a tiny lib  ^^
what we need for text  to begin is bold/italic/underline/normal/color 
 If you have 10 more minutes to pend on it  images  would be a plus 
 ^^
Henrik yes ... hum i guess you  didn't see this script runing lol 
it looks like I was drunk when i wrote that  lol
my main idea was to use draw and use a cursor /input output similator 
but i'm not really a specialist in that kind of motion
ICarii
5-Dec-2005
[670]
hiya shadwolf.. also working on something similar in the past.  Never 
finished it though an alpha for flounder is still on the website.
shadwolf
5-Dec-2005
[671x2]
As  all of us i use premade stuff included in over priced C libraries 
 for "prfessionnel"
icarii can you past url of this project here this will allow ppl 
to compare / merge technics ...
ICarii
5-Dec-2005
[673x2]
http://rebol.mustard.co.nz/projects.htm
I'm intending to move flounder to AGG when i get a spare moment
shadwolf
5-Dec-2005
[675]
by extension i was planing this to be once a short and full working 
solution will be found to insert it to RebGUI as a basic widget  
of this set  ^^
ICarii
5-Dec-2005
[676x2]
uses draw at present but not many differences
nice idea for widget
shadwolf
5-Dec-2005
[678]
but u know ... hen u are drunk  you have full ideas then the next 
morning on wake up you read back the code and  "Hoooooooo damn ... 
was is this ?? i made it  ?? no serrious that can be ... What does 
all those lines are supposed to do  ???"
ICarii
5-Dec-2005
[679]
hehe
shadwolf
5-Dec-2005
[680]
Shadwolf -> Drunk Coder .....  hum not all the  time but this time 
yes  ..
Graham
5-Dec-2005
[681]
Hey Shadwolf ... don't miss Ashley's message to you in RebGUI channel!
shadwolf
5-Dec-2005
[682x6]
done  ^^
but then i have a abnormal bug witch means nothing ...
how can a widget in external context mode works better than a widget 
internal context mode
having the same strict code lol
Founder-a4 with rebol/view 1.3 ** Script Error: Invalid argument: 
+
** Where: view
** Near: show scr-face
if new [do-events]
>>
i have looked long time ago at rebconsole code ... but without understanding 
it mutch ...
ICarii
6-Dec-2005
[688]
that's probably because the script was written for view 1.2.48 i 
think
Rebolek
6-Dec-2005
[689]
Are the AGG bugfixes part of View 1.3.2 ?
Pekr
6-Dec-2005
[690]
what was particularly fixed in agg? can svg work continue?
shadwolf
7-Dec-2005
[691x2]
Svg  works need a dubeged matrix  -> scaling problem  and  gradients 
that feet ratio  information and   not  fixed area  ^^ those things 
can be script coded but this will complicate the SCV rendering engine 
and makes it slower for nothing ...
SVC = SVG
Pekr
7-Dec-2005
[693x3]
Those are exactly the questions/request, which I would expect to 
be answered by RT
iirc Cyphre said some fixes will be mady ... such features are not 
fixes though, so we can only hope ...
shadwolf - have you put your request into rambo?
Cyphre
9-Dec-2005
[696x2]
Shadwolf: the matrix problem you had should be fixed in DRAW 1.3.2. 
The gradient ratio parameters will be added probably in the next 
release.
I'll post resume of AGG fixes/improvement very soon in this group 
so you are informed.
Josh
15-Dec-2005
[698x4]
I'm trying to isolate a possible bug having to do with 'line-pattern 
.  I don't think using a negative number should cause rebol to lock 
up the CPU
Submitting to RAMBO
(Warning, this will lock up whatever instance of rebol you are running 
it in)

sp: 0
b: layout [
    c: box 400x400 white effect [
		draw [
			'pen 255.23.23 23.255.23 
			'line-pattern 1 sp
			'curve 50x350 200x50 350x350 200x300
		]
	]
	button "boom" [sp: sp - 1 show c]
]
view b
I don't know why someone would use a negative number, but this shouldn't 
happen if they do
Geomol
15-Dec-2005
[702]
May be a hard thing to check for without hitting performance too 
much, because of the late binding in REBOL. I can live with it.
Carl
15-Dec-2005
[703x2]
Good one Josh. Keep them coming.
BTW, I've got a solution to the late-binding issue. I plan to write 
a blog about it soon.
Izkata
15-Dec-2005
[705]
On View 1.3.1, it didn't lock up for me..
Josh
15-Dec-2005
[706x2]
I'm using REBOL/View 1.3.2.3.1 5-Dec-2005 Core 2.6.3
I thought I submitted a RAMBO ticket earlier for it, but now I can't 
find it