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
|
-
|
|
|
|
|
|
|
|
|
!
-
|
!
-
|
|
|
|
!
-
|
|
|
!
|
#module
#deffunc DrawWind int px, int py, int wx, int wy, str strtitle
color
boxf px, py, px+wx, py+wy
color 127, 127, 127
boxf px+1, py+1, px+wx-1, py+wy-1
color : pos px, py
mes ""+strtitle
return
#global
#module Windowmanager fwin, px, py, wx, wy, strtitle
#modinit int _fwin, int _wx, int _wy, int _px, int _py, str _strtitle
fwin = _fwin wx = _wx wy = _wy
px = _px py = _py
strtitle = _strtitle
return
#modfunc mpDrawWind
if fwin!0 : DrawWind px, py, wx, wy, strtitle
return
#modfunc mpSetIntInfoWind int inum, int _info
if inum = 0 : fwin = _info
if inum = 1 : wx = _info
if inum = 2 : wy = _info
if inum = 3 : px = _info
if inum = 4 : py = _info
return
#modfunc mpSetStrInfoWind int inum, str _strinfo
if inum = 0 : strtitle = _strinfo return
#modfunc mpGetWindInfo int infonum
if infonum = 0 : return fwin
if infonum = 1 : return wx
if infonum = 2 : return wy
if infonum = 3 : return px
if infonum = 4 : return py
return
#global
#module
#deffunc IniGWin
dim winturn, 3
dim winfo,4
wincount = 0 return
#deffunc gnewscreen int wx, int wy, int px, int py
fwin = 1
newmod wid, Windowmanager, fwin, wx,wy, px,py, "win"+wincount
winturn.wincount = wincount
awin = wincount tgwinid = awin
wincount++
return tgwinid
#deffunc gtitle str strtitle
if tgwinid<length(wid) : mpSetStrInfoWind wid.tgwinid, 0, strtitle
return
#deffunc ggsel int _winid, int swwinact
winid = _winid
if winid>=length(wid) : return
if swwinact = 1 {
awin = winid
tgwinid = awin
i = 0
repeat length(winturn)
winturn(i) = winturn(cnt)
if awin ! winturn.cnt : i++
loop
winturn(length(winturn)-1) = awin
mpSetIntInfoWind wid.winid, 0, 1
}
if swwinact =-1 : mpSetIntInfoWind wid.winid, 0, 0 if swwinact = 0 : tgwinid = winid return
#defcfunc gginfo int infonum
if tgwinid>=length(wid) : return
if infonum = 2 : return awin if infonum = 3 : return tgwinid if infonum = 4 : mpGetWindInfo wid.tgwinid, 3 : return stat if infonum = 5 : mpGetWindInfo wid.tgwinid, 4 : return stat if infonum = 6 : mpGetWindInfo wid.tgwinid, 3 : xx = stat : mpGetWindInfo wid.tgwinid, 1 : return stat+x if infonum = 7 : mpGetWindInfo wid.tgwinid, 4 : yy = stat : mpGetWindInfo wid.tgwinid, 2 : return stat+y if infonum = 10 : mpGetWindInfo wid.tgwinid, 1 : return stat if infonum = 11 : mpGetWindInfo wid.tgwinid, 2 : return stat if infonum = 19 : return length(wid) return
#deffunc _gwidth int _wx, int _wy, int _px, int _py
if tgwinid>=length(wid) : return
if _wx!-99999 : mpSetIntInfoWind wid.tgwinid, 1, _wx
if _wy!-99999 : mpSetIntInfoWind wid.tgwinid, 2, _wy
if _px!-99999 : mpSetIntInfoWind wid.tgwinid, 3, _px
if _py!-99999 : mpSetIntInfoWind wid.tgwinid, 4, _py
return
#deffunc GetGWinTurn array winturnnum
repeat length(winturn)
winturnnum(cnt) = winturn(cnt)
loop
return awin
#deffunc DrawAllGWin
repeat length(winturn)
if winturn(cnt)<length(wid) {
mpDrawWind wid(winturn(cnt))
}
loop
return
#global
#define gwidth(%1=-99999, %2=-99999, %3=-99999, %4=-99999) _gwidth %1, %2, %3, %4 IniGWin
gnewscreen 100,100, 100,100
gtitle "window"+stat
gnewscreen 100,100, 120,120
gnewscreen 100,100, 160, 90
gnewscreen 100,100, 280,140
gnewscreen 100,100, 260,200
ggsel 1, 1 gtitle "window1" idawin = 3
ggsel idawin, 1
ggsel 2,-1
fw2=-1 *main
redraw 1 : await 16 : redraw 0 : color 255, 255, 255 : boxf : color : pos 0,0
stick key,15
z = 3
if key & 1 : gwidth ,,gginfo(4)-z if key & 2 : gwidth ,,,gginfo(5)-z
if key & 4 : gwidth ,,gginfo(4)+z
if key & 8 : gwidth ,,,gginfo(5)+z
if key & 128 : end
if key & 1024 {
idawin++
if idawin>gginfo(19)-1 : idawin = 0
ggsel idawin, 1 }
if key & 16 {
if fw2 = -1 : fw2 = 1 : else : fw2 = -1
ggsel 2,fw2
}
mes "Hit key:Tab,↑,↓,→,←"
GetGWinTurn winturn mes "アクティブウィンドウ:"+stat
a = "ウィンドウの順番:"
repeat gginfo(19)
a+=""+winturn.cnt+", "
loop
mes a
DrawAllGWin
goto *main
|