annotate tests/glyph-test.el @ 418:e804706bfb8c r21-2-17

Import from CVS: tag r21-2-17
author cvs
date Mon, 13 Aug 2007 11:23:13 +0200
parents 697ef44129c6
children 41dbb7a9d5f2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
1 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
2 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
3 (setq icon (make-glyph [xpm :file "../etc/xemacs-icon.xpm"])))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
4
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
5 (defun foo ()
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
6 (interactive)
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
7 (setq ok-select (not ok-select)))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
8
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
9 ;; button in a group
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
10 (setq ok-select nil)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
11 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
12 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
13 (make-glyph [button :descriptor ["ok " (setq ok-select t)
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
14 :style radio :selected ok-select]]))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
15 ;; button in a group
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
16 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
17 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
18 (make-glyph [button :descriptor ["ok" (setq ok-select nil) :style radio
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
19 :selected (not ok-select)]]))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
20 ;; normal pushbutton
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
21 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
22 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
23 (setq pbutton (make-glyph
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
24 [button :width 10 :height 2
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
25 :face modeline-mousable
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
26 :descriptor "ok" :callback foo
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
27 :selected t])))
418
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
28
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
29 ;; tree view
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
30 (set-extent-begin-glyph
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
31 (make-extent (point) (point))
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
32 (setq tree (make-glyph
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
33 [tree :width 10
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
34 :descriptor "My Tree"
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
35 :properties (:items (["One" foo]
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
36 (["Two" foo]
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
37 ["Four" foo]
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
38 "Six")
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
39 "Three"))])))
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
40
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
41 ;; tab control
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
42 (set-extent-begin-glyph
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
43 (make-extent (point) (point))
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
44 (setq tab (make-glyph
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
45 [tab :descriptor "My Tab"
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
46 :face default
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
47 :properties (:items (["One" foo]
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
48 ["Two" foo]
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
49 ["Three" foo]))])))
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
50
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
51 ;; progress gauge
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
52 (set-extent-begin-glyph
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
53 (make-extent (point) (point))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
54 (setq pgauge (make-glyph
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
55 [progress :width 10 :height 2
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
56 :descriptor "ok"])))
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
57 ;; progress the progress ...
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
58 (let ((x 0))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
59 (while (<= x 100)
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
60 (set-image-instance-property (glyph-image-instance pgauge) :percent x)
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
61 (setq x (+ x 5))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
62 (sit-for 0.1)))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
63
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
64 ;; progress gauge in the modeline
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
65 (setq global-mode-string
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
66 (cons (make-extent nil nil)
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
67 (setq pg (make-glyph
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
68 [progress :width 5 :pixel-height 16
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
69 :descriptor "ok"]))))
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
70 ;; progress the progress ...
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
71 (let ((x 0))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
72 (while (<= x 100)
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
73 (set-image-instance-property (glyph-image-instance pg) :percent x)
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
74 (setq x (+ x 5))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
75 (sit-for 0.1)))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
76
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
77 (set-extent-begin-glyph
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
78 (make-extent (point) (point))
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
79 (make-glyph
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
80 [button :face modeline-mousable
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
81 :descriptor "ok" :callback foo
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
82 :image (make-glyph
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
83 [xpm :file "../etc/xemacs-icon.xpm"])]))
388
aabb7f5b1c81 Import from CVS: tag r21-2-9
cvs
parents: 384
diff changeset
84
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
85 ;; normal pushbutton
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
86 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
87 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
88 (make-glyph [button :descriptor ["A Big Button" foo ]]))
418
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
89
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
90 ;; edit box
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
91 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
92 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
93 (setq hedit (make-glyph [edit :pixel-width 50 :pixel-height 30
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
94 :face bold-italic
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
95 :descriptor ["Hello"]])))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
96 ;; combo box
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
97 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
98 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
99 (setq hcombo (make-glyph
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
100 [combo :width 10 :height 3 :descriptor ["Hello"]
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
101 :properties (:items ("One" "Two" "Three"))])))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
102
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
103 ;; line
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
104 (set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
105 (make-extent (point) (point))
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
106 (make-glyph [label :pixel-width 150 :descriptor "Hello"]))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
107
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
108 ;; scrollbar
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
109 ;(set-extent-begin-glyph
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
110 ; (make-extent (point) (point))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
111 ; (make-glyph [scrollbar :width 50 :height 20 :descriptor ["Hello"]]))
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
112
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
113 ;; generic subwindow
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 408
diff changeset
114 (setq sw (make-glyph [subwindow :pixel-width 50 :pixel-height 50]))
384
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
115 (set-extent-begin-glyph (make-extent (point) (point)) sw)
bbff43aa5eb7 Import from CVS: tag r21-2-7
cvs
parents:
diff changeset
116