Debian Codegraph @

contrib/xview/demo/window.l

raw
1 ;; program window.l
2 ;;;;; program window.l
3 ;;; -----------------------
4 ;;; | Tty |
5 ;;; -----------------------
6 ;;; | Textsw |
7 ;;; -----------------------
8 ;;;
9 ;;; Panel item
10 ;;; ---------------
11 ;;; | Button |
12 ;;; | Text |
13 ;;; | Choice |
14 ;;; | Cycle |
15 ;;; | Toggle |
16 ;;; | Slider |
17 ;;; | Message |
18 ;;; ---------------
19 ;;;
20 (defclass example
21 :super sunview-frame
22 :slots (panel canvas textsw tty start
23 button text choice cycle toggle slider message))
24
25 (defmethod example
26 (:print-value (value &optional item event)
27 (format t "~s's value=~s~%" item value))
28 (:clear-canvas (&optional item event)
29 (send canvas :clear))
30 (:draw-canvas (&optional item event)
31 (send canvas :drawline 0 0 100 100)
32 )
33 (:set-start (window movement button pos time)
34 (setq start pos))
35 (:draw-line
36 (window movement button pos time)
37 (format t "draw-line ~a ~a~%" start pos)
38 (send canvas :drawline
39 (vector-x start) (vector-y start)
40 (vector-x pos) (vector-y pos)))
41 (:init ()
42 (send-super :init nil :title "Window example on eusview" :x 300 :y 0
43 :font "lucidasans-bold-12"
44 :icon "/usr/include/X11/Xview/images/hello_world.icon")
45 (setq panel (send self :create-subwindow sunview-panel))
46 (setq button (send panel :create-button :clear-canvas
47 :title "Clear canvas button"))
48 (setq button (send panel :create-button :draw-canvas
49 :title "Draw line button"))
50 (setq text (send panel :create-text :print-value
51 :title "Text item:" :value "window.l"))
52 (setq choice (send panel :create-choice :print-value
53 :choices '(a b c) :title "Choice item:"))
54 (setq cycle (send panel :create-cycle :print-value
55 :title "Cycle item:" :choices '(a b c)))
56 (setq toggle (send panel :create-toggle :print-value
57 :title "Toggle item:" :choices '("=" "+" "-")))
58 (setq slider (send panel :create-slider :print-value
59 :title "Slider item:" :min 0.2 :max 120.5
60 :value 10 :length 60))
61 (setq message (send panel :create-message :title " <<Message item>> "))
62 (setq canvas (send self :create-subwindow sunview-canvas
63 :y 0 :width 300 :right-of panel
64 :drag-started-proc :set-start
65 :dragging-proc :draw-line))
66 (send canvas :height (send panel :height))
67 (setq tty (send self :create-subwindow sunview-tty
68 :below panel :x 0 :height 300))
69 (send canvas :width (- (send tty :width) (send canvas :x)))
70 (send canvas :drawtext "This is a canvas." 10 20)
71 (send tty :input "ls -l window.l ")
72 (setq textsw (send self :create-subwindow sunview-textsw
73 :below tty :x 0 :height 380))
74 (send textsw :load "window.l" 0)
75 (send textsw :insert ";; program window.l
76 ")
77 (send self :show)
78 self)
79 )
80
81 (defun ex nil (setq *ex* (instance example :init)))
82
83 (format t "type (ex)~%")
84