Rev 297 | Rev 617 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 297 | Rev 595 | ||
---|---|---|---|
1 | ;----------------------------------------------------------------------------- |
1 | ;----------------------------------------------------------------------------- |
2 | func define_3d_button ;/////////////////////////////////////////////////////// |
2 | func define_3d_button ;/////////////////////////////////////////////////////// |
3 | ;----------------------------------------------------------------------------- |
3 | ;----------------------------------------------------------------------------- |
4 | ; ebx = |
4 | ; ebx = |
5 | ; ecx = |
5 | ; ecx = |
6 | ; esp+4*3 = id |
6 | ; esp+4*3 = id |
7 | ; esp+4*2 = text |
7 | ; esp+4*2 = text |
8 | ; esp+4*1 = text length |
8 | ; esp+4*1 = text length |
9 | ;----------------------------------------------------------------------------- |
9 | ;----------------------------------------------------------------------------- |
10 | pushad |
10 | pushad |
11 | mov edx,[esp+4*8+4+4*2] |
11 | mov edx,[esp+4*8+4+4*2] |
12 | or edx,0x40000000 |
12 | or edx,0x40000000 |
13 | mcall 8 |
13 | mcall 8 |
14 | mov eax,[esp+4*8+4*1] |
14 | mov eax,[esp+4*8+4*1] |
15 | add eax,2 |
15 | add eax,2 |
16 | imul eax,6 |
16 | imul eax,6 |
17 | pushad |
17 | pushad |
18 | shr ebx,16 |
18 | shr ebx,16 |
19 | shr ecx,16 |
19 | shr ecx,16 |
20 | push ebx ecx eax 15 |
20 | push ebx ecx eax 15 |
21 | call draw_3d_panel |
21 | call draw_3d_panel |
22 | popad |
22 | popad |
23 | shr ecx,16 |
23 | shr ecx,16 |
24 | mov bx,cx |
24 | mov bx,cx |
25 | add ebx,7*65536+4 |
25 | add ebx,7*65536+4 |
26 | mcall 4,,[sc.work_text],[esp+4*8+4*2],[esp+4*8+4*1] |
26 | mcall 4,,[sc.work_text],[esp+4*8+4*2],[esp+4*8+4*1] |
27 | popad |
27 | popad |
28 | ret 4*3 |
28 | ret 4*3 |
29 | endf |
29 | endf |
30 | 30 | ||
31 | finddlg_handler: |
31 | finddlg_handler: |
32 | cmp al,1 |
32 | cmp al,1 |
33 | je .draw |
33 | je .draw |
34 | cmp al,2 |
34 | cmp al,2 |
35 | je .key |
35 | je .key |
36 | cmp al,3 |
36 | cmp al,3 |
37 | je botdlg.button |
37 | je botdlg.button |
38 | ret |
38 | ret |
39 | 39 | ||
40 | .draw: |
40 | .draw: |
41 | mov ebx,[bot_ofs] |
41 | mov ebx,[bot_ofs] |
42 | add ebx,(1+3)*65536+6 |
42 | add ebx,(1+3)*65536+6 |
43 | mcall 4,,[sc.work_text],s_2find,s_2find.size+1 |
43 | mcall 4,,[sc.work_text],s_2find,s_2find.size+1 |
44 | mov ecx,[bot_ofs] |
44 | mov ecx,[bot_ofs] |
45 | shl ecx,16 |
45 | shl ecx,16 |
46 | add ecx,(3+17)*65536+15 |
46 | add ecx,(3+17)*65536+15 |
47 | 47 | ||
48 | push ecx |
48 | push ecx |
49 | cmp [bot_dlg_mode2],0 |
49 | cmp [bot_dlg_mode2],0 |
50 | je @f |
50 | je @f |
51 | add ebx,18 |
51 | add ebx,18 |
52 | mcall 4,,[sc.work_text],s_2replace,s_2replace.size+1 |
52 | mcall 4,,[sc.work_text],s_2replace,s_2replace.size+1 |
53 | mov ecx,[esp] |
53 | mov ecx,[esp] |
54 | add ecx,18*65536 |
54 | add ecx,18*65536 |
55 | @@: |
55 | @@: |
56 | 56 | ||
57 | mov ebx,[p_info.client_box.width] |
57 | mov ebx,[p_info.client_box.width] |
58 | shl ebx,16 |
58 | shl ebx,16 |
59 | 59 | ||
60 | push 20003 |
60 | push 20003 |
61 | cmp [bot_dlg_mode2],0 |
61 | cmp [bot_dlg_mode2],0 |
62 | jne .draw.lp1 |
62 | jne .draw.lp1 |
63 | add ebx,-(2+6*(s_2find.size+2))*65536+6*(s_2find.size+2) |
63 | add ebx,-(2+6*(s_2find.size+2))*65536+6*(s_2find.size+2) |
64 | push s_2find s_2find.size |
64 | push s_2find s_2find.size |
65 | jmp @f |
65 | jmp @f |
66 | 66 | ||
67 | .draw.lp1: |
67 | .draw.lp1: |
68 | add ebx,-(2+6*(s_2replace.size+2))*65536+6*(s_2replace.size+2) |
68 | add ebx,-(2+6*(s_2replace.size+2))*65536+6*(s_2replace.size+2) |
69 | push s_2replace s_2replace.size |
69 | push s_2replace s_2replace.size |
70 | 70 | ||
71 | @@: call define_3d_button |
71 | @@: call define_3d_button |
72 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
72 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
73 | mov bx,6*(s_2cancel.size+2) |
73 | mov bx,6*(s_2cancel.size+2) |
74 | push 20001 s_2cancel s_2cancel.size |
74 | push 20001 s_2cancel s_2cancel.size |
75 | call define_3d_button |
75 | call define_3d_button |
76 | 76 | ||
77 | mov ecx,[esp] |
77 | mov ecx,[esp] |
78 | 78 | ||
79 | mov ebp,tb_find |
79 | mov ebp,tb_find |
80 | mov eax,[p_info.client_box.width] |
80 | mov eax,[p_info.client_box.width] |
81 | sub eax,6*(s_2find.size+2)+1 |
81 | sub eax,6*(s_2find.size+2)+1 |
82 | add eax,6*(s_2find.size+2)*65536 |
82 | add eax,6*(s_2find.size+2)*65536 |
83 | mov dword[tbox.width],eax |
83 | mov dword[tbox.width],eax |
84 | add ecx,-18*65536+1 |
84 | add ecx,-18*65536+1 |
85 | mov dword[tbox.height],ecx |
85 | mov dword[tbox.height],ecx |
86 | call textbox.draw |
86 | call textbox.draw |
87 | 87 | ||
88 | pop ecx |
88 | pop ecx |
89 | 89 | ||
90 | cmp [bot_dlg_mode2],0 |
90 | cmp [bot_dlg_mode2],0 |
91 | je @f |
91 | je @f |
92 | mov ebp,tb_replace |
92 | mov ebp,tb_replace |
93 | mov eax,[p_info.client_box.width] |
93 | mov eax,[p_info.client_box.width] |
94 | sub eax,6*(s_2replace.size+2)+1 |
94 | sub eax,6*(s_2replace.size+2)+1 |
95 | add eax,6*(s_2replace.size+2)*65536 |
95 | add eax,6*(s_2replace.size+2)*65536 |
96 | mov dword[tbox.width],eax |
96 | mov dword[tbox.width],eax |
97 | inc ecx |
97 | inc ecx |
98 | mov dword[tbox.height],ecx |
98 | mov dword[tbox.height],ecx |
99 | call textbox.draw |
99 | call textbox.draw |
100 | @@: |
100 | @@: |
101 | 101 | ||
102 | ret |
102 | ret |
103 | 103 | ||
104 | .key: |
104 | .key: |
105 | cmp ebx,KEY_ESCAPE |
105 | cmp ebx,KEY_ESCAPE |
106 | je btn.bot.cancel |
106 | je btn.bot.cancel |
107 | cmp ebx,KEY_RETURN |
107 | cmp ebx,KEY_RETURN |
108 | je btn.bot.find |
108 | je btn.bot.find |
109 | cmp ebx,KEY_NUMRETURN |
109 | cmp ebx,KEY_NUMRETURN |
110 | je btn.bot.find |
110 | je btn.bot.find |
111 | cmp ebx,KEY_TAB |
111 | cmp ebx,KEY_TAB |
112 | je ..tab |
112 | je ..tab |
113 | call textbox.key |
113 | call textbox.key |
114 | ret |
114 | ret |
115 | 115 | ||
116 | ..tab: |
116 | ..tab: |
117 | cmp [bot_dlg_mode2],0 |
117 | cmp [bot_dlg_mode2],0 |
118 | je @f |
118 | je @f |
119 | mov eax,tb_replace |
119 | mov eax,tb_replace |
120 | cmp eax,[focused_tb] |
120 | cmp eax,[focused_tb] |
121 | jne .key.lp1 |
121 | jne .key.lp1 |
122 | mov eax,tb_find |
122 | mov eax,tb_find |
123 | .key.lp1: |
123 | .key.lp1: |
124 | mov [focused_tb],eax |
124 | mov [focused_tb],eax |
125 | call .draw |
125 | call .draw |
126 | @@: ret |
126 | @@: ret |
127 | 127 | ||
128 | osdlg_handler: |
128 | osdlg_handler: |
129 | cmp al,1 |
129 | cmp al,1 |
130 | je .draw |
130 | je .draw |
131 | cmp al,2 |
131 | cmp al,2 |
132 | je .key |
132 | je .key |
133 | cmp al,3 |
133 | cmp al,3 |
134 | je botdlg.button |
134 | je botdlg.button |
135 | ret |
135 | ret |
136 | 136 | ||
137 | .draw: |
137 | .draw: |
138 | mov ebx,[bot_ofs] |
138 | mov ebx,[bot_ofs] |
139 | add ebx,(1+3)*65536+6 |
139 | add ebx,(1+3)*65536+6 |
140 | mcall 4,,[sc.work_text],s_2filename,s_2filename.size |
140 | mcall 4,,[sc.work_text],s_2filename,s_2filename.size |
141 | mov ebx,[p_info.client_box.width] |
141 | mov ebx,[p_info.client_box.width] |
142 | shl ebx,16 |
142 | shl ebx,16 |
143 | mov ecx,[bot_ofs] |
143 | mov ecx,[bot_ofs] |
144 | shl ecx,16 |
144 | shl ecx,16 |
145 | add ecx,(2+18)*65536+15 |
145 | add ecx,(2+18)*65536+15 |
146 | 146 | ||
147 | push 20002 |
147 | push 20002 |
148 | cmp [bot_dlg_mode2],0 |
148 | cmp [bot_dlg_mode2],0 |
149 | jne .draw.lp1 |
149 | jne .draw.lp1 |
150 | add ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2) |
150 | add ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2) |
151 | push s_2open s_2open.size |
151 | push s_2open s_2open.size |
152 | jmp @f |
152 | jmp @f |
153 | .draw.lp1: |
153 | .draw.lp1: |
154 | add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
154 | add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
155 | push s_2save s_2save.size |
155 | push s_2save s_2save.size |
156 | 156 | ||
157 | @@: call define_3d_button |
157 | @@: call define_3d_button |
158 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
158 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
159 | mov bx,6*(s_2cancel.size+2) |
159 | mov bx,6*(s_2cancel.size+2) |
160 | push 20001 s_2cancel s_2cancel.size |
160 | push 20001 s_2cancel s_2cancel.size |
161 | call define_3d_button |
161 | call define_3d_button |
- | 162 | ||
- | 163 | cmp [bot_dlg_mode2], 2 ; exit-save dialog |
|
- | 164 | jne @f |
|
- | 165 | ||
- | 166 | sub ebx,(6*(s_2save_no.size+2)+3)*65536 |
|
- | 167 | mov bx,6*(s_2save_no.size+2) |
|
- | 168 | push 20007 s_2save_no s_2save_no.size |
|
- | 169 | call define_3d_button |
|
162 | 170 | ||
163 | mov ebp,tb_opensave |
171 | @@: mov ebp,tb_opensave |
164 | mov eax,[p_info.client_box.width] |
172 | mov eax,[p_info.client_box.width] |
165 | sub eax,6*(s_2filename.size+1)+1 |
173 | sub eax,6*(s_2filename.size+1)+1 |
166 | add eax,6*(s_2filename.size+1)*65536 |
174 | add eax,6*(s_2filename.size+1)*65536 |
167 | mov dword[tbox.width],eax |
175 | mov dword[tbox.width],eax |
168 | add ecx,-18*65536+1 |
176 | add ecx,-18*65536+1 |
169 | mov dword[tbox.height],ecx |
177 | mov dword[tbox.height],ecx |
170 | call textbox.draw |
178 | call textbox.draw |
171 | 179 | ||
172 | ret |
180 | ret |
173 | 181 | ||
174 | .key: |
182 | .key: |
175 | cmp ebx,KEY_ESCAPE |
183 | cmp ebx,KEY_ESCAPE |
176 | je btn.bot.cancel |
184 | je btn.bot.cancel |
177 | cmp ebx,KEY_RETURN |
185 | cmp ebx,KEY_RETURN |
178 | je btn.bot.opensave |
186 | je btn.bot.opensave |
179 | cmp ebx,KEY_NUMRETURN |
187 | cmp ebx,KEY_NUMRETURN |
180 | je btn.bot.opensave |
188 | je btn.bot.opensave |
181 | call textbox.key |
189 | call textbox.key |
182 | ret |
190 | ret |
183 | 191 | ||
184 | gotodlg_handler: |
192 | gotodlg_handler: |
185 | cmp al,1 |
193 | cmp al,1 |
186 | je .draw |
194 | je .draw |
187 | cmp al,2 |
195 | cmp al,2 |
188 | je .key |
196 | je .key |
189 | cmp al,3 |
197 | cmp al,3 |
190 | je botdlg.button |
198 | je botdlg.button |
191 | ret |
199 | ret |
192 | 200 | ||
193 | .draw: |
201 | .draw: |
194 | mov ebx,[bot_ofs] |
202 | mov ebx,[bot_ofs] |
195 | add ebx,(1+3)*65536+6 |
203 | add ebx,(1+3)*65536+6 |
196 | mcall 4,,[sc.work_text],s_2filename,s_2filename.size |
204 | mcall 4,,[sc.work_text],s_2filename,s_2filename.size |
197 | mov ebx,[p_info.box.width] |
205 | mov ebx,[p_info.box.width] |
198 | shl ebx,16 |
206 | shl ebx,16 |
199 | mov ecx,[bot_ofs] |
207 | mov ecx,[bot_ofs] |
200 | shl ecx,16 |
208 | shl ecx,16 |
201 | add ecx,(2+18)*65536+15 |
209 | add ecx,(2+18)*65536+15 |
202 | 210 | ||
203 | push 20002 |
211 | push 20002 |
204 | cmp [bot_dlg_mode2],0 |
212 | cmp [bot_dlg_mode2],0 |
205 | jne .draw.lp1 |
213 | jne .draw.lp1 |
206 | add ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2) |
214 | add ebx,-(2+6*(s_2open.size+2))*65536+6*(s_2open.size+2) |
207 | push s_2open s_2open.size |
215 | push s_2open s_2open.size |
208 | jmp @f |
216 | jmp @f |
209 | .draw.lp1: |
217 | .draw.lp1: |
210 | add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
218 | add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
211 | push s_2save s_2save.size |
219 | push s_2save s_2save.size |
212 | 220 | ||
213 | @@: call define_3d_button |
221 | @@: call define_3d_button |
214 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
222 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
215 | mov bx,6*(s_2cancel.size+2) |
223 | mov bx,6*(s_2cancel.size+2) |
216 | push 20001 s_2cancel s_2cancel.size |
224 | push 20001 s_2cancel s_2cancel.size |
217 | call define_3d_button |
225 | call define_3d_button |
218 | 226 | ||
219 | mov ebp,tb_opensave |
227 | mov ebp,tb_opensave |
220 | mov eax,[p_info.box.width] |
228 | mov eax,[p_info.box.width] |
221 | sub eax,6*(s_2filename.size+3) |
229 | sub eax,6*(s_2filename.size+3) |
222 | add eax,6*(s_2filename.size+2)*65536 |
230 | add eax,6*(s_2filename.size+2)*65536 |
223 | mov dword[tbox.width],eax |
231 | mov dword[tbox.width],eax |
224 | add ecx,-18*65536+1 |
232 | add ecx,-18*65536+1 |
225 | mov dword[tbox.height],ecx |
233 | mov dword[tbox.height],ecx |
226 | call textbox.draw |
234 | call textbox.draw |
227 | 235 | ||
228 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
236 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
229 | mov bx,6*(s_2cancel.size+2) |
237 | mov bx,6*(s_2cancel.size+2) |
230 | push 20010 s_2cancel s_2cancel.size |
238 | push 20010 s_2cancel s_2cancel.size |
231 | call define_3d_button |
239 | call define_3d_button |
232 | 240 | ||
233 | ret |
241 | ret |
234 | 242 | ||
235 | .key: |
243 | .key: |
236 | cmp ebx,KEY_ESCAPE |
244 | cmp ebx,KEY_ESCAPE |
237 | je btn.bot.cancel |
245 | je btn.bot.cancel |
238 | cmp ebx,KEY_RETURN |
246 | cmp ebx,KEY_RETURN |
239 | je btn.bot.opensave |
247 | je btn.bot.opensave |
240 | cmp ebx,KEY_NUMRETURN |
248 | cmp ebx,KEY_NUMRETURN |
241 | je btn.bot.opensave |
249 | je btn.bot.opensave |
242 | call textbox.key |
250 | call textbox.key |
243 | ret |
251 | ret |
244 | 252 | ||
245 | cur_part dd ? |
253 | cur_part dd ? |
246 | cur_color dd ? |
254 | cur_color dd ? |
247 | cur_colors rd 10 |
255 | cur_colors rd 10 |
248 | 256 | ||
249 | optsdlg_handler: |
257 | optsdlg_handler: |
250 | cmp al,1 |
258 | cmp al,1 |
251 | je .draw |
259 | je .draw |
252 | cmp al,2 |
260 | cmp al,2 |
253 | je .key |
261 | je .key |
254 | cmp al,3 |
262 | cmp al,3 |
255 | je botdlg.button |
263 | je botdlg.button |
256 | cmp al,4 |
264 | cmp al,4 |
257 | je .mouse |
265 | je .mouse |
258 | ret |
266 | ret |
259 | 267 | ||
260 | .xchg_colors: |
268 | .xchg_colors: |
261 | mov ecx,10 |
269 | mov ecx,10 |
262 | mov esi,color_tbl |
270 | mov esi,color_tbl |
263 | mov edi,cur_colors |
271 | mov edi,cur_colors |
264 | @@: lodsd |
272 | @@: lodsd |
265 | xchg eax,[edi] |
273 | xchg eax,[edi] |
266 | mov [esi-4],eax |
274 | mov [esi-4],eax |
267 | add edi,4 |
275 | add edi,4 |
268 | loop @b |
276 | loop @b |
269 | ret |
277 | ret |
270 | 278 | ||
271 | .draw: |
279 | .draw: |
272 | call .draw_editor |
280 | call .draw_editor |
273 | 281 | ||
274 | mov ecx,[bot_ofs-2] |
282 | mov ecx,[bot_ofs-2] |
275 | mov cx,word[bot_ofs] |
283 | mov cx,word[bot_ofs] |
276 | push ecx |
284 | push ecx |
277 | add ecx,128 |
285 | add ecx,128 |
278 | mcall 38,<2+3+165,2+3+165>,,[cl_3d_inset] |
286 | mcall 38,<2+3+165,2+3+165>,,[cl_3d_inset] |
279 | mov bx,word[p_info.client_box.width] |
287 | mov bx,word[p_info.client_box.width] |
280 | pop ecx |
288 | pop ecx |
281 | add ecx,35*65536+35 |
289 | add ecx,35*65536+35 |
282 | mcall |
290 | mcall |
283 | add ecx,0x00240024 |
291 | add ecx,0x00240024 |
284 | mcall |
292 | mcall |
285 | 293 | ||
286 | shr ecx,16 |
294 | shr ecx,16 |
287 | mov bx,cx |
295 | mov bx,cx |
288 | add ebx,38*65536-21 |
296 | add ebx,38*65536-21 |
289 | mcall 4,,[sc.work_text],s_tabpos,s_tabpos.size |
297 | mcall 4,,[sc.work_text],s_tabpos,s_tabpos.size |
290 | 298 | ||
291 | call .draw_tabpos |
299 | call .draw_tabpos |
292 | 300 | ||
293 | mov ebx,[bot_ofs] |
301 | mov ebx,[bot_ofs] |
294 | add ebx,(2+6+165+35)*65536+5+16 |
302 | add ebx,(2+6+165+35)*65536+5+16 |
295 | mcall 4,,[sc.work_text],s_color,s_color.size |
303 | mcall 4,,[sc.work_text],s_color,s_color.size |
296 | 304 | ||
297 | mov dword[tb_color.width],(2+6+6*s_color.size+165+35)*65536+(6*6+8) |
305 | mov dword[tb_color.width],(2+6+6*s_color.size+165+35)*65536+(6*6+8) |
298 | mov eax,ebx |
306 | mov eax,ebx |
299 | add ax,-3 |
307 | add ax,-3 |
300 | shl eax,16 |
308 | shl eax,16 |
301 | mov ax,14 |
309 | mov ax,14 |
302 | mov dword[tb_color.height],eax |
310 | mov dword[tb_color.height],eax |
303 | 311 | ||
304 | call .draw_color |
312 | call .draw_color |
305 | 313 | ||
306 | mov ebx,[p_info.client_box.width] |
314 | mov ebx,[p_info.client_box.width] |
307 | shl ebx,16 |
315 | shl ebx,16 |
308 | mov ecx,[p_info.client_box.height] |
316 | mov ecx,[p_info.client_box.height] |
309 | shl ecx,16 |
317 | shl ecx,16 |
310 | add ecx,(-34)*65536+15 |
318 | add ecx,(-34)*65536+15 |
311 | 319 | ||
312 | add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
320 | add ebx,-(2+6*(s_2save.size+2))*65536+6*(s_2save.size+2) |
313 | push 20004 s_2save s_2save.size |
321 | push 20004 s_2save s_2save.size |
314 | call define_3d_button |
322 | call define_3d_button |
315 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
323 | sub ebx,(6*(s_2cancel.size+2)+3)*65536 |
316 | mov bx,6*(s_2cancel.size+2) |
324 | mov bx,6*(s_2cancel.size+2) |
317 | push 20001 s_2cancel s_2cancel.size |
325 | push 20001 s_2cancel s_2cancel.size |
318 | call define_3d_button |
326 | call define_3d_button |
319 | 327 | ||
320 | ret |
328 | ret |
321 | 329 | ||
322 | .get_color: |
330 | .get_color: |
323 | movzx ecx,[tb_color.length] |
331 | movzx ecx,[tb_color.length] |
324 | mov esi,tb_color.text |
332 | mov esi,tb_color.text |
325 | xor eax,eax |
333 | xor eax,eax |
326 | xor ebx,ebx |
334 | xor ebx,ebx |
327 | jecxz .lp2 |
335 | jecxz .lp2 |
328 | .lp1: lodsb |
336 | .lp1: lodsb |
329 | cmp al,'9' |
337 | cmp al,'9' |
330 | mov dl,-'0' |
338 | mov dl,-'0' |
331 | jbe @f |
339 | jbe @f |
332 | mov dl,-'A'+10 |
340 | mov dl,-'A'+10 |
333 | @@: add al,dl |
341 | @@: add al,dl |
334 | shl ebx,4 |
342 | shl ebx,4 |
335 | add bl,al |
343 | add bl,al |
336 | loop .lp1 |
344 | loop .lp1 |
337 | .lp2: mov eax,[cur_part] |
345 | .lp2: mov eax,[cur_part] |
338 | mov [cur_colors+eax*4],ebx |
346 | mov [cur_colors+eax*4],ebx |
339 | mov [cur_color],ebx |
347 | mov [cur_color],ebx |
340 | jmp .draw_color.2 |
348 | jmp .draw_color.2 |
341 | 349 | ||
342 | .draw_editor: |
350 | .draw_editor: |
343 | push dword[options] [tab_bar.Current.Ptr] |
351 | push dword[options] [tab_bar.Current.Ptr] |
344 | mov [options],0 |
352 | mov [options],0 |
345 | mov ebp,optsdlg_editor |
353 | mov ebp,optsdlg_editor |
346 | call set_cur_tab |
354 | call set_cur_tab |
347 | 355 | ||
348 | call .xchg_colors |
356 | call .xchg_colors |
349 | mov [cur_editor.Bounds.Left],2 |
357 | mov [cur_editor.Bounds.Left],2 |
350 | mov [cur_editor.Bounds.Right],2+165 |
358 | mov [cur_editor.Bounds.Right],2+165 |
351 | mov eax,[p_info.client_box.height] |
359 | mov eax,[p_info.client_box.height] |
352 | add eax,-125-STATH |
360 | add eax,-125-STATH |
353 | mov [cur_editor.Bounds.Top],eax |
361 | mov [cur_editor.Bounds.Top],eax |
354 | add eax,122 |
362 | add eax,122 |
355 | mov [cur_editor.Bounds.Bottom],eax |
363 | mov [cur_editor.Bounds.Bottom],eax |
356 | call draw_editor |
364 | call draw_editor |
357 | call .xchg_colors |
365 | call .xchg_colors |
358 | 366 | ||
359 | pop ebp eax |
367 | pop ebp eax |
360 | mov [options],al |
368 | mov [options],al |
361 | call set_cur_tab |
369 | call set_cur_tab |
362 | ret |
370 | ret |
363 | 371 | ||
364 | .draw_tabpos: |
372 | .draw_tabpos: |
365 | mov ecx,[bot_ofs-2] |
373 | mov ecx,[bot_ofs-2] |
366 | xor cx,cx |
374 | xor cx,cx |
367 | mov ebx,(2+3+165+3)*65536+31 |
375 | mov ebx,(2+3+165+3)*65536+31 |
368 | add ecx,38*65536+31 |
376 | add ecx,38*65536+31 |
369 | mov edx,[cl_3d_inset] |
377 | mov edx,[cl_3d_inset] |
370 | mov esi,[sc.work] |
378 | mov esi,[sc.work] |
371 | call draw_fillrect |
379 | call draw_fillrect |
372 | dec ebx |
380 | dec ebx |
373 | dec ecx |
381 | dec ecx |
374 | mcall 8,,,0x40000000+21001 |
382 | mcall 8,,,0x40000000+21001 |
375 | mov esi,[cl_3d_normal] |
383 | mov esi,[cl_3d_normal] |
376 | mov al,[tab_pos] |
384 | mov al,[tab_pos] |
377 | 385 | ||
378 | TPOSH = 6 |
386 | TPOSH = 6 |
379 | TPOSW = 10 |
387 | TPOSW = 10 |
380 | 388 | ||
381 | dec al |
389 | dec al |
382 | jnz @f |
390 | jnz @f |
383 | ;// top |
391 | ;// top |
384 | inc ebx |
392 | inc ebx |
385 | mov cx,TPOSH |
393 | mov cx,TPOSH |
386 | call draw_fillrect |
394 | call draw_fillrect |
387 | add ecx,2*65536-2 |
395 | add ecx,2*65536-2 |
388 | jmp .lp3 |
396 | jmp .lp3 |
389 | @@: dec al |
397 | @@: dec al |
390 | jnz @f |
398 | jnz @f |
391 | ;// bottom |
399 | ;// bottom |
392 | inc ebx |
400 | inc ebx |
393 | mov cx,TPOSH |
401 | mov cx,TPOSH |
394 | add ecx,(31-TPOSH)*65536 |
402 | add ecx,(31-TPOSH)*65536 |
395 | call draw_fillrect |
403 | call draw_fillrect |
396 | add ecx,-2 |
404 | add ecx,-2 |
397 | jmp .lp3 |
405 | jmp .lp3 |
398 | @@: dec al |
406 | @@: dec al |
399 | jnz @f |
407 | jnz @f |
400 | ;// left |
408 | ;// left |
401 | inc ecx |
409 | inc ecx |
402 | mov bx,TPOSW |
410 | mov bx,TPOSW |
403 | call draw_fillrect |
411 | call draw_fillrect |
404 | add ebx,2*65536-2 |
412 | add ebx,2*65536-2 |
405 | jmp .lp4 |
413 | jmp .lp4 |
406 | @@: dec al |
414 | @@: dec al |
407 | jnz @f |
415 | jnz @f |
408 | ;// right |
416 | ;// right |
409 | inc ecx |
417 | inc ecx |
410 | mov bx,TPOSW |
418 | mov bx,TPOSW |
411 | add ebx,(31-TPOSW)*65536 |
419 | add ebx,(31-TPOSW)*65536 |
412 | call draw_fillrect |
420 | call draw_fillrect |
413 | add ebx,-2 |
421 | add ebx,-2 |
414 | jmp .lp4 |
422 | jmp .lp4 |
415 | 423 | ||
416 | .lp3: |
424 | .lp3: |
417 | add ebx,(2+TPOSW-2+1)*65536-31+TPOSW-2 |
425 | add ebx,(2+TPOSW-2+1)*65536-31+TPOSW-2 |
418 | call draw_fillrect |
426 | call draw_fillrect |
419 | add ebx,-(TPOSW-2+1)*65536 |
427 | add ebx,-(TPOSW-2+1)*65536 |
420 | mov esi,[sc.work] |
428 | mov esi,[sc.work] |
421 | call draw_fillrect |
429 | call draw_fillrect |
422 | ret |
430 | ret |
423 | .lp4: |
431 | .lp4: |
424 | add ecx,7*65536-31+4 |
432 | add ecx,7*65536-31+4 |
425 | call draw_fillrect |
433 | call draw_fillrect |
426 | add ecx,-5*65536 |
434 | add ecx,-5*65536 |
427 | mov esi,[sc.work] |
435 | mov esi,[sc.work] |
428 | call draw_fillrect |
436 | call draw_fillrect |
429 | ret |
437 | ret |
430 | 438 | ||
431 | .draw_color: |
439 | .draw_color: |
432 | mov ecx,[cur_part] |
440 | mov ecx,[cur_part] |
433 | mov edx,s_appearance+1 |
441 | mov edx,s_appearance+1 |
434 | @@: dec ecx |
442 | @@: dec ecx |
435 | js @f |
443 | js @f |
436 | movzx eax,byte[edx-1] |
444 | movzx eax,byte[edx-1] |
437 | lea edx,[edx+eax+1] |
445 | lea edx,[edx+eax+1] |
438 | jmp @b |
446 | jmp @b |
439 | @@: |
447 | @@: |
440 | movzx esi,byte[edx-1] |
448 | movzx esi,byte[edx-1] |
441 | mov ebx,[bot_ofs] |
449 | mov ebx,[bot_ofs] |
442 | add ebx,(2+6+165+35)*65536+8 |
450 | add ebx,(2+6+165+35)*65536+8 |
443 | push ebx ecx edx |
451 | push ebx ecx edx |
444 | mov ecx,ebx |
452 | mov ecx,ebx |
445 | shl ecx,16 |
453 | shl ecx,16 |
446 | mov bx,s_appearance.maxl*6 |
454 | mov bx,s_appearance.maxl*6 |
447 | mov cx,10 |
455 | mov cx,10 |
448 | mcall 13,,,[cl_3d_normal] |
456 | mcall 13,,,[cl_3d_normal] |
449 | pop edx ecx ebx |
457 | pop edx ecx ebx |
450 | mcall 4,,[sc.work_text] |
458 | mcall 4,,[sc.work_text] |
451 | 459 | ||
452 | mov eax,[cur_color] |
460 | mov eax,[cur_color] |
453 | mov edi,tb_color.text |
461 | mov edi,tb_color.text |
454 | mov ebx,6 |
462 | mov ebx,6 |
455 | mov ecx,16 |
463 | mov ecx,16 |
456 | call uint2strz |
464 | call uint2strz |
457 | mov [tb_color.length],6 |
465 | mov [tb_color.length],6 |
458 | mov [tb_color.sel.x],0 |
466 | mov [tb_color.sel.x],0 |
459 | mov [tb_color.pos.x],6 |
467 | mov [tb_color.pos.x],6 |
460 | 468 | ||
461 | mov ebp,tb_color |
469 | mov ebp,tb_color |
462 | call textbox.draw |
470 | call textbox.draw |
463 | 471 | ||
464 | .draw_color.2: |
472 | .draw_color.2: |
465 | mov ecx,[p_info.client_box.height] |
473 | mov ecx,[p_info.client_box.height] |
466 | sub ecx,[bot_dlg_height] |
474 | sub ecx,[bot_dlg_height] |
467 | add ecx,-STATH |
475 | add ecx,-STATH |
468 | shl ecx,16 |
476 | shl ecx,16 |
469 | add ecx,3*65536+31 |
477 | add ecx,3*65536+31 |
470 | mov ebx,(2+6+165)*65536+31 |
478 | mov ebx,(2+6+165)*65536+31 |
471 | mov edx,[cl_3d_inset] |
479 | mov edx,[cl_3d_inset] |
472 | mov esi,[cur_color] |
480 | mov esi,[cur_color] |
473 | call draw_fillrect |
481 | call draw_fillrect |
474 | 482 | ||
475 | ret |
483 | ret |
476 | 484 | ||
477 | .key: |
485 | .key: |
478 | cmp ebx,KEY_ESCAPE |
486 | cmp ebx,KEY_ESCAPE |
479 | je btn.bot.cancel |
487 | je btn.bot.cancel |
480 | cmp ebx,KEY_RETURN |
488 | cmp ebx,KEY_RETURN |
481 | je btn.bot.appearance |
489 | je btn.bot.appearance |
482 | cmp ebx,KEY_NUMRETURN |
490 | cmp ebx,KEY_NUMRETURN |
483 | je btn.bot.appearance |
491 | je btn.bot.appearance |
484 | 492 | ||
485 | cmp ebx,KEY_BACKSPACE |
493 | cmp ebx,KEY_BACKSPACE |
486 | je .key.tb.2 |
494 | je .key.tb.2 |
487 | cmp ebx,KEY_TAB |
495 | cmp ebx,KEY_TAB |
488 | je .key.tb.2 |
496 | je .key.tb.2 |
489 | cmp bx,0x00FF |
497 | cmp bx,0x00FF |
490 | ja .key.tb.2 |
498 | ja .key.tb.2 |
491 | ;cmp ebx,KEY_LSHIFT |
499 | ;cmp ebx,KEY_LSHIFT |
492 | ;je .key.tb.2 |
500 | ;je .key.tb.2 |
493 | ;cmp ebx,KEY_RSHIFT |
501 | ;cmp ebx,KEY_RSHIFT |
494 | ;je .key.tb.2 |
502 | ;je .key.tb.2 |
495 | ;cmp ebx,0x00000147 |
503 | ;cmp ebx,0x00000147 |
496 | ;jb .key.exit |
504 | ;jb .key.exit |
497 | ;cmp ebx,0x00000153 |
505 | ;cmp ebx,0x00000153 |
498 | ;jbe .key.tb.2 |
506 | ;jbe .key.tb.2 |
499 | 507 | ||
500 | test dword[shi],KM_CTRLALT |
508 | test dword[shi],KM_CTRLALT |
501 | jnz .key.exit |
509 | jnz .key.exit |
502 | movzx eax,[chr] |
510 | movzx eax,[chr] |
503 | movzx eax,[eax+key0] |
511 | movzx eax,[eax+key0] |
504 | or al,al |
512 | or al,al |
505 | jz .key.exit |
513 | jz .key.exit |
506 | movzx eax,[eax+key1] |
514 | movzx eax,[eax+key1] |
507 | 515 | ||
508 | cmp al,'0' |
516 | cmp al,'0' |
509 | jb @f |
517 | jb @f |
510 | cmp al,'9' |
518 | cmp al,'9' |
511 | jbe .key.tb |
519 | jbe .key.tb |
512 | @@: cmp al,'A' |
520 | @@: cmp al,'A' |
513 | jb @f |
521 | jb @f |
514 | cmp al,'F' |
522 | cmp al,'F' |
515 | jbe .key.tb |
523 | jbe .key.tb |
516 | @@: cmp al,'a' |
524 | @@: cmp al,'a' |
517 | jb @f |
525 | jb @f |
518 | cmp al,'f' |
526 | cmp al,'f' |
519 | jbe .key.tb |
527 | jbe .key.tb |
520 | @@: ret |
528 | @@: ret |
521 | .key.tb: |
529 | .key.tb: |
522 | cmp [tb_color.length],6 |
530 | cmp [tb_color.length],6 |
523 | jb @f |
531 | jb @f |
524 | mov al,[tb_color.sel.x] |
532 | mov al,[tb_color.sel.x] |
525 | cmp al,[tb_color.pos.x] |
533 | cmp al,[tb_color.pos.x] |
526 | jne @f |
534 | jne @f |
527 | ret |
535 | ret |
528 | .key.tb.2: |
536 | .key.tb.2: |
529 | @@: call textbox.key |
537 | @@: call textbox.key |
530 | call .get_color |
538 | call .get_color |
531 | call .draw_editor |
539 | call .draw_editor |
532 | .key.exit: |
540 | .key.exit: |
533 | ret |
541 | ret |
534 | 542 | ||
535 | .mouse: |
543 | .mouse: |
536 | cmp ah,MEV_LDOWN |
544 | cmp ah,MEV_LDOWN |
537 | jne .mouse.exit |
545 | jne .mouse.exit |
538 | mcall 37,1 |
546 | mcall 37,1 |
539 | movsx ebx,ax |
547 | movsx ebx,ax |
540 | sar eax,16 |
548 | sar eax,16 |
541 | cmp eax,[optsdlg_editor+EDITOR.Bounds.Right] |
549 | cmp eax,[optsdlg_editor+EDITOR.Bounds.Right] |
542 | jg .mouse.exit |
550 | jg .mouse.exit |
543 | cmp ebx,[optsdlg_editor+EDITOR.Bounds.Bottom] |
551 | cmp ebx,[optsdlg_editor+EDITOR.Bounds.Bottom] |
544 | jg .mouse.exit |
552 | jg .mouse.exit |
545 | sub eax,[optsdlg_editor+EDITOR.Bounds.Left] |
553 | sub eax,[optsdlg_editor+EDITOR.Bounds.Left] |
546 | js .mouse.exit |
554 | js .mouse.exit |
547 | sub ebx,[optsdlg_editor+EDITOR.Bounds.Top] |
555 | sub ebx,[optsdlg_editor+EDITOR.Bounds.Top] |
548 | js .mouse.exit |
556 | js .mouse.exit |
549 | mov esi,optsdlg_editor_parts-5 |
557 | mov esi,optsdlg_editor_parts-5 |
550 | @@: add esi,5 |
558 | @@: add esi,5 |
551 | cmp byte[esi+0],-1 |
559 | cmp byte[esi+0],-1 |
552 | je .mouse.exit |
560 | je .mouse.exit |
553 | cmp al,byte[esi+1] |
561 | cmp al,byte[esi+1] |
554 | jb @b |
562 | jb @b |
555 | cmp bl,byte[esi+2] |
563 | cmp bl,byte[esi+2] |
556 | jb @b |
564 | jb @b |
557 | cmp al,byte[esi+3] |
565 | cmp al,byte[esi+3] |
558 | ja @b |
566 | ja @b |
559 | cmp bl,byte[esi+4] |
567 | cmp bl,byte[esi+4] |
560 | ja @b |
568 | ja @b |
561 | movzx ebp,byte[esi+0] |
569 | movzx ebp,byte[esi+0] |
562 | mov [cur_part],ebp |
570 | mov [cur_part],ebp |
563 | m2m [cur_color],[cur_colors+ebp*4] |
571 | m2m [cur_color],[cur_colors+ebp*4] |
564 | ;mcall 13,<200,30>,<250,30>,[color_tbl+ebp*4] |
572 | ;mcall 13,<200,30>,<250,30>,[color_tbl+ebp*4] |
565 | ;call .draw_color |
573 | ;call .draw_color |
566 | call .draw |
574 | call .draw |
567 | 575 | ||
568 | .mouse.exit: |
576 | .mouse.exit: |
569 | ret |
577 | ret |
570 | 578 | ||
571 | botdlg.button: |
579 | botdlg.button: |
572 | mov esi,accel_table2_botdlg |
580 | mov esi,accel_table2_botdlg |
573 | .acc: cmp ebx,[esi] |
581 | .acc: cmp ebx,[esi] |
574 | jne @f |
582 | jne @f |
575 | call dword[esi+4] |
583 | call dword[esi+4] |
576 | ret |
584 | ret |
577 | @@: add esi,8 |
585 | @@: add esi,8 |
578 | cmp byte[esi],0 |
586 | cmp byte[esi],0 |
579 | jne .acc |
587 | jne .acc |
580 | ret |
588 | ret |
581 | 589 | ||
582 | btn.bot.cancel: |
590 | btn.bot.cancel: |
583 | xor eax,eax |
591 | xor eax,eax |
584 | mov [bot_mode],al |
592 | mov [bot_mode],al |
585 | mov [bot_dlg_height],eax |
593 | mov [bot_dlg_height],eax |
586 | mov [s_status],eax |
594 | mov [s_status],eax |
587 | call drawwindow |
595 | call drawwindow |
588 | ret |
596 | ret |
589 | 597 | ||
590 | btn.bot.opensave: |
598 | btn.bot.opensave: |
591 | cmp [bot_dlg_mode2],0 |
599 | cmp [bot_dlg_mode2],0 |
592 | je .lp1 |
600 | je .lp1 |
593 | call save_file |
601 | call save_file |
594 | jnc @f |
602 | jnc @f |
595 | jmp .lp2 |
603 | jmp .lp2 |
596 | .lp1: call load_file |
604 | .lp1: call load_file |
597 | jnc @f |
605 | jnc @f |
598 | .lp2: |
606 | .lp2: |
599 | ret |
607 | ret |
600 | @@: ;call update_caption |
608 | @@: ;call update_caption |
601 | xor eax,eax |
609 | xor eax,eax |
602 | mov [bot_mode],al |
610 | mov [bot_mode],al |
603 | mov [bot_dlg_height],eax |
611 | mov [bot_dlg_height],eax |
604 | call drawwindow |
612 | call drawwindow |
- | 613 | ret |
|
- | 614 | ||
- | 615 | btn.bot.no: |
|
- | 616 | call key.ctrl_f4.close |
|
- | 617 | xor eax,eax |
|
- | 618 | mov [bot_mode],al |
|
- | 619 | mov [bot_dlg_height],eax |
|
- | 620 | mov [s_status],eax |
|
- | 621 | call drawwindow |
|
605 | ret |
622 | ret |
606 | 623 | ||
607 | btn.bot.find: |
624 | btn.bot.find: |
608 | movzx ecx,[tb_find.length] |
625 | movzx ecx,[tb_find.length] |
609 | mov [s_search.size],ecx |
626 | mov [s_search.size],ecx |
610 | mov esi,tb_find.text |
627 | mov esi,tb_find.text |
611 | mov edi,s_search |
628 | mov edi,s_search |
612 | cld |
629 | cld |
613 | rep movsb |
630 | rep movsb |
614 | 631 | ||
615 | cmp [bot_dlg_mode2],0 |
632 | cmp [bot_dlg_mode2],0 |
616 | je @f |
633 | je @f |
617 | call search |
634 | call search |
618 | jnc .found |
635 | jnc .found |
619 | call editor_check_for_changes |
636 | call editor_check_for_changes |
620 | ret |
637 | ret |
621 | 638 | ||
622 | .found: |
639 | .found: |
623 | push [copy_size] [copy_count] [copy_buf] |
640 | push [copy_size] [copy_count] [copy_buf] |
624 | 641 | ||
625 | movzx eax,[tb_replace.length] |
642 | movzx eax,[tb_replace.length] |
626 | add eax,10 |
643 | add eax,10 |
627 | call mem.Alloc |
644 | call mem.Alloc |
628 | mov [copy_buf],eax |
645 | mov [copy_buf],eax |
629 | 646 | ||
630 | movzx eax,[tb_replace.length] |
647 | movzx eax,[tb_replace.length] |
631 | mov esi,tb_replace.text |
648 | mov esi,tb_replace.text |
632 | mov edi,[copy_buf] |
649 | mov edi,[copy_buf] |
633 | stosd |
650 | stosd |
634 | mov ecx,eax |
651 | mov ecx,eax |
635 | jecxz .lp1 |
652 | jecxz .lp1 |
636 | rep movsb |
653 | rep movsb |
637 | .lp1: add eax,4 |
654 | .lp1: add eax,4 |
638 | mov [copy_size],eax |
655 | mov [copy_size],eax |
639 | mov [copy_count],1 |
656 | mov [copy_count],1 |
640 | 657 | ||
641 | push [cur_editor.SelStart.X] |
658 | push [cur_editor.SelStart.X] |
642 | mov ebp,cur_editor |
659 | mov ebp,cur_editor |
643 | call init_sel_vars |
660 | call init_sel_vars |
644 | call key.ctrl_v |
661 | call key.ctrl_v |
645 | pop [cur_editor.SelStart.X] |
662 | pop [cur_editor.SelStart.X] |
646 | 663 | ||
647 | mov eax,[copy_buf] |
664 | mov eax,[copy_buf] |
648 | call mem.Free |
665 | call mem.Free |
649 | 666 | ||
650 | pop [copy_buf] [copy_count] [copy_size] |
667 | pop [copy_buf] [copy_count] [copy_size] |
651 | 668 | ||
652 | call editor_check_for_changes |
669 | call editor_check_for_changes |
653 | ret |
670 | ret |
654 | @@: xor eax,eax |
671 | @@: xor eax,eax |
655 | mov [bot_mode],al |
672 | mov [bot_mode],al |
656 | mov [bot_dlg_height],eax |
673 | mov [bot_dlg_height],eax |
657 | call key.f3 |
674 | call key.f3 |
658 | call drawwindow |
675 | call drawwindow |
659 | ret |
676 | ret |
660 | 677 | ||
661 | btn.bot.appearance: |
678 | btn.bot.appearance: |
662 | @@: xor eax,eax |
679 | @@: xor eax,eax |
663 | mov [bot_mode],al |
680 | mov [bot_mode],al |
664 | mov [bot_dlg_height],eax |
681 | mov [bot_dlg_height],eax |
665 | call optsdlg_handler.xchg_colors |
682 | call optsdlg_handler.xchg_colors |
666 | mov al,[tab_pos] |
683 | mov al,[tab_pos] |
667 | mov [tab_bar.Style],al |
684 | mov [tab_bar.Style],al |
668 | call drawwindow |
685 | call drawwindow |
669 | ret |
686 | ret |
670 | 687 | ||
671 | tabpos_round db 4,3,1,2 |
688 | tabpos_round db 4,3,1,2 |
672 | 689 | ||
673 | btn.bot.tabpos: |
690 | btn.bot.tabpos: |
674 | movzx eax,[tab_pos] |
691 | movzx eax,[tab_pos] |
675 | mov al,[tabpos_round+eax-1] |
692 | mov al,[tabpos_round+eax-1] |
676 | mov [tab_pos],al |
693 | mov [tab_pos],al |
677 | @@: call optsdlg_handler.draw_tabpos |
694 | @@: call optsdlg_handler.draw_tabpos |
678 | ret250,30>200,30>2+3+165,2+3+165> |
695 | ret250,30>200,30>2+3+165,2+3+165> |