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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
-
|
|
!
|
#uselib "comctl32"
#func _InitCommonControlsEx "InitCommonControlsEx" int
#func _ImageList_Draw "ImageList_Draw" int, int, int, int, int, int
#func _ImageList_GetIconSize "ImageList_GetIconSize" int, int, int
iccex = 8, 4 _InitCommonControlsEx varptr(iccex)
dim nId, 6 : nId=0, 1, 4, 5, 8, 9
dim nIndexCount, 6 : nIndexCount=15, 15, 13, 13, 5, 5
dim TBBUTTON, 20
dim TBADDBITMAP, 2
screen 0
screen 1
repeat 6
gsel 0, 0
pos 0, cnt*40
winobj "ToolbarWindow32", "", 0, 0x50000009
hTool=objinfo(stat, 2)
sendmsg hTool, 0x041E, 20, 0 TBADDBITMAP=-1, nId(cnt)
sendmsg hTool, 0x0413, 0, varptr(TBADDBITMAP) nIndexFirst=stat
TBBUTTON=nIndexFirst, 1, (0x04), 0, 0
sendmsg hTool, 0x0414, 1, varptr(TBBUTTON) sendmsg hTool, 0x0421, 0, 0
sendmsg hTool, 0x0431, 0, 0 hIml=stat
sendmsg hTool, 0x043A, 0, 0 bx=(stat & 0xFFFF) : by=((stat>>16) & 0xFFFF)
gsel 1, 0
i=cnt
cx=0 : cy=0
_ImageList_GetIconSize hIml, varptr(cx), varptr(cy)
dx=(bx-cx)/2 : dy=(by-cy)/2
repeat nIndexCount(i)
syscolor 15
boxf cnt*40, i*40, cnt*40+bx-1, i*40+by-1
mref BMSCR, 67
_ImageList_Draw hIml, nIndexFirst+cnt, BMSCR(4), cnt*40+dx, i*40+dy, 0
loop
loop
gsel 1, 0
redraw 1
#include "mod_picturebutton.hsp"
gsel 1, 0
color 0,0,255 : boxf 0,280,39,319
color 0,255,0 : boxf 40,280,79,319
color 255,0,0 : boxf 80,280,119,319
color 0,0,255 : boxf 120,280,159,319
screen 3,,,4
title "しょぼえでぃた"
syscolor 15 : boxf
objmode 0, 0 : objsize 23,22
pos 0, 0 : button gosub "new",*filenew
picturebutton stat, 1, 240, 0, 3
pos 23, 0 : button gosub "load",*fileload
picturebutton stat, 1, 280, 0, 3
pos 46, 0 : button gosub "saveas",*filesaveas
picturebutton stat, 1, 320, 0, 3
pos 79, 0 : button gosub "mode",*mode : idButtonMode=stat
picturebutton stat, 1, 0, 280, 3, 1, 40, 280, 3
sdim text, 32000
pos 0, 22 : mesbox text, 640, 480-22, 5 : idMesbox=stat
stop
*filenew
if strlen(text) ! 0 {
dialog "今の内容を消去しますか?",3
if stat=7 : objsel idMesbox : return
}
text="" : objprm idMesBox, text
title "しょぼえでぃた"
objsel idMesbox
return
*fileload
dialog "txt",16
if stat=0 : objsel idMesbox : return
filename=refstr
sdim text, 32000
notesel text
noteload filename, 31999
noteunsel
title filename
objprm idMesbox, text
objsel idMesbox
return
*filesaveas
dialog "txt",17
if stat=0 : objsel idMesbox : return
filename=refstr
notesel text
notesave filename
noteunsel
title filename
objsel idMesbox
return
*mode
modeMesbox=(modeMesbox+1)\3
picturebutton idButtonMode, 1, modeMesbox*40, 280, 3, 1, modeMesbox*40+40, 280, 3
clrobj idMesbox, idMesbox
objmode modeMesbox, 0
pos 0, 22 : mesbox text, 640, 480-22, 5 : idMesbox=stat
objsel idMesbox
return
|