;; an example on how to customize em-drop-menus.gwm  em-widgets.gwm
;; experimental epoch menus

;; first some color & font customisations

(setq epoch-color "bisque")

(for i '("1" "2" "3" "4")
  (set (atom (+ "epoch-color" i))
    (color-make (+ epoch-color i))
))

(: widget.Bfont  (font-make "*clean-medium*--10*c-60*"))
(: widget.font (font-make "*clean-bold*--10*c-60*"))
(setq widget.foreground epoch-color4)
(setq widget.background epoch-color1)
(setq widget.name-font (font-make "fixed"))
(setq widget.name-foreground black)

(: widget.weave (pixmap-make
    epoch-color4
    "/usr/include/X11/bitmaps/cross_weave"
    epoch-color1
))
(: widget.black (pixmap-make
    black
    "/usr/include/X11/bitmaps/black"
    epoch-color4
))
(: widget.gray (pixmap-make
    black
    "/usr/include/X11/bitmaps/black"
    epoch-color4
))
(: widget.lt-gray (pixmap-make
    black
    "/usr/include/X11/bitmaps/black"
    epoch-color2
))

(load "em-widgets.gwm")			; then load the packages
(load "em-drop-menus.gwm")

					; then some menus and code to implement
					; direct choosing of buffer or file
					; from a list with 2nd mouse button
(set-window Emacs.epoch style:select)

(Dmenu: Dmenu.fonts
   '("fonts" (
      ("screen-11" "(progn (font \"screen.r.11\") (redraw-display))")
      ("screen-12" "(progn (font \"screen.r.12\") (redraw-display))")
      ("screen-12-Bold" "(progn (font \"screen.b.12\") (redraw-display))")
      ("screen-13" "(progn (font \"screen.r.13\") (redraw-display))")
      ("screen-14" "(progn (font \"screen.r.14\") (redraw-display))")
      ("screen-14-Bold" "(progn (font \"screen.b.14\") (redraw-display))")
      ("screen-7" "(progn (font \"screen.r.7\") (redraw-display))")
      ("fixed" "(progn (font \"fixed\") (redraw-display))")
      )))

(Dmenu: Dmenu.buffers 
   '("buffers" (
      ("list of buffers"
	"(progn \
(list-buffers) \
(switch-to-buffer \"*Buffer List*\") \
(delete-other-windows) \
(if (not (boundp 'mouse-Buffer-menu-select)) (progn \
    (setq mouse-Buffer-menu-select t)\
    (defun mouse-Buffer-menu-select (&optional mdata) (interactive) \
      (Buffer-menu-select) \
))) \
(if (boundp 'imouse-version)\
  (local-set-mouse mouse-middle mouse-down 'mouse-set-point-or-select) \
  (local-set-mouse mouse-middle mouse-down 'mouse::set-point)) \
(local-set-mouse mouse-middle mouse-up 'mouse-Buffer-menu-select) \
)")
      ("other buffer" "(switch-to-buffer (other-buffer))")
      ("*scratch* buffer" "(switch-to-buffer \"*scratch*\")")
      ("-" (bell))
      ("kill buffer" "(kill-buffer (current-buffer))")
      )))

(Dmenu: Dmenu.files 
   '("files" (
      ("list of directory"
	"(progn \
(dired \".\") \
(delete-other-windows) \
(if (not (boundp 'mouse-dired-find-file)) (progn \
    (setq mouse-dired-find-file t)\
    (defun mouse-dired-find-file (&optional mdata) (interactive) \
      (dired-find-file) \
))) \
(if (boundp 'imouse-version)\
  (local-set-mouse mouse-middle mouse-down 'mouse-set-point-or-select) \
  (local-set-mouse mouse-middle mouse-down 'mouse::set-point)) \
(local-set-mouse mouse-middle mouse-up 'mouse-dired-find-file) \
)")
    (" - - - " "")
    (".Xdefaults" "(find-file \"~/.Xdefaults\")")
    ("profile-epoch" "(find-file \"~/el/profile-epoch-4.0.el\")")
    ("wool" "(find-file \"~/Gwm2/wool/TODO\")")
      )))

(Dmenu: Dmenu.db
    '("db" 
     (
      (" " "")
      ("byte-compile-current-file" "(byte-compile-current-file)")
      ("toggle debug" "(setq debug-on-error (not debug-on-error))")
      ("debug on" "(setq debug-on-error t)")
      ("debug off" "(setq debug-on-error f)")
      )))

(: Dmenu.epoch-menus
   (list 
    Dmenu.fonts
    Dmenu.files
    Dmenu.buffers
    Dmenu.db
    ))
