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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!
| #module mod_groupbox
#uselib "gdi32.dll"
#func GetTextExtentPoint32 "GetTextExtentPoint32A" int,str,int,int
#uselib "UxTheme.dll"
#cfunc IsThemeActive "IsThemeActive"
#cfunc IsAppThemed "IsAppThemed"
#deffunc exgroupbox str capt, int xsize, int ysize
if varptr(IsThemeActive) : vstyle(0) = IsThemeActive()
if varptr(IsAppThemed) : vstyle(1) = IsAppThemed()
oldcolor = ginfo_r + (ginfo_g << 8) + (ginfo_b << 16)
mref bmscr, 67
dupptr ptrdup, varptr(bmscr(56)), 32, 2 : oldfont = ptrdup
cx = ginfo_cx : cy = ginfo_cy + 6
xpos = cx + xsize - 2 : ypos = cy + ysize - 8
redraw 2
if vstyle(0) & vstyle(1) {
color 208, 208, 191
line cx+1, cy, xpos-1, cy
line cx+1, ypos+1, xpos-1, ypos+1
line cx, cy+1, cx, ypos-1
line xpos+1, cy+1, xpos+1, ypos-1
pset cx+1, cy+2 : pset cx+1, cy+1 : pset cx+2, cy+1
pset xpos-1, cy+1 : pset xpos, cy+1 : pset xpos, cy+2
pset cx+1, ypos-1 : pset cx+1, ypos : pset cx+2, ypos
pset xpos-1, ypos : pset xpos, ypos : pset xpos, ypos-1
} else {
syscolor 17
line cx-1, cy, xpos, cy
line cx, ypos, xpos, ypos
line cx, cy, cx, ypos
line xpos, cy, xpos, ypos
color 255, 255, 255
line cx, cy+1, xpos-1, cy+1
line cx-1, ypos+1, xpos+1, ypos+1
line cx+1, cy+1, cx+1, ypos-1
line xpos+1, cy-1, xpos+1, ypos+1
}
sysfont 17
GetTextExtentPoint32 hdc, capt, strlen(capt), varptr(size)
syscolor 15 : boxf cx+7, cy-5, cx+size(0)+10, cy+8
if vstyle(0) & vstyle(1) : color 0, 70, 213 : else : color
pos cx+9, cy-5 : mes capt
redraw
color oldcolor & $FF, oldcolor >> 8 & $FF, oldcolor >> 16 & $FF
font oldfont
return
#global
dim size@mod_groupbox,2
dim vstyle@mod_groupbox,2
|