All pastes #175209 Raw Edit

SlideShow :D

public text v1 · immutable
·published 2006-09-18 16:16 UTC
rendered paste body
alias image-viewer-slideshow { /dialog -ma timings timings }
on *:DIALOG:Timings:init:*: { /variable-it }
on *:DIALOG:Timings:sclick:*: { 
  if ($did == 4) {
    if (%a > %file.0) {
      ohno.dialog-end
    }
    else {
      dialog -x Timings Timings
      finish-it-off 
    }
  }
  if ($did == 3) {
    dialog -x Timings Timings
    undaset
  }
}
alias -l undaset {
  unset %file.*
  unset %timing
}
alias -l finish-it-off { 
  inc %a 1
  if (%a > %file.0) { timertime off | dialog -x image-slideshow-to-size | unset %file.* %teh-file* %width %height %timing %a | halt }
  set %teh-file $($+(%,file.,%a),2)
  if $dialog(image-slideshow-to-size) {
    dialog -x image-slideshow-to-size
  }
  Fit-to-size-image-viewer-slideshow 
}
on *:DIALOG:image-slideshow-to-size:init:*: { dialog-timing-method }
alias -l /dialog-timing-method {
  timertime %file.0 %timing finish-it-off
}
dialog Timings {
  title "Timings"
  size -1 -1 124 67
  option dbu
  edit "", 1, 37 30 50 10, autohs %timing
  text "Please insert the timings between the images in the slideshow you can exit without activating the slideshow through the cancel button", 2, 3 6 117 21
  button "Cancel", 3, 74 50 37 12
  button "Continue", 4, 12 50 37 12
}
dialog image-slideshow-to-size {
  title "image-viewer-to-size"
  size -1 -1 %width %height
  option pixels
  icon 1, 0 0 %width %height, %teh-file, 0, noborder
}
alias -l Fit-to-size-image-viewer-slideshow {
  echo blah2
  if ($pic(%teh-file).height < 600) /set %height $pic(%teh-file).height
  else { /set %height 600 }
  if ($pic(%teh-file).width < 800) /set %width $pic(%teh-file).width
  else { /set %width 800 }
  set %teh-file %teh-file
  dialog -ma image-slideshow-to-size image-slideshow-to-size
}
alias variable-it {
  var %i = 0
  while (%i < $ini(image-album.ini,files,0)) {
    inc %i
    /set %file. $+ %i $readini(image-album.ini,files,$ini(image-album.ini,files,%i))
  }
  /set %file.0 %i
}