Skip to content
Permalink
Browse files

Scroll workbench

  • Loading branch information...
Shinmera committed Oct 3, 2019
1 parent c61c6f4 commit adb4de7dcd398006e98812b4b5ae1c714a5311a2
Showing with 14 additions and 42 deletions.
  1. +14 −42 alloy/workbench.lisp
@@ -15,49 +15,21 @@
(progn
(defmethod trial:setup-scene ((workbench workbench) scene)
(let* ((ui (trial:enter (make-instance 'dui :target-resolution (alloy:px-size 800 600)) scene))
(data (list NIL "" 50 NIL 100 :male))
(focus (alloy:focus-tree ui))
(layout (alloy:layout-tree ui))
(save (alloy:represent "Save" 'alloy:button :renderer ui))
(autosave (alloy:represent (first data) 'alloy:switch :renderer ui))
(title (alloy:represent (second data) 'alloy:input-line :renderer ui))
(progress (alloy:represent (third data) 'alloy:progress :renderer ui))
(option (alloy:place-data (fourth data)))
(option-a (alloy:represent-with 'alloy:radio option :active-value :on :renderer ui))
(option-b (alloy:represent-with 'alloy:radio option :active-value :off :renderer ui))
(volume (alloy:represent (fifth data) 'alloy:slider :renderer ui))
(voices (alloy:represent (sixth data) 'alloy::combo-set :renderer ui :value-set '(:none :male :female :skeleton))))
(let ((layout (make-instance 'alloy:vertical-linear-layout :layout-parent layout
:renderer ui
:cell-margins (alloy:margins 5)
:min-size (alloy:size 200 30))))
(alloy:enter save layout)
(alloy:enter progress layout)
(let* ((inner (make-instance 'alloy:grid-layout :layout-parent layout
:cell-margins (alloy:margins 5)
:col-sizes (list 200 T)
:row-sizes (list 40 40 40 40 40 40))))
(alloy:enter inner layout)
(alloy:enter "Autosave" inner :col 0 :row 0)
(alloy:enter autosave inner :col 1 :row 0)
(alloy:enter "Title" inner :col 0 :row 1)
(alloy:enter title inner :col 1 :row 1)
(alloy:enter "Feelings On" inner :col 0 :row 2)
(alloy:enter option-a inner :col 1 :row 2)
(alloy:enter "Feelings Off" inner :col 0 :row 3)
(alloy:enter option-b inner :col 1 :row 3)
(alloy:enter "Volume" inner :col 0 :row 4)
(alloy:enter volume inner :col 1 :row 4)
(alloy:enter "Voice" inner :col 0 :row 5)
(alloy:enter voices inner :col 1 :row 5)))
(let ((focus (make-instance 'alloy:focus-list :focus-parent focus)))
(alloy:enter autosave focus)
(alloy:enter title focus)
(alloy:enter option-a focus)
(alloy:enter option-b focus)
(alloy:enter volume focus)
(alloy:enter voices focus)
(alloy:enter save focus)))
(layout (alloy:layout-tree ui)))
(let* ((layout (make-instance 'alloy:border-layout :layout-parent layout
:renderer ui))
(c (make-instance 'alloy:clip-view :layout-parent layout))
(x (alloy:represent-with 'alloy:x-scrollbar c :renderer ui))
(y (alloy:represent-with 'alloy:y-scrollbar c :renderer ui))
(list (make-instance 'alloy:horizontal-linear-layout :layout-parent c :min-size (alloy:px-size 200 30))))
(alloy:enter y layout :place :east :size (alloy:un 20))
(alloy:enter x layout :place :south :size (alloy:un 20))
(dotimes (i 20)
(alloy:enter (princ-to-string i) list))
(let ((focus (make-instance 'alloy:focus-list :focus-parent focus)))
(alloy:enter y focus)
(alloy:enter x focus))))
(trial:enter (make-instance 'trial:2d-camera) scene)
(trial:enter (make-instance 'trial:render-pass) scene))

0 comments on commit adb4de7

Please sign in to comment.
You can’t perform that action at this time.