[+++cmykSich 14nov89gr+++]

[set figures to new bezier or new rule]
<de setfigures (l1 l2)
(InvalFig (nth 0 lr))
   (cond
      ((and l1 l2)
         (mapc2 l1 l2
            '((lr lf)
               (InvalFig (nth 0 lr))
               (with (nth 0 lr)
               (slot rule (nth 1 lr))
               (slot rTint (nth 2 lr))
               (adjBez (car lf) (cdr lf)) ) ) ) )
               [+++++++++++
               (InvalFig (nth 0 lr))
               [(InvalFig (car lf))]
               (put (nth 0 lr) 'rule (nth 1 lr))
               (put (nth 0 lr) 'rTint (nth 2 lr))
               (adjBez (car lf) (cdr lf)) ) ) )
               +++++++]
      (l1
         (mapc l1
            '((lr)
 [+++++++++++
(InvalFig (nth 0 lr))
                 (with (nth 0 lr)
             (slot rule (nth 1 lr))
               (slot rTint (nth 2 lr)) ) ) )
      (l2
         (mapc l2
            '((lf)
[+++++++++++
 (InvalFig (car lf))
               (adjBez (car lf) (cdr lf)) >

t [listdlg.l]
[+++++++++
<de filist ()
(local (orgfili fili itemHit a pos pt l l1 l2)
   (setq l1)
   (setq l2)
   (when (setq orgfili (get *app 'figures))
      (if *mark
         (setq fili *mark)
         (setq fili orgfili) )
      (setq *fili
         (mapcar fili
            '((fig)
               (list
                  (get fig 'bezier)
                  (or (get fig 'rule) 0)
                  (or (get fig 'rTint) '(0 0 0 0))) ) ) )
      (setq
         *dlgEditItems $filiEditItems
         *dlg (GetNewDialog filistDlg nil -1)
         l (length fili)
         pt 48)     [startpt for edititems points]
      (localPort *dlg
         (setq a (car fili))
         (setq pos 1)
         [(paramtext (format (length orgfili)))]
         (if (eq l 1)
            [(setctlmax (d-item #hsbarr) 1)]
            (hideditem *dlg #hsbarr)
            (progn
               (showditem *dlg #hsbarr)
               (setctlmin (d-item #hsbarr) 1)
               (setctlmax (d-item #hsbarr) l)
               (setctlvalue (d-item #hsbarr) 1) ) )
         (seefili pos)
         (while (lessp 2 (ModalDialog fidlgFilter itemHit)) ) )
      (when (eq 1 itemHit)
         (do refresh *app)
         (riedfili
            (if (eq (length fili) 1)
               1
               (getctlvalue (d-item #hsbarr)) ) )
         (mapc2 fili *fili
            '((fig l)
               (unless (and (equal (if (eq nil (get fig 'rule))
                                       0
                                       (get fig 'rule) )
                                   (cadr l) )
                             (equal (if (eq nil (get fig 'rTint))
                                          '(0 0 0 0)
                                          (get fig 'rtint) )
                                   (caddr l) ) )
                       (push (list fig (get fig 'rule)(get fig 'rTint)) l1) )
) )
         (when (or l1 l2)
            (undoFilist l1 l2 l fig) ) )
      (DisposDialog *dlg) >
++++++++]

<de selectMask (g)
   (if (zerop (bitand shiftKey (ev-modifiers *event)))
      (unless
         (and
            (eq g (car *mark))
            (eq 1 (length *mark)) )
         (doSelMask g
            '((g)
               (mapc *mark unHiMask)
               (hiMask g) ) ) )
      (doSelMask g
         '((g)
            ((if (memq g *mark) unHiMask hiMask) g) >

<de doMask (pt)
   (local (g z)
      (with *app
         (setq z (slot zoom))
         (cond
            ((setq g
                  (find *mark
                     '((g)
                        (onGraf pt g z
                           (mul -32 z (slot* pos-h))
                           (mul -32 z (slot* pos-v)) ) ) ) )
               (make
                  "Change Mask"
                  (list g *mark (slot* mask))
                  '((g m x)
                     (drawHiMask (car *mark))
                     (setq *mark m)
                     (with *app
                        (slot* mask x) )
                     (drawHiMask g) )
                  (list g (chgMask g pt))
                  '((old new)
                     (when *redo
                        (drawHiMask old)
                        (drawHiMask new) )
                     (with *app
                        (slot* mask
                           (cons new
                              (delete old (slot* mask)) ) ) )
                     (setq *mark
                        (cons new (delete old *mark)) ) ) ) )
            ((and
                  (zerop (bitand shiftKey (ev-modifiers *event)))
                  (setq g
                     (find *mark
                        '((g)
                           (inGraf pt g z
                              (mul -32 z (slot* pos-h))
                              (mul -32 z
                                 (slot* pos-v) ) ) ) ) ) )
               (dragPixels g pt) )
            ((setq g
                  (find (slot* mask)
                     '((g)
                        (inGraf pt g z
                           (mul -32 z (slot* pos-h))
                           (mul -32 z (slot* pos-v)) ) ) ) )
               (selectMask g) )
            (t (newMask pt)) >

[++++++
<de check1rt (item)
   (for (i 1 zoomCmd)
      (CheckItem (GetResource "MENU"  retouchM) i (eq i item)) >
++++++]

[++++++
         (#editM
            (case theItem
               (#undoCmd (doUndo))
               (#cutCmd
                  (when *mark
                     (undo
                        "Undo Cut"
                        '((x)
                           (putMask *clip)
                           (setq *clip x) )
                        *clip )
                     (setq *clip *mark)
                     (removeMask *mark) ) )
               (#copyCmd
                  (when *mark
                     (undo
                        "Undo Copy"
                        '((x) (setq *clip x))
                        *clip )
                     (setq *clip (copy *mark)) ) )
               (#pasteCmd
                  (when (and *clip *mark)
                     (undo
                        "Undo Paste"
                        '((x)
                           (removeMask *mark)
                           (mapc x hiMask) )
                        *mark )
                     (local (dh dv)
                        (setq
                           dh
                              (apply min
                                 (mapcar *clip caaar) )
                           dv
                              (apply min
                                 (mapcar *clip cdaar) )
                           dh
                              (sub
                                 (left (caar *mark))
                                 dh
                                 -10 )
                           dv
                              (sub
                                 (top (caar *mark))
                                 dv
                                 -10 ) )
                        (putMask
                           (mapcar *clip
                              '((g)
                                 (offsetGraf
                                    g
                                    dh
                                    dv ) ) ) ) ) ) )
               (#clearCmd
                  (when *mark
                     (undo
                        "Undo Clear"
                        putMask
                        *mark )
                     (removeMask *mark) ) )
               (#dupCmd
                 (when *mark
                     (undo
                        "Undo Duplicate"
                        '((x)
                           (removeMask *mark)
                           (mapc x hiMask) )
                        *mark )
                     (putMask
                        (mapcar *mark
                           '((g) (offsetGraf g 10 10)) ) ) ) )
               (#allCmd
                  (undo
                     "Undo Select All"
                     '((x)
                        (mapc *mark
                           '((g)
                              (or
                                 (memq g x)
                                 (unHiMask g) ) ) ) )
                     *mark )
                  (mapc (get *cmyk 'mask) hiMask) )
            ) )
         (#retouchM
            (case theItem
               (#msrCmd (setRtCmd doMeasure))
               (#spuitCmd (setRtCmd doSpuit))
               <#pxlcopyCmd
                  (if (eq *retouch doPxCopy)
                     (rtOff)
                     (progn
                        (enterSrc)
                        (setq
                           *retouch doPxCopy
                           *cursor (GetCursor crossCursor) >
               (#brushCmd (setRtCmd doBrush))
               (#lToneCmd (doLocalTone))
               (#gToneCmd (doGlobalTone))
               (#loCmd (pixFilter pixLo "Low"))
               (#hiCmd (pixFilter pixHi "High"))
               (#zoomCmd (doZoom))
                  ) )
         (#blotM (check1blot theItem))
         (#freelineM
            (case theItem
               (#autoCmd (toggle *autoLine))
               (#showMaskCmd
                  (put *cmyk 'showMask
                     (not (get *cmyk 'showMask)) )
                  (refreshCmyks) )
               (#showCutCmd
                  (put *cmyk 'showCut
                     (not (get *cmyk 'showCut)) )
                  (refreshCmyks) )
            ) )
      >
      (HiliteMenu 0)
++++++]
