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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
-
|
|
|
|
!
-
|
|
|
|
!
-
|
!
-
|
!
-
|
|
|
!
| #module
#include "user32.as"
#include "gdi32.as"
#deffunc CreateTab int p1, int p2, int p3, int p4
winobj "systabcontrol32", "", , $52000000 | p4, p1, p2
hTab = objinfo(stat, 2)
GetStockObject 17
sendmsg hTab, $30, stat
TabID = p3
if TabID = 0 : TabID = 1
dim rect, 4
dim objcnt,1000 return hTab
#deffunc InsertTab str p2
pszText = p2 : tcitem = 1, 0, 0, varptr(pszText)
sendmsg hTab, $1307, TabItem, varptr(tcitem)
GetClientRect hTab, varptr(rect)
sendmsg hTab, $1328, , varptr(rect)
n = TabID + TabItem
bgscr TabID + TabItem, rect.2 - rect.0, rect.3 - rect.1, 2, rect.0, rect.1
SetWindowLong hwnd, -16, $40000000
SetParent hwnd, hTab
TabItem++
return TabItem-1
#deffunc CreateEndTab
gsel TabID, 1
return
#deffunc SetObjCntTab int p_ti, int p1
objcnt(p_ti) = p1
return
#deffunc GetObjCntTab int p_ti
return objcnt(p_ti)
#deffunc NextOjbForcusTab int fnxt
z = ginfo(3)
sendmsg hTab, $130B
i = stat
gsel i + TabID, 0
max = objcnt(i)
objsel -1
objnum = stat
if fnxt = 0 {
objnum++
if objnum>=max : objnum=0
objsel objnum
}
if fnxt = 1 {
objnum--
if objnum<0 : objnum = max-1
objsel objnum
}
gsel z, 0
return
#deffunc ChangeTab
gsel wID + TabID, -1
sendmsg hTab, $130B
wID = stat
gsel wID + TabID, 1
return
#deffunc gselTab int p_wID, int p_sw
gsel p_wID + TabID, p_sw
return
#global
#if 0
screen , 400, 300
syscolor 15 : boxf
pos 0, 0
CreateTab 400, 300, 1
hTabControl = stat
InsertTab "AAA"
taaa = stat
syscolor 15 : boxf
color : pos 50, 50 : mes "A"
moji = "" : input moji
idnum = stat button goto "dialog", *testobj
button goto "input", *testobj2
SetObjCntTab taaa, 3
InsertTab "BBB"
tbbb = stat
pos 50, 50 : mes "B"
button goto "dialog", *testobj
button goto "input", *testobj2
SetObjCntTab tbbb, 2
InsertTab "CCC"
tccc = stat
pos 50, 50 : mes "C"
InsertTab "DDD"
tddd = stat
pos 50, 50 : mes "D"
CreateEndTab
gsel
oncmd gosub *notify, $4E
onkey gosub *fcs
stop
*fcs
z = ginfo(2)
if z=-1 : return
t = iparam
getkey k, 16 if (t = 9)&(k = 0) {
NextOjbForcusTab 0
}
if (t = 9)&(k = 1) {
NextOjbForcusTab 1
}
return
*notify
dupptr nmhdr, lparam, 12
if nmhdr.0 = hTabControl & nmhdr.2 = -551 {
ChangeTab
gsel
}
return
*testobj
dialog "インプットボックスに入力されている文字列は、\n「"+moji+"」です。"
stop
*testobj2
z = ginfo(3)
gselTab taaa, 0
objprm idnum, "テスト"
gsel z
dialog "AAAタブのインプットボックスに文字列を入力しました。"
stop
#endif
|