Commit 735ec9c2 authored by David O'Toole's avatar David O'Toole

gui demo 1

parent d9d919f8
......@@ -568,9 +568,9 @@
(:label "Paste as new buffer" :action show-paste-as-new-buffer-dialog)
(:label "Paste from" :action show-paste-from-dialog)
(:label "Paste selection from" :action show-paste-selection-from-dialog)
(:label "Select all" :action edit-select-all)
(:label "Clear selection" :action edit-clear-selection)
(:label "Invert selection" :action edit-invert-selection)
(:label "Select all" :action select-all)
(:label "Clear selection" :action clear-selection)
(:label "Invert selection" :action invert-selection)
(:label "Node properties" :action show-node-properties-dialog)
(:label "Shell command history" :action show-shell-history-dialog))))
......
......@@ -125,12 +125,14 @@
(zerop (hash-table-count objects)))))
;; Initialization:1 ends here
;; Buffers can't have halos
;; Buffers can't have halos or be selected
;; [[file:~/xelf/gui.org::*Buffers%20can't%20have%20halos][Buffers can't have halos:1]]
;; [[file:~/xelf/gui.org::*Buffers%20can't%20have%20halos%20or%20be%20selected][Buffers can't have halos or be selected:1]]
(defmethod make-halo ((self buffer)) nil)
;; Buffers can't have halos:1 ends here
(defmethod select ((self buffer)) nil)
(defmethod unselect ((self buffer)) nil)
;; Buffers can't have halos or be selected:1 ends here
;; Pausing the action
......@@ -364,7 +366,12 @@
(defun select-all ()
(clear-halos (current-buffer))
(do-nodes (node (current-buffer))
(select thing)))
(select node)))
(defun invert-selection ()
(clear-halos (current-buffer))
(do-nodes (node (current-buffer))
(toggle-selected node)))
(defmethod destroy-selection ((self buffer))
(prog1 nil (mapc #'destroy (selection))))
......@@ -387,7 +394,7 @@
(when (slot-value self 'region)
(clear-selection)
(dolist (each (region-objects self))
(make-halo each))
(select each))
(clear-region self)))
;; Selecting the region:1 ends here
......@@ -2031,6 +2038,9 @@ See sidebar for more commands to try.
(history :initform nil :documentation "A queue of strings containing the command history.")
(history-position :initform 0)))
(defmethod select ((self prompt)) nil)
(defmethod unselect ((self prompt)) nil)
(defmethod find-methods append ((prompt prompt))
'(toggle-read-only))
......@@ -3049,6 +3059,9 @@ See sidebar for more commands to try.
(defmethod unfreeze ((self phrase))
(setf (slot-value self 'frozen) nil)
(mapc #'unpin (mapcar #'find-object (slot-value self 'inputs))))
(defmethod select ((self phrase)) nil)
(defmethod unselect ((self phrase)) nil)
;; Manipulability:1 ends here
;; Orientation
......
......@@ -406,7 +406,12 @@ The Selection is a list of the currently selected objects.
(defun select-all ()
(clear-halos (current-buffer))
(do-nodes (node (current-buffer))
(select thing)))
(select node)))
(defun invert-selection ()
(clear-halos (current-buffer))
(do-nodes (node (current-buffer))
(toggle-selected node)))
(defmethod destroy-selection ((self buffer))
(prog1 nil (mapc #'destroy (selection))))
......@@ -1424,13 +1429,14 @@ This section is obsolete and will be removed in the future.
(defparameter *help-text*
"Welcome to Xelf.
Left-click-and-drag to move objects. Click objects to select them,
which opens a \"halo\" menu with operation handles. Use Control-click to
select multiple objects. \"X\" handle deletes objects. Lower right
corner handle resizes objects. Lambda handle executes objects.
Left-click-and-drag to move objects. Click objects to select them.
Use Control-click to select multiple objects.
Press <Alt-X> to enter Lisp commands, or right-click the background to
create an object by typing, then press <Return>.
Right-click to open a \"halo\" menu with operation handles.
\"X\" handle deletes objects. Lower right corner handle resizes
objects. Lambda handle executes objects.
Press <Alt-X> to enter Lisp commands, and <ESC> to quit the shell.
Copy: Control-C Cut: Control-X Paste: Control-V
Paste at pointer: Shift-Control-V
......@@ -2044,6 +2050,9 @@ above.
(history :initform nil :documentation "A queue of strings containing the command history.")
(history-position :initform 0)))
(defmethod select ((self prompt)) nil)
(defmethod unselect ((self prompt)) nil)
(defmethod find-methods append ((prompt prompt))
'(toggle-read-only))
......@@ -3058,6 +3067,9 @@ supported compiler.
(defmethod unfreeze ((self phrase))
(setf (slot-value self 'frozen) nil)
(mapc #'unpin (mapcar #'find-object (slot-value self 'inputs))))
(defmethod select ((self phrase)) nil)
(defmethod unselect ((self phrase)) nil)
#+end_src
** Orientation
......@@ -5200,9 +5212,9 @@ supported compiler.
(:label "Paste as new buffer" :action show-paste-as-new-buffer-dialog)
(:label "Paste from" :action show-paste-from-dialog)
(:label "Paste selection from" :action show-paste-selection-from-dialog)
(:label "Select all" :action edit-select-all)
(:label "Clear selection" :action edit-clear-selection)
(:label "Invert selection" :action edit-invert-selection)
(:label "Select all" :action select-all)
(:label "Clear selection" :action clear-selection)
(:label "Invert selection" :action invert-selection)
(:label "Node properties" :action show-node-properties-dialog)
(:label "Shell command history" :action show-shell-history-dialog))))
......
This diff is collapsed.
......@@ -6,8 +6,8 @@
(open-shell self))
(defmethod update :before ((self plong-gui))
(let ((ball (find-instances self 'ball)))
(when ball (destroy (first ball))))
;; (let ((ball (find-instances self 'ball)))
;; (when ball (destroy (first ball))))
(when (and xelf::*shell* (shell-p self))
(update xelf::*shell*)))
......@@ -30,51 +30,52 @@
(bind-event (current-buffer) '(:f9) 'xelf::toggle-other-windows)
(start-game plong)))))
(trace xelf::evaluate)
(trace xelf::get-property-list)
(trace xelf::apply-properties)
(trace xelf::show-dialog)
(trace xelf::tab)
(trace xelf::find-tab-parent)
(trace xelf::find-tab-proxy)
(trace xelf::position-within-parent)
(trace xelf::show-dialog)
(trace xelf::tap)
(trace xelf::get-property-object-pairs)
(trace xelf::get-property-entries)
;; (trace xelf::resize)
;; (trace xelf::layout)
;; (trace xelf::evaluate-here)
;; (trace xelf::evaluate-expression)
;; (trace xelf::evaluate-output)
;; (trace xelf::layout)
(trace xelf::select)
(trace xelf::unselect)
(trace xelf::toggle-selected)
(trace xelf::backtab)
(trace xelf::handle-event)
(trace xelf::do-show-buffer-properties-dialog)
(trace xelf::show-buffer-properties-dialog)
(trace xelf::close-menus)
(trace xelf::context-menu)
(trace xelf::restore-default-values)
(trace xelf::make-menu)
(trace xelf::make-tree)
(trace xelf::make-halo)
(trace xelf::make-method-menu-item)
(trace xelf::release)
(trace xelf::press)
(trace xelf::open-shell)
(trace xelf::focus-on)
(trace xelf::close-shell)
;; (trace xelf::evaluate)
;; (trace xelf::get-property-list)
;; (trace xelf::apply-properties)
;; (trace xelf::show-dialog)
;; (trace xelf::tab)
;; (trace xelf::find-tab-parent)
;; (trace xelf::find-tab-proxy)
;; (trace xelf::position-within-parent)
;; (trace xelf::show-dialog)
;; (trace xelf::tap)
;; (trace xelf::get-property-object-pairs)
;; (trace xelf::get-property-entries)
;; ;; (trace xelf::resize)
;; ;; (trace xelf::layout)
;; ;; (trace xelf::evaluate-here)
;; ;; (trace xelf::evaluate-expression)
;; ;; (trace xelf::evaluate-output)
;; ;; (trace xelf::layout)
;; (trace xelf::select)
;; (trace xelf::unselect)
;; (trace xelf::toggle-selected)
;; (trace xelf::backtab)
;; (trace xelf::handle-event)
;; (trace xelf::do-show-buffer-properties-dialog)
;; (trace xelf::show-buffer-properties-dialog)
;; (trace xelf::close-menus)
;; (trace xelf::context-menu)
;; (trace xelf::restore-default-values)
;; (trace xelf::make-menu)
;; (trace xelf::make-tree)
;; (trace xelf::make-halo)
;; (trace xelf::make-method-menu-item)
;; (trace xelf::release)
;; (trace xelf::press)
;; (trace xelf::open-shell)
;; (trace xelf::focus-on)
;; (trace xelf::close-shell)
;; (trace switch-to-buffer)
;; (trace all-buffer-names)
;; ;; (trace xelf::drag-candidate)
;; ;; (trace xelf::drag-maybe)
;; ;; (trace xelf::drag-fail)
;; ;; (trace xelf::hit-inputs)
;; ;; (trace xelf::draw-focus)
;; (trace xelf::destroy)
(trace switch-to-buffer)
(trace all-buffer-names)
;; (trace xelf::drag-candidate)
;; (trace xelf::drag-maybe)
;; (trace xelf::drag-fail)
;; (trace xelf::hit-inputs)
;; (trace xelf::draw-focus)
(trace xelf::destroy)
(test-gui)
......@@ -5428,6 +5428,7 @@ Returns a newly allocated list."
(let ((dupe (duplicate thing)))
(prog1 (find-object dupe)
(setf (slot-value dupe 'halo) nil)
(setf (slot-value dupe 'selected-p) nil)
(setf (uuid dupe) (make-uuid))
(register-uuid dupe)
(setf (quadtree-node dupe) nil))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment