comparison tests/glyph-test.el @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 95016f13131a
children
comparison
equal deleted inserted replaced
423:28d9c139be4c 424:11054d720c21
1 (setq str "Hello There")
2 (set-extent-begin-glyph 1 (set-extent-begin-glyph
3 (make-extent 0 0 str) 2 (make-extent (point) (point))
4 (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])) 3 (setq im (make-glyph [xpm :file "xemacs-icon.xpm"])))
5 4
6 (defun foo () 5 (defun foo ()
7 (interactive) 6 (interactive)
8 (ding)) 7 (setq ok-select (not ok-select)))
9 ; (setq ok-select (not ok-select))) 8
9 (defun fee () (interactive) (message "hello"))
10 10
11 ;; button in a group 11 ;; button in a group
12 (setq ok-select nil) 12 (setq ok-select nil)
13 (set-extent-begin-glyph 13 (set-extent-begin-glyph
14 (make-extent (point) (point)) 14 (make-extent (point) (point))
15 (make-glyph [button :descriptor ["ok " (setq ok-select t) 15 (setq radio-button1
16 :style radio :selected ok-select]])) 16 (make-glyph
17 [button :descriptor ["ok " (setq ok-select t)
18 :style radio :selected ok-select]])))
17 ;; button in a group 19 ;; button in a group
18 (set-extent-begin-glyph 20 (set-extent-begin-glyph
19 (make-extent (point) (point)) 21 (make-extent (point) (point))
20 (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio 22 (setq radio-button2
21 :selected (not ok-select)]])) 23 (make-glyph
24 [button :descriptor ["ok" (setq ok-select nil) :style radio
25 :selected (not ok-select)]])))
22 ;; toggle button 26 ;; toggle button
23 (set-extent-begin-glyph 27 (set-extent-begin-glyph
24 (make-extent (point) (point)) 28 (make-extent (point) (point))
25 (setq tbutton 29 (setq tbutton
26 (make-glyph [button :descriptor ["ok" (setq ok-select nil) 30 (make-glyph [button :descriptor ["ok" (setq ok-select nil)
27 :style toggle 31 :style toggle
28 :selected (not ok-select)]]))) 32 :selected (not ok-select)]])))
29 (set-extent-begin-glyph 33 (set-extent-begin-glyph
30 (make-extent (point) (point)) 34 (make-extent (point) (point))
31 (make-glyph [button :descriptor ["ok" :style toggle 35 (setq toggle-button
32 :callback 36 (make-glyph [button :descriptor ["ok" :style toggle
33 (setq ok-select (not ok-select)) 37 :callback
34 :selected ok-select]])) 38 (setq ok-select (not ok-select))
39 :selected ok-select]])))
35 40
36 ;; normal pushbutton 41 ;; normal pushbutton
37 (set-extent-begin-glyph 42 (set-extent-begin-glyph
38 (make-extent (point) (point)) 43 (make-extent (point) (point))
39 (setq pbutton (make-glyph 44 (setq push-button
40 [button :width 10 :height 2 45 (make-glyph [button :width 10 :height 2
41 :face modeline-mousable 46 :face modeline-mousable
42 :descriptor "ok" :callback foo 47 :descriptor "ok" :callback foo
43 :selected t]))) 48 :selected t])))
44 ;; tree view 49 ;; tree view
45 (set-extent-begin-glyph 50 (set-extent-begin-glyph
46 (make-extent (point) (point)) 51 (make-extent (point) (point))
47 (setq tree (make-glyph 52 (setq tree (make-glyph
48 [tree-view :width 10 53 [tree-view :width 10
56 ;; tab control 61 ;; tab control
57 (set-extent-begin-glyph 62 (set-extent-begin-glyph
58 (make-extent (point) (point)) 63 (make-extent (point) (point))
59 (setq tab (make-glyph 64 (setq tab (make-glyph
60 [tab-control :descriptor "My Tab" 65 [tab-control :descriptor "My Tab"
61 :face default 66 :face highlight
62 :properties (:items (["One" foo] 67 :properties (:items (["One" foo]
63 ["Two" foo] 68 ["Two" fee]
64 ["Three" foo]))]))) 69 ["Three" foo]))])))
65 70
66 ;; progress gauge 71 ;; progress gauge
67 (set-extent-begin-glyph 72 (set-extent-begin-glyph
68 (make-extent (point) (point)) 73 (make-extent (point) (point))
92 (set-extent-begin-glyph 97 (set-extent-begin-glyph
93 (make-extent (point) (point)) 98 (make-extent (point) (point))
94 (make-glyph 99 (make-glyph
95 [button :face modeline-mousable 100 [button :face modeline-mousable
96 :descriptor "ok" :callback foo 101 :descriptor "ok" :callback foo
97 :image (make-glyph 102 :image [xpm :file "../etc/xemacs-icon.xpm"]]))
98 [xpm :file "../etc/xemacs-icon.xpm"])]))
99 103
100 ;; normal pushbutton 104 ;; normal pushbutton
101 (set-extent-begin-glyph 105 (set-extent-begin-glyph
102 (make-extent (point) (point)) 106 (make-extent (point) (point))
103 (make-glyph [button :descriptor ["A Big Button" foo ]])) 107 (make-glyph [button :descriptor ["A Big Button" foo ]]))
104 108
105 ;; edit box 109 ;; edit box
106 (set-extent-begin-glyph 110 (set-extent-begin-glyph
107 (make-extent (point) (point)) 111 (make-extent (point) (point))
108 (setq hedit (make-glyph [edit-field :pixel-width 50 :pixel-height 30 112 (setq edit-field (make-glyph [edit-field :pixel-width 50 :pixel-height 30
109 :face bold-italic 113 :face bold-italic
110 :descriptor ["Hello"]]))) 114 :descriptor ["Hello"]])))
111 ;; combo box 115 ;; combo box
112 (set-extent-begin-glyph 116 (set-extent-begin-glyph
113 (make-extent (point) (point)) 117 (make-extent (point) (point))
114 (setq hcombo (make-glyph 118 (setq combo-box (make-glyph
115 [combo-box :width 10 :height 3 :descriptor ["Hello"] 119 [combo-box :width 10 :descriptor ["Hello"]
116 :properties (:items ("One" "Two" "Three"))]))) 120 :properties (:items ("One" "Two" "Three"))])))
117 121
118 ;; line 122 ;; label
119 (set-extent-begin-glyph 123 (set-extent-begin-glyph
120 (make-extent (point) (point)) 124 (make-extent (point) (point))
121 (make-glyph [label :pixel-width 150 :descriptor "Hello"])) 125 (setq label (make-glyph [label :pixel-width 150 :descriptor "Hello"])))
126
127 ;; string
128 (set-extent-begin-glyph
129 (make-extent (point) (point))
130 (setq str (make-glyph [string :data "Hello There"])))
122 131
123 ;; scrollbar 132 ;; scrollbar
124 ;(set-extent-begin-glyph 133 ;(set-extent-begin-glyph
125 ; (make-extent (point) (point)) 134 ; (make-extent (point) (point))
126 ; (make-glyph [scrollbar :width 50 :height 20 :descriptor ["Hello"]])) 135 ; (make-glyph [scrollbar :width 50 :height 20 :descriptor ["Hello"]]))
127 136
128 ;; generic subwindow 137 ;; generic subwindow
129 (setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 70])) 138 (setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 70]))
130 (set-extent-begin-glyph (make-extent (point) (point)) sw) 139 (set-extent-begin-glyph (make-extent (point) (point)) sw)
131 140
141 ;; layout
142 (setq layout
143 (make-glyph
144 [layout :pixel-width 200 :pixel-height 250
145 :orientation vertical
146 :justify left
147 :border [string :data "Hello There Mrs"]
148 :items ([layout :orientation horizontal
149 :items (radio-button1 radio-button2)]
150 edit-field toggle-button label str)]))
151 (set-glyph-face layout 'gui-element)
152 (set-extent-begin-glyph
153 (make-extent (point) (point)) layout)
154