Commit 4b0fb8a0 authored by David O'Toole's avatar David O'Toole

move code around

parent bc5ca79b
......@@ -529,10 +529,10 @@
nil)
;; Menubar class:1 ends here
;; Floating windows
;; Floating window frames
;; [[file:~/xelf/gui.org::*Floating%20windows][Floating windows:1]]
;; [[file:~/xelf/gui.org::*Floating%20window%20frames][Floating window frames:1]]
(define-handle frame-close-button :close
:slots ((target-frame :initform nil :initarg :target-frame :accessor target-frame)))
......@@ -594,7 +594,7 @@
;; (defmethod as-drag ((self menu) x y)
;; (make-menu-frame self))
;; Floating windows:1 ends here
;; Floating window frames:1 ends here
;; Context menus
......@@ -625,54 +625,3 @@
:locked t)
:target (find-uuid self)))))
;; Context menus:1 ends here
;; Command objects for undo/redo
;; [[file:~/xelf/gui.org::*Command%20objects%20for%20undo/redo][Command objects for undo/redo:1]]
(defclass command (node)
((action :initform nil :initarg :action :accessor action)
(target :initform nil :initarg :target :accessor target)
(data :initform nil :initarg :data :accessor data)
(undo-action :initform nil :initarg :undo-action :accessor undo-action)
(executed-p :initform nil :accessor executed-p)))
(defmethod execute ((command command))
(setf (undo-action command)
(make-undo-action command))
(apply (symbol-function (action command))
(cons (target command)
(data command)))
(setf (executed-p command) t))
(defmethod make-undo-action ((command command)) nil)
(defmethod unexecute ((command command)) nil)
(defmethod reversible-p ((command command)) nil)
(defmethod undo ((command command))
(funcall (undo-action command)))
(defclass move-command (command)
((action :initform #'move)))
(defmethod make-undo-action ((command move-command))
(let ((target (target command)))
(with-slots (x y) target
(let ((x0 x)
(y0 y))
#'(lambda ()
(move-to target x0 y0))))))
(defclass resize-command (command)
((action :initform #'resize)))
(defmethod make-undo-action ((command resize-command))
(let ((target (target command)))
(with-slots (height width) target
(let ((h0 height)
(w0 width))
#'(lambda ()
(resize target w0 h0))))))
;; Command objects for undo/redo:1 ends here
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
* Task list
** TODO clean up how node macro VSlots work
** TODO [#A] button class
** TODO [#A] checkbox
** TODO [#A] radio buttons
** TODO [#A] dropdown list
** TODO [#A] fix dialogs
** TODO [#A] fix data entry widget validation
** TODO [#A] create buffer switch menu
** TODO [#B] context-menus
** TODO [#A] fix disappearing shell prompt when click
** TODO [#A] fix disappearing shell prompt when clicking shell
** TODO [#B] fix can't drag item out of shell
** TODO [#B] command undo/redo
** TODO [#A] scrolling the buffer window
......
This diff is collapsed.
This diff is collapsed.
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