// COLLAGE - display pointlist objects at different sizes / colors

set file = ""
set scale = 1.0
logo linecolor = "darkblue"
logo linethick 0.5

// start out with happy...
pointlist startcapture
pointlist loadfile "ptsfiles/happy.pts"
pointlist endcapture

message "Click with mouse on graphic area.." "Choose object|Object size|Colors etc.|Clear|Done"

// repeat for every mouse click or button selection..
repeat untilbreak [
  getkey
  set k = whichkey

  if :k = "done" [ break ]

  elseif :k = "choose object" [
     set file = filepick "Select a picture file" "ptsfiles" "*"
print :file
     if :file = "cancel" [ samemessage; continue ]
     set file = concat 2 "ptsfiles/" :file
print :file
     pointlist clearall
     pointlist startcapture
     pointlist loadfile :file
     pointlist endcapture
     samemessage
     continue
     ]

  elseif :k = "object size" [
    set scale = buttonchoice "Select size factor:" "0.17|0.3|0.5|0.75|1.0|1.3|1.6"
    samemessage
    continue
    ]

  elseif :k = "colors etc." [
    logo linecolor = colorchoice "Select line color"
    logo fillcolor = colorchoice "Select fill color"
    logo linethick = buttonchoice "Select line thickness" "0.5|1|1.5|2|3|4|5|8|12|20"
    samemessage
    continue
    ]

  elseif :k = "clear" [ 
    clear
    samemessage
    continue 
    ]
 
  // render the picture at the click location using current size..
  pointlist render whereclick :scale
  ]
