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

World: r3wp

[Rebol School] Rebol School

DanielP
16-Jan-2009
[1382x3]
Hi.
Let's see this code:

toto: [25 10 14]

renv: func [b [block!]]
[
 foreach Val b [ print Val + 1]
]
when I call this function, with "renv [ toto] ". I receive an error 
message because the elements in toto are viewed as word!, not as 
integer! by Rebol.
Graham
16-Jan-2009
[1385]
you've got a block inside a block
DanielP
16-Jan-2009
[1386]
?
Graham
16-Jan-2009
[1387x3]
you can't add 1 to a block
renv [ toto ]
and toto has no value
DanielP
16-Jan-2009
[1390]
ok, but when I use the same code without insert it in a function, 
it work perfectly
Graham
16-Jan-2009
[1391]
renv reduce [ toto ] => renv [ [ 1 2 3 ]]
DanielP
16-Jan-2009
[1392]
the code :

toto: [25 10 14]
foreach Val toto [ print Val + 1]

work because elements in toto  are considered as integers.
Graham
16-Jan-2009
[1393x2]
and so will

renv toto
but not 

renv [ toto ]
DanielP
16-Jan-2009
[1395]
oh ... I'm stupid ! ;)
Steeve
16-Jan-2009
[1396]
you are in Rebol School ;-)
Brock
30-Jan-2009
[1397x8]
I've got a graphic related project that I want to start working on. 
 It deals with enhancing Frank S's code that Graham enhanced further... 
http://www.rebol.org/view-script.r?script=paintplus.r
I'd like to be able to make the objects that get drawn on the page 
true objects that can later be dragged to a different location.
I was able to drag REBOL Styles from the area off the 'canvas' onto 
the canvas and around the pane in general using the movestyle 'feel 
found at http://rebol.com/how-to/feel.html
However, I can't get this same code to work on the Boxes, Circles, 
Arrow or Lines that I draw within the draw area.
I'd really appreciate it if one of our graphic gurus can jump in 
and let me know how I can either use the code above to do this, or 
suggest an alternative.
This is my first attempts at using feel and the Draw dialect.  Frank 
& Grahams code has got me started, but I've now looked at this for 
some time and can't get anywhere.
I've also looked at warp-image.r from the Rebol Desktop sample apps 
as I'd really like the behaviour to drag points to change the start 
and stop points of the Lines and Arrows etc... but can't seem to 
blend these behaviours into one tool.
The end result would be similar to Vector drawing program with the 
output being a DRAW dialect.  Any interest?
Graham
30-Jan-2009
[1405]
Have you tried Geomol's canvas thingy?
Reichart
30-Jan-2009
[1406x2]
The big question is, what format should the data be stored in, as 
well as exported/imported in...
I really wish SVG had won, or, well, ANYTHING had won.
Brock
30-Jan-2009
[1408x2]
I'd be happy with a draw block.  My plan is to store the draw block 
in a database record so the image can be built and the objects remain 
editable if fine-tuning is required.  I've been playing with sqlite.r 
for the storage side of things.
Graham, no I haven't.  I'll take a look at canvas, I don't recall 
any discussion about this in the past.  (I read, I just don't remember 
:-(  )
Reichart
30-Jan-2009
[1410]
I learned something a long time ago about formats.  Lock it down 
up front, and make sure you can convert on the fly.  If you don't, 
you waste a lot of time later.
Also, treat everything as a "event".   This way Undo works.
Graham
30-Jan-2009
[1411]
Geomol's paint program is a copy of the famous Amiga paint who's 
name now escapes me.
Josh
30-Jan-2009
[1412]
Dpaint!
Brock
30-Jan-2009
[1413x3]
Yes, okay, I remember.  I also see the group here in AltME.  Likely 
too complicated for my needs.  I want to build a db interface that 
shows the image and stores meta-data about the image.  I want to 
be able to edit the image if needed, or add new images and content 
using the drawing packing that is included.  Essentially this is 
for building drills for various different sports.  With all the drills 
built, a practice plan can then be built.
The smaller the better.
The final output would be a printed version of the collection of 
drills that were selected, likely via PDF-maker , or just HTML.
Maarten
30-Jan-2009
[1416]
Events... and queues.
Brock
30-Jan-2009
[1417x3]
queues?
do you mean something like an stack?
Reichart, I didn't see your message about formats.  Convert on the 
fly, can you give me more on what you mean by convert on the fly?
Reichart
30-Jan-2009
[1420]
Well, if you assume that your internal storage method is one which 
just needs to be "converted" to an other, like CSV => XML, you might 
be in for a suprise when trying to model a real time dynamic system 
with Undo like a paint program with a file format as export.


For example, do you store a given object once, with the history of 
the object elsewhere, or do you store the object together, with the 
most recent at the top of the list.

Also, Do you store objects, and actions, or both togther.
Brock
31-Jan-2009
[1421]
Okay, I follow now.  Like using the Photoshop format that saves the 
object order etc with the file.  Tx for the explanation.
Gregg
31-Jan-2009
[1422]
I did a primitive whiteboard a number of years ago, but I cheated. 
When you placed a line, arrow, etc. there were little faces attached 
to the drag points that acted as handles.
Reichart
31-Jan-2009
[1423]
Brock, yes.
Brock
31-Jan-2009
[1424x2]
That's how Carl did it in warp-image.r, so I assume that is close 
to what I need.  Anton might use some different techniques in some 
of his recently published drag & drop examples on his site.  I need 
to look at them again to see how he handled dragging the shape.
Thanks for the feedback.
Graham
31-Jan-2009
[1426x2]
Brock, show us your enhancements to paintplus, and then maybe someone 
can help you.  It's hard to deal in the abstract.
And it's not clear to me what you want.
Brock
31-Jan-2009
[1428x4]
Graham, I haven't really enhanced it as far as new features, more 
added a little more of what already existed ;-) .  I've added a different 
line type and some predefined text symbols for quick 'drag and drop' 
of frequently used objects.  Oh, and connected the SAVE button to 
write to the sqlite backend.  Nothing earth-shattering by any stretch. 
 I'll post what I have to my MS Skydrive for you to access it.
What I want is the ability to move the shapes from the drawing area 
once they have been drawn.  Currently, you have the UNDO feature 
which you implemented to remove the last item in the draw stack. 
 But I want the ability to click on any line drawn, get some sizing 
handles, and move the handles to reposition the location of the object. 
 So you don't have to redraw an entire image just to fine tune the 
placement of a line that was placed early in the draw session.
... move the shapes IN the drawing area ... after they have been 
drawn.
I will do this in the AM, too tired now and it's on my work laptop, 
not my personal desktop that I am currently at.