;;;;;;;;;;;;;;;;;;;Example usage;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; :bottonMenu '(("BUTTON1" :label "Button 1"
;; :push (format t "~%Button 1 pushed"))
;; ("BUTTON2" :label "Button 2"
;; :push (format t "~%Button 2 pushed")
;; :release (format t "~%Button2 released"))
;; ("BUTTON3" :label "Button 3"
;; :push (format nil "display ~S" "push button3")
;; :release "display \"release button3\""
;; )
;;
;;If in the specification no :release or :browser-release-cmd appears, a
;;simple pushbutton will be generated otherwise a togglebutton.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; :modeMenu '(("BUTTON1"
;; :label "Button 1"
;; :push (print "Button 1 pushed"))
;; ("BUTTON2"
;; :label "Button 2"
;; :browser-push-cmd "Button 2 pushed")
;; ("BUTTON3"
;; :label "Button 3"
;; :push (print "Button 3 pushed")))
;; :modeMenuInitialButton "BUTTON2" ;; if you leave this line out,
;; the first button of modeMenu is taken as initial button
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; :topMenu '(("TOP1"
;; :label "Top 1"
;; :contents (("TOP1_1"
;; :label "Top 1 1"
;; :push (print "Top 1 1 pushed")
;; )
;; ("TOP1_2"
;; :label "Top 1 2"
;; :push "display \"Top 1 2 pushed\" "
;; )
;; ("-")
;; ("TOP1_4"
;; :label "Top 1 4"
;; :push (print "Top 1 4 pushed")
;; :release (print "Top 1 4 released")
;; :initial-value t
;; )
;; )
;; :mutualExclusion ("TOP1_2" "TOP1_1")
;; )
;; ("TOP2"
;; :label "Top 2"
;; :contents (("TOP2_1"
;; :label "Top 2 1"
;; :push (print "Top 2 1 pushed")
;; )
;; )
;; )
;; ("TOP3"
;; :label "Options"
;; :contents (("OPTION1"
;; :label "Show Tree"
;; :push (sd-browser-exec-cmd ,name :GRAPHICS-MODE)
;; :release "Show Tree released")
;; ("OPTION2"
;; :label "Select All"
;; :push (sd-browser-exec-cmd ,name :SELECT-ALL))
;; )
;; )
;; )
;;
Where:
:push - can be either a string or a function. If it is a string,
the string is input into SD buffer.
:release - if defined, then the button will have a toggle indicator on it.
:mutualExclusion - if defined, will cause toggle to take shape of a diamond.
:browser-push-cmd/browser-release-cmd
- string name of the browser command to send to the browser. The
browser must have this command defined, otherwise nil is returned. If
the browser-command return value is not nil, the UI toggle is set.
Otherwise, the toggle is left in it's previous state.
Example highlighting parts of the structure browser supplied in SD.
(when (create-graphical-browser name
:tree name
:refresh-events *SD-CHANGE-CURRENT-OBJECT-EVENT*
:toplabel "Graphical Structure Browser"
:mapToggle "TOP-MENU-W-BROWSER-TB"
:modeMenu
`(("WP" :label "WPs"
:push (set-parcel-browser-mode ,name "WP" t)
:release (set-parcel-browser-mode ,name "WP" nil)
)
("PARTS" :label "Parts"
:push (set-parcel-browser-mode ,name "PARTS" t)
:release (set-parcel-browser-mode ,name "PARTS" nil)
)
("LAYOUT" :label "Layouts"
:push (set-parcel-browser-mode ,name "LAYOUT" t )
:release (set-parcel-browser-mode ,name "LAYOUT" nil)
)
("FEATURE" :label "Feat's"
:push (set-parcel-browser-mode ,name "FEATURE" t )
:release (set-parcel-browser-mode ,name "FEATURE" nil)
)
("REL_SET" :label "R-Sets"
:push (set-parcel-browser-mode ,name "REL_SET" t )
:release (set-parcel-browser-mode ,name "REL_SET" nil)
)
("ALL" :label "All"
:push (set-parcel-browser-mode ,name "ALL" t)
:release (set-parcel-browser-mode ,name "ALL" nil)
)
)
:modeMenuInitialButton "ALL"
:modeMenuMutualExclusion nil
:topMenu
`(
("Actions" :label "Actions"
:contents
(
("ActivePart" :label "Active Part"
:push (sd-browser-exec-cmd ,name :SELECT-AND-ACTIVATE
"CURRENT_PART"))
("ActiveWP" :label "Active WP"
:push (sd-browser-exec-cmd ,name :SELECT-AND-ACTIVATE
"CURRENT_WP"))
("-")
("SelectAll" :label "Select All"
:browser-push-cmd :SELECT-ALL)
("Clear" :label "Clear"
:browser-push-cmd :CLEAR-SELECT-LIST)
("-")
("PrintTree" :label "Write Tree"
:push ,(format nil "PRINT_BROWSER_TREE ~S" name)
)
)
)
("View" :label "View"
:contents
(
("dual" :label "Detail"
:push (browser-exec-cmd ,name :SET-DETAILED-MODE t)
:release (browser-exec-cmd ,name
:SET-DETAILED-MODE nil)
:initial-value nil
)
("ExpandTable" :label "Expand Detail"
:push (sd-browser-exec-cmd ,name :EXPAND-TABLE t)
:release (sd-browser-exec-cmd ,name :EXPAND-TABLE nil)
:initial-value nil)
("-")
("ExpandTree" :label "Expand"
:push (sd-browser-exec-cmd ,name :EXPAND-TREE))
("Contract" :label "Collapse"
:push (sd-browser-exec-cmd ,name :EXPAND-TREE 1))
)
)
("Options" :label "Options"
:contents
(
("Pixmode" :label "Icons"
:push (browser-exec-cmd ,name
:SET-DETAILED-PIXMAP-MODE t)
:release (browser-exec-cmd ,name
:SET-DETAILED-PIXMAP-MODE nil)
:initial-value t)
("ElemName" :label "Element Names"
:push (progn
(enable-named-elements t)
(rebuild-browser-tree ,name))
:release (progn
(enable-named-elements nil)
(rebuild-browser-tree ,name))
:initial-value nil)
)
)
)
)
;(sd-browser-exec-cmd name :DISPLAY-SECONDARY-ICON t)
t
);end when