-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschemep3-panel-ratings.scm
60 lines (49 loc) · 1.56 KB
/
schemep3-panel-ratings.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#lang scheme/gui
(provide ratings-panel%)
(require "schemep3-playlist.scm")
(require "schemep3-database.scm")
(require "schemep3-context-menu.scm")
(require "schemep3-mixins-gui.scm")
(define cooler-button%
(class canvas%
(init-field bitmap)
(super-new
(style '())
(min-width (+ 2 (send bitmap get-width)))
(min-height (+ 2 (send bitmap get-height)))
(stretchable-width #f)
(stretchable-height #f)
(paint-callback
(lambda (button dc)
(send dc draw-bitmap bitmap 0 0))))))
(define ratings-panel%
(class (checkable-panel-mixin horizontal-panel% "Ratings Buttons")
(super-new
(stretchable-height #f))
(for ((n (in-range 1 6)))
(new button%
(label
(make-object bitmap%
(format "etc/~A.gif" n)))
(callback
(lambda (b e)
(rate-items n (playlist-selected-database-indexes))))
(min-width 24)
(min-height 24)
(stretchable-height #f)
(stretchable-width #f)
(parent this)))
; (new cooler-button%
; (parent this)
; (bitmap
; (make-object bitmap% "etc/1.gif")))
; (new cooler-button%
; (parent this)
; (bitmap
; (make-object bitmap% "etc/2.gif")))
; (new cooler-button%
; (parent this)
; (bitmap
; (make-object bitmap% "etc/3.gif")))
)
)