Mercurial > hg > xemacs-beta
comparison tests/glyph-test.el @ 420:41dbb7a9d5f2 r21-2-18
Import from CVS: tag r21-2-18
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:24:09 +0200 |
parents | e804706bfb8c |
children | 95016f13131a |
comparison
equal
deleted
inserted
replaced
419:66615b78f1a5 | 420:41dbb7a9d5f2 |
---|---|
15 ;; button in a group | 15 ;; button in a group |
16 (set-extent-begin-glyph | 16 (set-extent-begin-glyph |
17 (make-extent (point) (point)) | 17 (make-extent (point) (point)) |
18 (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio | 18 (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio |
19 :selected (not ok-select)]])) | 19 :selected (not ok-select)]])) |
20 ;; toggle button | |
21 (set-extent-begin-glyph | |
22 (make-extent (point) (point)) | |
23 (setq tbutton | |
24 (make-glyph [button :descriptor ["ok" (setq ok-select nil) | |
25 :style toggle | |
26 :selected (not ok-select)]]))) | |
27 (set-extent-begin-glyph | |
28 (make-extent (point) (point)) | |
29 (make-glyph [button :descriptor ["ok" :style toggle | |
30 :callback | |
31 (setq ok-select (not ok-select)) | |
32 :selected ok-select]])) | |
33 | |
20 ;; normal pushbutton | 34 ;; normal pushbutton |
21 (set-extent-begin-glyph | 35 (set-extent-begin-glyph |
22 (make-extent (point) (point)) | 36 (make-extent (point) (point)) |
23 (setq pbutton (make-glyph | 37 (setq pbutton (make-glyph |
24 [button :width 10 :height 2 | 38 [button :width 10 :height 2 |
25 :face modeline-mousable | 39 :face modeline-mousable |
26 :descriptor "ok" :callback foo | 40 :descriptor "ok" :callback foo |
27 :selected t]))) | 41 :selected t]))) |
28 | |
29 ;; tree view | 42 ;; tree view |
30 (set-extent-begin-glyph | 43 (set-extent-begin-glyph |
31 (make-extent (point) (point)) | 44 (make-extent (point) (point)) |
32 (setq tree (make-glyph | 45 (setq tree (make-glyph |
33 [tree :width 10 | 46 [tree-view :width 10 |
34 :descriptor "My Tree" | 47 :descriptor "My Tree" |
35 :properties (:items (["One" foo] | 48 :properties (:items (["One" foo] |
36 (["Two" foo] | 49 (["Two" foo] |
37 ["Four" foo] | 50 ["Four" foo] |
38 "Six") | 51 "Six") |
39 "Three"))]))) | 52 "Three"))]))) |
40 | 53 |
41 ;; tab control | 54 ;; tab control |
42 (set-extent-begin-glyph | 55 (set-extent-begin-glyph |
43 (make-extent (point) (point)) | 56 (make-extent (point) (point)) |
44 (setq tab (make-glyph | 57 (setq tab (make-glyph |
45 [tab :descriptor "My Tab" | 58 [tab-control :descriptor "My Tab" |
46 :face default | 59 :face default |
47 :properties (:items (["One" foo] | 60 :properties (:items (["One" foo] |
48 ["Two" foo] | 61 ["Two" foo] |
49 ["Three" foo]))]))) | 62 ["Three" foo]))]))) |
50 | 63 |
51 ;; progress gauge | 64 ;; progress gauge |
52 (set-extent-begin-glyph | 65 (set-extent-begin-glyph |
53 (make-extent (point) (point)) | 66 (make-extent (point) (point)) |
54 (setq pgauge (make-glyph | 67 (setq pgauge (make-glyph |
55 [progress :width 10 :height 2 | 68 [progress-gauge :width 10 :height 2 |
56 :descriptor "ok"]))) | 69 :descriptor "ok"]))) |
57 ;; progress the progress ... | 70 ;; progress the progress ... |
58 (let ((x 0)) | 71 (let ((x 0)) |
59 (while (<= x 100) | 72 (while (<= x 100) |
60 (set-image-instance-property (glyph-image-instance pgauge) :percent x) | 73 (set-image-instance-property (glyph-image-instance pgauge) :percent x) |
61 (setq x (+ x 5)) | 74 (setq x (+ x 5)) |
63 | 76 |
64 ;; progress gauge in the modeline | 77 ;; progress gauge in the modeline |
65 (setq global-mode-string | 78 (setq global-mode-string |
66 (cons (make-extent nil nil) | 79 (cons (make-extent nil nil) |
67 (setq pg (make-glyph | 80 (setq pg (make-glyph |
68 [progress :width 5 :pixel-height 16 | 81 [progress-gauge :width 5 :pixel-height 16 |
69 :descriptor "ok"])))) | 82 :descriptor "ok"])))) |
70 ;; progress the progress ... | 83 ;; progress the progress ... |
71 (let ((x 0)) | 84 (let ((x 0)) |
72 (while (<= x 100) | 85 (while (<= x 100) |
73 (set-image-instance-property (glyph-image-instance pg) :percent x) | 86 (set-image-instance-property (glyph-image-instance pg) :percent x) |
74 (setq x (+ x 5)) | 87 (setq x (+ x 5)) |
88 (make-glyph [button :descriptor ["A Big Button" foo ]])) | 101 (make-glyph [button :descriptor ["A Big Button" foo ]])) |
89 | 102 |
90 ;; edit box | 103 ;; edit box |
91 (set-extent-begin-glyph | 104 (set-extent-begin-glyph |
92 (make-extent (point) (point)) | 105 (make-extent (point) (point)) |
93 (setq hedit (make-glyph [edit :pixel-width 50 :pixel-height 30 | 106 (setq hedit (make-glyph [edit-field :pixel-width 50 :pixel-height 30 |
94 :face bold-italic | 107 :face bold-italic |
95 :descriptor ["Hello"]]))) | 108 :descriptor ["Hello"]]))) |
96 ;; combo box | 109 ;; combo box |
97 (set-extent-begin-glyph | 110 (set-extent-begin-glyph |
98 (make-extent (point) (point)) | 111 (make-extent (point) (point)) |
99 (setq hcombo (make-glyph | 112 (setq hcombo (make-glyph |
100 [combo :width 10 :height 3 :descriptor ["Hello"] | 113 [combo-box :width 10 :height 3 :descriptor ["Hello"] |
101 :properties (:items ("One" "Two" "Three"))]))) | 114 :properties (:items ("One" "Two" "Three"))]))) |
102 | 115 |
103 ;; line | 116 ;; line |
104 (set-extent-begin-glyph | 117 (set-extent-begin-glyph |
105 (make-extent (point) (point)) | 118 (make-extent (point) (point)) |
106 (make-glyph [label :pixel-width 150 :descriptor "Hello"])) | 119 (make-glyph [label :pixel-width 150 :descriptor "Hello"])) |
109 ;(set-extent-begin-glyph | 122 ;(set-extent-begin-glyph |
110 ; (make-extent (point) (point)) | 123 ; (make-extent (point) (point)) |
111 ; (make-glyph [scrollbar :width 50 :height 20 :descriptor ["Hello"]])) | 124 ; (make-glyph [scrollbar :width 50 :height 20 :descriptor ["Hello"]])) |
112 | 125 |
113 ;; generic subwindow | 126 ;; generic subwindow |
114 (setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 50])) | 127 (setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 70])) |
115 (set-extent-begin-glyph (make-extent (point) (point)) sw) | 128 (set-extent-begin-glyph (make-extent (point) (point)) sw) |
116 | 129 |