Commit cfbe3075 authored by David O'Toole's avatar David O'Toole

project properties dialog working

parent 965ea446
......@@ -474,7 +474,7 @@
(at-next-update
(let ((buffer (make-instance 'buffer :buffer-name buffer-name)))
(switch-to-buffer buffer-name)
(paste (current-buffer))
(paste (current-buffer) offset-x offset-y)
(trim-conservatively (current-buffer)))))
(define-properties-dialog buffer-properties
......@@ -487,6 +487,22 @@
(with-slots (height width buffer-name) buffer
(resize buffer width height)
(rename-buffer buffer buffer-name))))
(define-properties-dialog project-properties
(path width height scale-output-to-window frame-rate resizable author author-contact title license))
(defmethod apply-properties :after ((dialog project-properties-dialog) &optional project)
(with-slots (name path resizable scale-output-to-window frame-rate title author author-contact
width height license) project
(setf *scale-output-to-window* scale-output-to-window)
(set-frame-rate frame-rate)
(setf *title* title)
(setf *author* author)
(setf *author-contact* author)
(setf *width* width)
(setf *height* height)
(setf *resizable* resizable))
(notify (format nil "Applied project properties to ~S." project)))
;; User dialogs:1 ends here
;; Menu bar structure
......@@ -499,7 +515,7 @@
(;; (:label "Create a new project" :action create-project)
;; (:label "Open an existing project" :action open-existing-project)
(:label "Save current changes" :action save-changes)
(:label "Edit project properties" :action show-edit-project-properties-dialog)
(:label "Edit project properties" :action do-show-project-properties-dialog)
(:label "Show current changes" :action show-changes)
(:label "Show classes" :action show-classes-dialog)
(:label "Export as archive" :action show-export-archive-dialog)
......@@ -508,6 +524,9 @@
(:label "Edit preferences" :action edit-preferences)
(:label "Exit" :action show-exit-dialog))))
(defun do-show-project-properties-dialog ()
(show-project-properties-dialog (current-project)))
(defparameter *edit-menu*
'(:label "Edit"
:inputs
......@@ -538,10 +557,12 @@
(:label "Edit buffer properties" :action do-show-buffer-properties-dialog)
;; (:label "Rename buffer" :action show-rename-buffer-dialog)
;; (:label "Resize buffer" :action show-resize-buffer-dialog)
(:label "Trim empty space" :action do-trim)
(:label "Trim empty space on right/bottom" :action do-trim-conservatively)
(:label "Save buffer in project" :action show-save-buffer-in-project-dialog)
(:label "Copy buffer" :action show-copy-buffer-dialog)
(:label "Destroy buffer" :action show-destroy-buffer-dialog)
(:label "Export buffer to file" :action show-save-buffer-in-new-file-dialog)
(:label "Save buffer in new file" :action show-save-buffer-in-new-file-dialog)
(:label "Revert buffer" :action show-revert-buffer-dialog)
(:label "Resize to background image" :action resize-to-background-image)
(:label "Make snapshot" :action show-take-snapshot-dialog)
......@@ -555,7 +576,7 @@
'(:label "View"
:inputs
((:label "Move viewport to location" :action show-move-viewport-dialog)
(:label "Edit scrolling properties" :action show-scrolling-properties-dialog)
;;(:label "Edit scrolling properties" :action show-scrolling-properties-dialog)
(:label "Adjust zoom level" :action show-zoom-level-dialog)
(:label "Reset zoom level" :action reset-zoom-level))))
......
......@@ -825,6 +825,7 @@
(remhash (the simple-string thing) objects))
(mapc #'destroy-maybe (slot-value self 'tasks))
(setf (slot-value self 'quadtree) nil)
(unregister-buffer self)
(call-next-method self)))
;; Destroying buffers:1 ends here
......@@ -3561,6 +3562,10 @@ See sidebar for more commands to try.
(auto-fit :initform t)
(visible :initform t)))
(defmethod get-first-line ((self text))
(or (first (slot-value self 'buffer))
"Notification text not found."))
(defmethod can-pick ((self text)) t)
(defmethod pick ((self text)) (or (slot-value self 'parent) self))
......
......@@ -854,8 +854,8 @@ This section is obsolete and will be removed in the future.
(remhash (the simple-string thing) objects))
(mapc #'destroy-maybe (slot-value self 'tasks))
(setf (slot-value self 'quadtree) nil)
(unregister-buffer self)
(call-next-method self)))
#+end_src
** Combining buffers
......@@ -3573,6 +3573,10 @@ supported compiler.
(auto-fit :initform t)
(visible :initform t)))
(defmethod get-first-line ((self text))
(or (first (slot-value self 'buffer))
"Notification text not found."))
(defmethod can-pick ((self text)) t)
(defmethod pick ((self text)) (or (slot-value self 'parent) self))
......@@ -4385,6 +4389,11 @@ supported compiler.
(defun show-status (string)
(setf *modeline-status-string* (concatenate 'string " " (clean-string string))))
(defun modeline-status-string ()
(if *notification*
(get-first-line *notification*)
*modeline-status-string*))
(defun-memo modeline-position-string (x y)
(:key #'identity :test 'equal :validator #'identity)
(format nil "X:~S Y:~S" x y))
......@@ -4424,7 +4433,7 @@ supported compiler.
"(playing)")
"(empty)"))
(set-value status
(or *modeline-status-string* " "))))
(or (modeline-status-string) " "))))
(defmethod draw ((self modeline))
(with-slots (x y width height) self
......@@ -5031,7 +5040,7 @@ supported compiler.
(at-next-update
(let ((buffer (make-instance 'buffer :buffer-name buffer-name)))
(switch-to-buffer buffer-name)
(paste (current-buffer))
(paste (current-buffer) offset-x offset-y)
(trim-conservatively (current-buffer)))))
(define-properties-dialog buffer-properties
......@@ -5044,6 +5053,22 @@ supported compiler.
(with-slots (height width buffer-name) buffer
(resize buffer width height)
(rename-buffer buffer buffer-name))))
(define-properties-dialog project-properties
(path width height scale-output-to-window frame-rate resizable author author-contact title license))
(defmethod apply-properties :after ((dialog project-properties-dialog) &optional project)
(with-slots (name path resizable scale-output-to-window frame-rate title author author-contact
width height license) project
(setf *scale-output-to-window* scale-output-to-window)
(set-frame-rate frame-rate)
(setf *title* title)
(setf *author* author)
(setf *author-contact* author)
(setf *screen-width* width)
(setf *screen-height* height)
(setf *resizable* resizable))
(notify (format nil "Applied project properties to ~S." project)))
#+end_src
** Menu bar structure
......@@ -5055,7 +5080,7 @@ supported compiler.
(;; (:label "Create a new project" :action create-project)
;; (:label "Open an existing project" :action open-existing-project)
(:label "Save current changes" :action save-changes)
(:label "Edit project properties" :action show-edit-project-properties-dialog)
(:label "Edit project properties" :action do-show-project-properties-dialog)
(:label "Show current changes" :action show-changes)
(:label "Show classes" :action show-classes-dialog)
(:label "Export as archive" :action show-export-archive-dialog)
......@@ -5064,6 +5089,9 @@ supported compiler.
(:label "Edit preferences" :action edit-preferences)
(:label "Exit" :action show-exit-dialog))))
(defun do-show-project-properties-dialog ()
(show-project-properties-dialog (current-project)))
(defparameter *edit-menu*
'(:label "Edit"
:inputs
......@@ -5094,10 +5122,12 @@ supported compiler.
(:label "Edit buffer properties" :action do-show-buffer-properties-dialog)
;; (:label "Rename buffer" :action show-rename-buffer-dialog)
;; (:label "Resize buffer" :action show-resize-buffer-dialog)
(:label "Trim empty space" :action do-trim)
(:label "Trim empty space on right/bottom" :action do-trim-conservatively)
(:label "Save buffer in project" :action show-save-buffer-in-project-dialog)
(:label "Copy buffer" :action show-copy-buffer-dialog)
(:label "Destroy buffer" :action show-destroy-buffer-dialog)
(:label "Export buffer to file" :action show-save-buffer-in-new-file-dialog)
(:label "Save buffer in new file" :action show-save-buffer-in-new-file-dialog)
(:label "Revert buffer" :action show-revert-buffer-dialog)
(:label "Resize to background image" :action resize-to-background-image)
(:label "Make snapshot" :action show-take-snapshot-dialog)
......@@ -5111,7 +5141,7 @@ supported compiler.
'(:label "View"
:inputs
((:label "Move viewport to location" :action show-move-viewport-dialog)
(:label "Edit scrolling properties" :action show-scrolling-properties-dialog)
;;(:label "Edit scrolling properties" :action show-scrolling-properties-dialog)
(:label "Adjust zoom level" :action show-zoom-level-dialog)
(:label "Reset zoom level" :action reset-zoom-level))))
......
......@@ -70,6 +70,11 @@
(defun show-status (string)
(setf *modeline-status-string* (concatenate 'string " " (clean-string string))))
(defun modeline-status-string ()
(if *notification*
(get-first-line *notification*)
*modeline-status-string*))
(defun-memo modeline-position-string (x y)
(:key #'identity :test 'equal :validator #'identity)
(format nil "X:~S Y:~S" x y))
......@@ -109,7 +114,7 @@
"(playing)")
"(empty)"))
(set-value status
(or *modeline-status-string* " "))))
(or (modeline-status-string) " "))))
(defmethod draw ((self modeline))
(with-slots (x y width height) self
......
* Task list
** TODO fix dialog boxes
*** TODO [#B] fix *untitled-buffer* not being added to list
*** DONE [#B] fix *untitled-buffer* not being added to list
CLOSED: [2017-04-22 Sat 07:54]
*** TODO [#A] context-menu with reset-to-current-values
**** TODO pin down context menu elements
**** TODO fix broken layout/rendering of context menu
*** TODO [#A] project properties: height width scale-output- resizable author title license frame-rate
*** TODO [#B] close after eval if frame
*** TODO [#C] project properties: height width scale-output- resizable author title license frame-rate
*** TODO [#B] close after eval for some frames
*** TODO [#B] add more notifications for cut/copy etc
*** TODO [#B] show error bubble and restore value when input incorrect
*** TODO [#B] fix menu clicks sometimes not working
**** TODO TAP MENUBAR should forward click to menu
*** TODO [#C] fix halos not always being in front
**** TODO Show yellow notification string on modeline
*** TODO [#A] show error bubble and restore value when input incorrect
*** TODO [#A] fix halos not always being in front
*** TODO [#C] don't allow halo on properties dialog
*** TODO [#C] ENTER should update value in property field
*** TODO [#C] fix menubar not drawing over dialogs
*** TODO [#C] add nice Apply/Cancel buttons
** TODO make master system menu todo list
*** TODO save-changes
*** TODO show-edit-project-properties-dialog
*** TODO show-changes
*** TODO show-classes-dialog
*** TODO show-export-archive-dialog
*** TODO show-export-application-dialog
*** TODO show-publish-ftp-dialog
*** TODO edit-preferences
*** TODO show-exit-dialog
*** TODO edit-cut
*** TODO edit-copy
*** TODO edit-paste
*** TODO show-paste-as-new-buffer-dialog
*** TODO show-paste-from-dialog
*** TODO show-paste-selection-from-dialog
*** TODO edit-select-all
*** TODO edit-clear-selection
*** TODO edit-invert-selection
*** TODO show-node-properties-dialog
*** TODO show-shell-history-dialog
*** TODO transport-play
*** TODO transport-pause
*** TODO show-create-buffer-dialog
*** TODO show-load-buffer-from-file-dialog
*** TODO show-switch-to-buffer-dialog
*** TODO show-buffer-properties-dialog
*** TODO show-rename-buffer-dialog
*** TODO show-resize-buffer-dialog
*** TODO show-save-buffer-in-project-dialog
*** TODO show-copy-buffer-dialog
*** TODO show-destroy-buffer-dialog
*** TODO show-save-buffer-in-new-file-dialog
*** TODO show-revert-buffer-dialog
*** TODO resize-to-background-image
*** TODO show-take-snapshot-dialog
*** TODO view-clipboard
*** TODO view-buffer-list
*** TODO show-move-viewport-dialog
*** TODO show-scrolling-properties-dialog
*** TODO show-zoom-level-dialog
*** TODO reset-zoom-level
*** TODO show-import-resource-dialog
*** TODO show-resource-properties-dialog
*** TODO edit-resource-externally
*** TODO show-search-resources-dialog
*** TODO show-export-resources-dialog
*** TODO browse-resources
*** TODO show-create-sprite-sheet-dialog
*** TODO show-edit-sprite-sheet-dialog
*** TODO show-edit-fonts-dialog
*** TODO show-preload-resources-dialog
*** TODO show-clear-cached-resources-dialog
*** TODO switch-to-desktop
*** TODO auto-arrange-icons
*** TODO toggle-snap-to-grid
*** TODO previous-desktop
*** TODO create-desktop
*** TODO rename-desktop
*** TODO delete-desktop
*** TODO show-desktop-properties-dialog
*** TODO switch-to-emacs
*** TODO show-edit-lisp-dialog
*** TODO show-inspect-object-dialog
*** TODO show-version-control-dialog
*** TODO browse-devices
*** TODO scan-for-devices
*** TODO configure-joystick
*** TODO configure-keyboard
*** TODO show-copyright-notice
*** TODO show-documentation
*** TODO show-help
*** TODO show-examples
*** TODO show-reference
** TODO [#A] create buffer switch menu
** TODO implement all main system menu dialogs
*** TODO [#A] save-changes
*** TODO [#A] show-project-properties-dialog
*** TODO [#A] show-exit-dialog
*** TODO [#A] edit-cut
*** TODO [#A] edit-copy
*** TODO [#A] edit-paste
*** TODO [#A] show-paste-as-new-buffer-dialog
*** TODO [#A] edit-select-all
*** TODO [#A] edit-clear-selection
*** TODO [#A] transport-play
*** TODO [#A] transport-pause
*** TODO [#A] show-create-buffer-dialog
*** TODO [#A] show-buffer-properties-dialog
*** TODO [#A] show-save-buffer-in-project-dialog
*** TODO [#A] view-clipboard
*** TODO [#A] view-buffer-list
*** TODO [#A] show-copyright-notice
*** TODO [#A] show-help
*** TODO [#B] show-classes-dialog
*** TODO [#B] show-paste-from-dialog
*** TODO [#B] show-paste-selection-from-dialog
*** TODO [#B] edit-invert-selection
*** TODO [#B] show-node-properties-dialog
*** TODO [#B] show-load-buffer-from-file-dialog
*** TODO [#B] show-switch-to-buffer-dialog
*** TODO [#B] do-trim
*** TODO [#B] do-trim-conservatively
*** TODO [#B] show-copy-buffer-dialog
*** TODO [#B] show-destroy-buffer-dialog
*** TODO [#B] show-move-viewport-dialog
*** TODO [#B] show-import-resource-dialog
*** TODO [#B] show-resource-properties-dialog
*** TODO [#B] show-documentation
*** TODO [#C] show-changes
*** TODO [#C] show-export-archive-dialog
*** TODO [#C] show-export-application-dialog
*** TODO [#C] show-publish-ftp-dialog
*** TODO [#C] edit-preferences
*** TODO [#C] show-shell-history-dialog
*** TODO [#C] show-save-buffer-in-new-file-dialog
*** TODO [#C] show-revert-buffer-dialog
*** TODO [#C] resize-to-background-image
*** TODO [#C] show-take-snapshot-dialog
*** TODO [#C] show-zoom-level-dialog
*** TODO [#C] reset-zoom-level
*** TODO [#C] edit-resource-externally
*** TODO [#C] show-search-resources-dialog
*** TODO [#C] show-export-resources-dialog
*** TODO [#C] browse-resources
*** TODO [#C] show-create-sprite-sheet-dialog
*** TODO [#C] show-edit-sprite-sheet-dialog
*** TODO [#C] show-edit-fonts-dialog
*** TODO [#C] show-preload-resources-dialog
*** TODO [#C] show-clear-cached-resources-dialog
*** TODO [#C] switch-to-desktop
*** TODO [#C] auto-arrange-icons
*** TODO [#C] toggle-snap-to-grid
*** TODO [#C] previous-desktop
*** TODO [#C] create-desktop
*** TODO [#C] rename-desktop
*** TODO [#C] delete-desktop
*** TODO [#C] show-desktop-properties-dialog
*** TODO [#C] switch-to-emacs
*** TODO [#C] show-edit-lisp-dialog
*** TODO [#C] show-inspect-object-dialog
*** TODO [#C] show-version-control-dialog
*** TODO [#C] browse-devices
*** TODO [#C] scan-for-devices
*** TODO [#C] configure-joystick
*** TODO [#C] configure-keyboard
*** TODO [#C] show-examples
*** TODO [#C] show-reference
** TODO Design user experience
*** TODO launching external programs to edit assets. gimp, audacity, switch-to-emacs,. etc
*** TODO folders are virtual views, they don't nest
** TODO [#A] create buffer switch menu
** TODO [#A] fix data entry widget validation
** TODO [#A] button class
** TODO [#A] checkbox
......@@ -804,3 +803,13 @@
:ARCHIVE_CATEGORY: tasks
:ARCHIVE_TODO: DONE
:END:
** TODO [#B] fix menu clicks sometimes not working
:PROPERTIES:
:ARCHIVE_TIME: 2017-04-22 Sat 08:25
:ARCHIVE_FILE: ~/xelf/tasks.org
:ARCHIVE_OLPATH: Task list/fix dialog boxes
:ARCHIVE_CATEGORY: tasks
:ARCHIVE_TODO: TODO
:END:
*** TODO TAP MENUBAR should forward click to menu
......@@ -30,7 +30,6 @@
(bind-event (current-buffer) '(:f9) 'xelf::toggle-other-windows)
(start-game plong)))))
(trace xelf::evaluate)
(trace xelf::get-property-list)
(trace xelf::apply-properties)
......
......@@ -280,6 +280,7 @@ more information.
`(let ((*use-notifications* t)) ,@body))
(defvar *menubar* nil)
(defun menubar () *menubar*)
(defvar *title* nil)
;; Miscellaneous variables:1 ends here
;; User initialization file
......@@ -3156,6 +3157,8 @@ Returns a newly allocated list."
(setf *project-object* object))
(defun current-project ()
(when (null *project-object*)
(setf *project-object* (make-instance 'project)))
*project-object*)
(defvar *recent-projects* nil)
......@@ -6183,8 +6186,17 @@ Returns a newly allocated list."
;; [[file:~/xelf/xelf.org::*Project%20object][Project object:1]]
(defclass project (node)
((name :initform nil :initarg :name :accessor name)
(path :initform nil :initarg :path :accessor path)
((name :initform *project* :initarg :name :accessor name)
(path :initform *project-path* :initarg :path :accessor path)
(scale-output-to-window :initform *scale-output-to-window*)
(frame-rate :initform *frame-rate*)
(title :initform *project*)
(resizable :initform *resizable*)
(author :initform *author*)
(author-contact :initform *author-contact*)
(license :initform "Short license name here.")
(width :initform *screen-width*)
(height :initform *screen-height*)
(open-p :initform nil :accessor open-p)
(modified-p :initform nil :accessor modified-p)
(properties :initform nil :initarg :properties :accessor properties)))
......
......@@ -358,6 +358,7 @@ These need to be filed in their proper places.
`(let ((*use-notifications* t)) ,@body))
(defvar *menubar* nil)
(defun menubar () *menubar*)
(defvar *title* nil)
#+end_src
* User initialization file
......@@ -3176,6 +3177,8 @@ increases.
(setf *project-object* object))
(defun current-project ()
(when (null *project-object*)
(setf *project-object* (make-instance 'project)))
*project-object*)
(defvar *recent-projects* nil)
......@@ -6164,8 +6167,17 @@ Please see the [[file:gui.html][GUI page]] for code and documentation.
#+begin_src lisp
(defclass project (node)
((name :initform nil :initarg :name :accessor name)
(path :initform nil :initarg :path :accessor path)
((name :initform *project* :initarg :name :accessor name)
(path :initform *project-path* :initarg :path :accessor path)
(scale-output-to-window :initform *scale-output-to-window*)
(frame-rate :initform *frame-rate*)
(title :initform *project*)
(resizable :initform *resizable*)
(author :initform *author*)
(author-contact :initform *author-contact*)
(license :initform "Short license name here.")
(width :initform *screen-width*)
(height :initform *screen-height*)
(open-p :initform nil :accessor open-p)
(modified-p :initform nil :accessor modified-p)
(properties :initform nil :initarg :properties :accessor properties)))
......
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