Rev 1343 | Rev 1456 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1343 | Rev 1449 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | mouse_wnd_main: |
1 | proc mouse_wnd_main, edit:dword |
2 | push eax ebx ecx |
2 | push eax ebx ecx edi |
3 | mcall 37,2 ;get mouse buttons |
3 | mcall 37,2 ;get mouse buttons |
Line -... | Line 4... | ||
- | 4 | ||
- | 5 | mov edi,dword[edit] |
|
4 | 6 | ||
5 | cmp al,1 |
7 | cmp al,1 |
6 | jne @f |
8 | jne @f |
7 | mcall 37,1 ;get mouse coords |
9 | mcall 37,1 ;get mouse coords |
8 | mov ebx,[wndMain.top] |
10 | mov ebx,ted_wnd_t |
9 | add ebx,[recMain.top] |
11 | add ebx,ted_rec_t |
10 | cmp ax,bx |
12 | cmp ax,bx |
Line 11... | Line 13... | ||
11 | jl @f ;y_mouse |
13 | jl @f ;y_mouse |
12 | 14 | ||
13 | sub ebx,[recMain.top] |
15 | sub ebx,ted_rec_t |
14 | add ebx,[wndMain.height] |
16 | add ebx,ted_wnd_h |
Line 15... | Line 17... | ||
15 | cmp bx,ax |
17 | cmp bx,ax |
16 | jl @f ;y_mouse>y_wnd |
18 | jl @f ;y_mouse>y_wnd |
17 | 19 | ||
18 | mov ebx,[wndMain.left] |
20 | mov ebx,ted_wnd_l |
19 | add ebx,[recMain.left] |
21 | add ebx,ted_rec_l |
20 | mov ecx,eax |
22 | mov ecx,eax |
Line 21... | Line 23... | ||
21 | shr ecx,16 |
23 | shr ecx,16 |
22 | cmp cx,bx |
24 | cmp cx,bx |
23 | jl @f ;x_mouse |
25 | jl @f ;x_mouse |
24 | 26 | ||
Line 25... | Line 27... | ||
25 | sub ebx,[recMain.left] |
27 | sub ebx,ted_rec_l |
26 | add ebx,[wndMain.width] |
28 | add ebx,ted_wnd_w |
27 | cmp bx,cx |
- | |
28 | jl @f ;x_mouse>x_wnd |
29 | cmp bx,cx |
29 | 30 | jl @f ;x_mouse>x_wnd |
|
30 | call draw_cursor_sumb |
31 | |
31 | call wnd_main_click |
32 | stdcall draw_cursor_sumb, tedit0 |
32 | ;call draw_main_cursor ;??? |
33 | call wnd_main_click |
33 | jmp .no_in_wnd |
34 | jmp .no_in_wnd |
34 | @@: |
35 | @@: |
35 | call wnd_main_mouse_scroll |
36 | call wnd_main_mouse_scroll |
36 | cmp [dragm],0 |
37 | cmp ted_drag_m,0 |
37 | je .no_in_wnd |
38 | je .no_in_wnd |
38 | mov [dragm],0 |
39 | mov ted_drag_m,0 |
- | 40 | call draw_but_toolbar |
|
Line 39... | Line 41... | ||
39 | call draw_but_toolbar |
41 | stdcall draw_main_win, tedit0 |
40 | call draw_main_win |
42 | .no_in_wnd: |
- | 43 | pop edi ecx ebx eax |
|
- | 44 | ret |
|
- | 45 | endp |
|
41 | .no_in_wnd: |
46 | |
42 | pop ecx ebx eax |
47 | ;input: |
Line 43... | Line 48... | ||
43 | ret |
48 | ; eax -> (x,y) |
44 | 49 | ; edi -> óêàçàòåëü íà ñòðóêòóðó tedit |
|
45 | ; input: |
50 | ;description: |
46 | ; eax->(x,y) |
51 | ; ôóíêöèÿ âûçûâåòñÿ ïðè íàæàòèè êíîïêîé ìûøè è ïîïàäåíèè êóðñîðîì â îêíî ðåäàêòîðà |
47 | wnd_main_click: |
52 | wnd_main_click: |
Line 48... | Line 53... | ||
48 | push ecx edx |
53 | push ecx edx |
49 | 54 | ||
50 | push eax |
55 | push eax |
51 | shr eax,16 |
56 | shr eax,16 |
52 | and eax,0xffff |
57 | and eax,0xffff |
53 | sub eax,[wndMain.left] |
58 | sub eax,ted_wnd_l |
54 | sub eax,[recMain.left] |
59 | sub eax,ted_rec_l |
Line 65... | Line 70... | ||
65 | mov [cur_x],eax |
70 | mov [cur_x],eax |
66 | pop eax |
71 | pop eax |
Line 67... | Line 72... | ||
67 | 72 | ||
68 | push eax |
73 | push eax |
69 | and eax,0xffff |
74 | and eax,0xffff |
70 | sub eax,[wndMain.top] |
75 | sub eax,ted_wnd_t |
Line 71... | Line 76... | ||
71 | sub eax,[recMain.top] |
76 | sub eax,ted_rec_t |
72 | 77 | ||
73 | xor edx,edx |
78 | xor edx,edx |
74 | mov ecx,[recMain.height] |
79 | mov ecx,ted_rec_h |
75 | div cx |
80 | div cx |
76 | inc eax |
81 | inc eax |
77 | cmp eax,[wScr.cur_area] |
82 | cmp eax,[wScr.cur_area] |
78 | jle @f |
83 | jle @f |
79 | mov eax,[wScr.cur_area] |
84 | mov eax,[wScr.cur_area] |
80 | @@: |
85 | @@: |
81 | dec eax |
86 | dec eax |
Line 82... | Line 87... | ||
82 | mov [cur_y],eax |
87 | mov [cur_y],eax |
83 | pop eax |
88 | pop eax |
84 | 89 | ||
85 | cmp [dragm],0 |
90 | cmp ted_drag_m,0 |
86 | je @f |
91 | je @f |
87 | call SelMove |
92 | call SelMove |
88 | jmp .sel_move |
93 | jmp .sel_move |
89 | @@: |
94 | @@: |
90 | mov [dragm],1 |
95 | mov ted_drag_m,1 |
91 | call SelStart |
96 | call SelStart |
Line 110... | Line 115... | ||
110 | cmp eax,[wScr.max_area] |
115 | cmp eax,[wScr.max_area] |
111 | jb @f |
116 | jb @f |
112 | mov dword[wScr.position],ebx ;if scroll position out of range |
117 | mov dword[wScr.position],ebx ;if scroll position out of range |
113 | jmp .no_scroll |
118 | jmp .no_scroll |
114 | @@: |
119 | @@: |
115 | call draw_main_win |
120 | stdcall draw_main_win, tedit0 |
116 | .no_scroll: |
121 | .no_scroll: |
117 | pop ebx eax |
122 | pop ebx eax |
118 | ret |
123 | ret |
Line 119... | Line 124... | ||
119 | 124 | ||
Line 143... | Line 148... | ||
143 | 148 | ||
144 | inc cx |
149 | inc cx |
145 | mov edx,85*65536+25 |
150 | mov edx,85*65536+25 |
Line 146... | Line 151... | ||
146 | call draw_but_icon |
151 | call draw_but_icon |
147 | 152 | ||
148 | call IsSel |
153 | stdcall IsSel, tedit0 |
149 | cmp al,0 |
154 | cmp al,0 |
150 | jne @f |
155 | jne @f |
151 | and ecx,0xffff |
156 | and ecx,0xffff |
Line 224... | Line 229... | ||
224 | call draw_but_icon |
229 | call draw_but_icon |
Line 225... | Line 230... | ||
225 | 230 | ||
226 | pop edx ecx ebx |
231 | pop edx ecx ebx |
Line 227... | Line -... | ||
227 | ret |
- | |
228 | 232 | ret |
|
- | 233 | ||
229 | 234 | ;input: |
|
230 | ;input: |
235 | ; clear_o - åñëè =1 î÷èñòèòü îäíó ñòðîêó, =0 î÷èñòèòü âñå ñòðîêè îêíà äî íèçó |
231 | ; ebx = x*2^16+y coords to left up point clear line |
236 | proc clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword |
232 | ; esi = 0 clear all rows |
237 | pushad |
233 | ; edi - number text line |
238 | mov edi,dword[edit] |
- | 239 | mov ebx,dword[coords] ;ebx = x*2^16+y coords to left up point clear line |
|
234 | clear_line_before_draw: |
240 | mov esi,dword[numb_lin] ;esi - number text line |
235 | push eax ebx ecx edx |
241 | |
236 | sub ebx,0x10001 ;îòíèìàåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó |
242 | sub ebx,0x10001 ;îòíèìàåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó |
237 | cmp esi,0 |
243 | cmp dword[clear_o],0 |
238 | jne @f |
244 | jne @f |
239 | add bx,word[recMain.height] |
245 | add ebx,ted_rec_h |
- | 246 | inc esi |
|
240 | inc edi ; ??? |
247 | ror ebx,16 |
241 | ror ebx,16 |
248 | xor bx,bx |
242 | mov bx,word[wndMain.left] |
249 | add ebx,ted_wnd_l |
243 | add bx,word[recMain.left] |
250 | add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l |
Line 244... | Line 251... | ||
244 | ror ebx,16 |
251 | ror ebx,16 |
245 | @@: |
252 | @@: |
246 | 253 | ||
247 | mov ax,word[wndMain.height] |
254 | mov eax,ted_wnd_h |
248 | add ax,word[wndMain.top] |
255 | add eax,ted_wnd_t |
Line 249... | Line 256... | ||
249 | cmp ax,bx |
256 | cmp ax,bx |
250 | jl .no_clear |
257 | jl .no_clear |
Line -... | Line 258... | ||
- | 258 | sub ax,bx |
|
251 | sub ax,bx |
259 | |
252 | 260 | mov cx,bx |
|
- | 261 | shl ecx,16 |
|
253 | mov cx,bx |
262 | |
254 | shl ecx,16 |
263 | xor bx,bx |
Line 255... | Line 264... | ||
255 | 264 | add ebx,ted_wnd_w |
|
256 | mov bx,word[wndMain.width] |
265 | sub ebx,ted_rec_l |
257 | sub bx,word[recMain.left] |
266 | xor cx,cx |
258 | mov cx,word[recMain.height] |
267 | add ecx,ted_rec_h |
259 | mov edx,[WND_WORK_COLOR] |
268 | mov edx,[WND_WORK_COLOR] |
260 | 269 | ||
261 | cmp esi,0 |
270 | cmp dword[clear_o],0 |
Line 262... | Line 271... | ||
262 | je .pusto |
271 | je .pusto |
263 | cmp ax,cx |
272 | cmp ax,cx |
264 | jge @f |
273 | jge @f |
265 | .pusto: |
274 | .pusto: |
266 | mov cx,ax |
275 | mov cx,ax |
267 | @@: |
276 | @@: |
268 | 277 | ||
269 | call IsSel |
278 | stdcall IsSel,edi |
270 | cmp al,0 |
279 | cmp al,0 |
Line 271... | Line 280... | ||
271 | je @f |
280 | je @f |
272 | cmp [seln.y0],edi |
281 | cmp [seln.y0],esi |
Line 273... | Line 282... | ||
273 | jg @f |
282 | jg @f |
274 | cmp [seln.y1],edi |
283 | cmp [seln.y1],esi |
275 | jl @f |
284 | jl @f |
Line 276... | Line 285... | ||
276 | mov edx,[SELECT_COLOR] ;draw selected line |
285 | mov edx,[SELECT_COLOR] ;draw selected line |
- | 286 | @@: |
|
277 | @@: |
287 | |
278 | 288 | mov eax,13 ;rect |
|
279 | mov eax,13 ;rect |
289 | int 0x40 |
280 | int 0x40 |
290 | |
281 | 291 | stdcall IsSel,edi |
|
282 | call IsSel |
292 | cmp al,0 |
283 | cmp al,0 |
293 | je .no_clear |
284 | je .no_clear |
294 | |
285 | 295 | mov al,13 ;rect |
|
286 | mov al,13 ;rect |
296 | xor cx,cx |
287 | mov cx,word[recMain.height] |
297 | add ecx,ted_rec_h |
288 | cmp [seln.y0],edi |
298 | cmp [seln.y0],esi |
289 | jne @f |
299 | jne @f |
290 | push bx |
300 | push bx |
291 | mov edx,[seln.x0] ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà) |
301 | mov edx,[seln.x0] ; âåðõíÿÿ ïîëîñà (çàòèðàåò ñëåâà) |
292 | cmp edx,[hScr.position] |
302 | cmp edx,[hScr.position] |
293 | jle .in_wnd |
303 | jle .in_wnd |
294 | sub edx,[hScr.position] |
304 | sub edx,[hScr.position] |
295 | imul edx,[recMain.width] |
305 | imul edx,ted_rec_w |
296 | mov bx,dx |
306 | mov bx,dx |
297 | jmp .no_wnd |
307 | jmp .no_wnd |
298 | .in_wnd: |
308 | .in_wnd: |
299 | mov bx,0 |
309 | mov bx,0 |
300 | .no_wnd: |
310 | .no_wnd: |
301 | mov edx,[WND_WORK_COLOR] |
311 | mov edx,[WND_WORK_COLOR] |
302 | int 0x40 |
312 | int 0x40 |
303 | pop bx |
313 | pop bx |
304 | @@: |
314 | @@: |
305 | cmp [seln.y1],edi |
315 | cmp [seln.y1],esi |
Line 306... | Line 316... | ||
306 | jne @f |
316 | jne @f |
307 | mov edx,[seln.x1] ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà) |
317 | mov edx,[seln.x1] ; íèæíÿÿ ïîëîñà (çàòèðàåò ñïðàâà) |
308 | cmp edx,[hScr.position] |
318 | cmp edx,[hScr.position] |
Line 309... | Line 319... | ||
309 | jle .in_wnd2 |
319 | jle .in_wnd2 |
310 | sub edx,[hScr.position] |
320 | sub edx,[hScr.position] |
311 | imul edx,[recMain.width] |
321 | imul edx,ted_rec_w |
- | 322 | sub bx,dx |
|
Line 312... | Line -... | ||
312 | sub bx,dx |
- | |
- | 323 | shl edx,16 |
|
313 | shl edx,16 |
324 | add ebx,edx |
314 | add ebx,edx |
- | |
315 | .in_wnd2: |
- | |
316 | 325 | .in_wnd2: |
|
317 | mov edx,[WND_WORK_COLOR] |
- | |
318 | int 0x40 |
326 | |
319 | @@: |
- | |
320 | - | ||
321 | .no_clear: |
327 | mov edx,[WND_WORK_COLOR] |
322 | pop edx ecx ebx eax |
328 | int 0x40 |
323 | ret |
- | |
324 | - | ||
325 | ;include 't_debug.inc' |
329 | @@: |
Line 326... | Line 330... | ||
326 | draw_main_win: |
330 | |
327 | push eax ebx ecx edx edi esi |
- | |
328 | ;---debug--- |
331 | .no_clear: |
329 | ;mov ecx,0 |
332 | popad |
330 | ;@@: |
333 | ret |
Line 331... | Line 334... | ||
331 | ;call DebugSymb |
334 | endp |
332 | ;inc ecx |
335 | |
333 | ;cmp ecx,10 |
- | |
334 | ;jge @f |
336 | |
335 | ;jmp @b |
337 | proc draw_main_win, edit:dword |
336 | ;@@: |
338 | locals |
337 | ;ret |
- | |
- | 339 | line_num dd ? |
|
Line 338... | Line 340... | ||
338 | ;---debug--- |
340 | endl |
339 | 341 | pushad |
|
- | 342 | mov edi,dword[edit] |
|
Line 340... | Line 343... | ||
340 | mov eax,4 ;draw text |
343 | |
341 | mov esi,1 |
344 | mov eax,4 ;draw text |
342 | mov ecx,[tex_colors] |
345 | mov ecx,[tex_colors] |
343 | push dword[ecx] |
346 | push dword[ecx] |
- | 347 | pop ecx |
|
344 | pop ecx |
348 | |
345 | 349 | mov ebx,ted_wnd_l |
|
346 | mov ebx,[wndMain.left] |
350 | add ebx,ted_rec_l |
347 | add ebx,[recMain.left] |
351 | shl ebx,16 |
Line 348... | Line -... | ||
348 | inc ebx |
- | |
349 | shl ebx,16 |
- | |
350 | add ebx,[wndMain.top] |
- | |
351 | add ebx,[recMain.top] |
- | |
352 | inc ebx |
- | |
353 | 352 | add ebx,ted_wnd_t |
|
354 | call SelNormalize ;need before draw select |
353 | add ebx,ted_rec_t |
355 | mov edi,[wScr.position] |
354 | add ebx,0x10001 ;äîáàâëÿåì îòñòóïû äëÿ âûðàâíèâàíèÿ áóêâû ïî öåíòðó |
356 | 355 | ||
357 | call clear_line_before_draw |
356 | call SelNormalize ;need before draw select |
Line 383... | Line 382... | ||
383 | push edx |
382 | push edx |
384 | mov edx,symbol_new_line |
383 | mov edx,symbol_new_line |
385 | int 0x40 |
384 | int 0x40 |
386 | pop edx |
385 | pop edx |
387 | .no_invis: |
386 | .no_invis: |
388 | add bx,word [recMain.height] |
387 | add ebx,ted_rec_h |
389 | ;optimized output \/ |
388 | ;optimized output \/ |
390 | mov ax,word [wndMain.height] |
389 | mov eax,ted_wnd_h |
391 | add ax,word [wndMain.top] |
390 | add eax,ted_wnd_t |
392 | cmp bx,ax |
391 | cmp bx,ax |
393 | jg .no_draw_text |
392 | jg .no_draw_text |
394 | mov ax,4 |
393 | mov eax,4 |
395 | ;optimized output /\ |
394 | ;optimized output /\ |
- | 395 | and ebx,0xffff |
|
396 | ror ebx,16 |
396 | ror ebx,16 |
397 | mov bx,word [wndMain.left] |
397 | add ebx,ted_wnd_l |
398 | add bx,word [recMain.left] |
398 | add ebx,ted_rec_l |
399 | inc ebx |
399 | inc ebx |
400 | ror ebx,16 |
400 | ror ebx,16 |
401 | inc edi ;increment line number |
401 | inc dword[line_num] ;increment line number |
402 | call clear_line_before_draw |
402 | stdcall clear_line_before_draw, tedit0,ebx,1,dword[line_num] |
403 | call OptDrawLineLeft |
403 | call OptDrawLineLeft |
404 | jmp @b |
404 | jmp @b |
405 | .no_13: |
405 | .no_13: |
Line 406... | Line 406... | ||
406 | 406 | ||
407 | int 0x40 |
407 | int 0x40 |
408 | ror ebx,16 |
408 | ror ebx,16 |
409 | add bx,word [recMain.width] |
409 | add ebx,ted_rec_w |
410 | mov si,word [wndMain.left] |
410 | mov esi,ted_wnd_l |
411 | add si,word [wndMain.width] |
411 | add esi,ted_wnd_w |
412 | cmp bx,si |
412 | cmp bx,si |
413 | jl .no_opt |
413 | jl .no_opt |
414 | call OptDrawLineRight |
414 | call OptDrawLineRight |
415 | .no_opt: |
415 | .no_opt: |
416 | mov si,1 |
416 | mov si,1 |
417 | ror ebx,16 |
417 | ror ebx,16 |
418 | jmp @b |
418 | jmp @b |
419 | .no_draw_text: |
- | |
420 | xor esi,esi |
- | |
421 | call clear_line_before_draw |
- | |
Line 422... | Line -... | ||
422 | - | ||
423 | - | ||
424 | mov eax,13 |
- | |
425 | ;top panel with caption |
- | |
426 | mov ebx,[wndMain.left] |
- | |
427 | ; add ebx,[recMain.left] |
- | |
428 | shl ebx,16 |
- | |
429 | add ebx,[wndMain.width] |
- | |
430 | ; sub ebx,[recMain.left] |
419 | .no_draw_text: |
431 | mov edx,[WND_WORK_COLOR] |
- | |
432 | mov ecx,[wndMain.top] ;draw caption |
- | |
433 | shl ecx,16 |
- | |
434 | add ecx,[recMain.top] |
- | |
435 | mov edx,[WND_CAPT_COLOR] |
- | |
436 | int 0x40 |
- | |
437 | ;left panel with numbers |
- | |
438 | ; mov ebx,[wndMain.left] |
- | |
439 | ; shl ebx,16 |
- | |
440 | ; add ebx,[recMain.left] |
- | |
441 | ;mov cx,word[wndMain.height] |
- | |
442 | ; mov cx,word[recMain.top] |
- | |
443 | ; int 0x40 |
420 | |
444 | 421 | stdcall clear_line_before_draw, tedit0,ebx,0,dword[line_num] |
|
Line 445... | Line 422... | ||
445 | call draw_line_numbers |
422 | stdcall draw_line_numbers, tedit0 |
446 | call draw_main_cursor |
423 | stdcall draw_main_cursor, tedit0 |
447 | 424 | ||
448 | ;--------------------------------------------- |
425 | ;--------------------------------------------- |
Line 454... | Line 431... | ||
454 | inc eax |
431 | inc eax |
455 | mov [wScr.all_redraw],eax |
432 | mov [wScr.all_redraw],eax |
456 | mov [hScr.all_redraw],eax |
433 | mov [hScr.all_redraw],eax |
Line 457... | Line 434... | ||
457 | 434 | ||
458 | ; draw for Vertical ScrollBar |
- | |
459 | push dword wScr |
435 | ; draw for Vertical ScrollBar |
460 | call [scrollbar_ver_draw] |
- | |
461 | push dword hScr |
436 | stdcall [scrollbar_ver_draw], dword wScr |
462 | call [scrollbar_hor_draw] |
437 | stdcall [scrollbar_hor_draw], dword hScr |
463 | ; reset all_redraw flag |
438 | ; reset all_redraw flag |
464 | xor eax,eax |
439 | xor eax,eax |
465 | mov [wScr.all_redraw],eax |
440 | mov [wScr.all_redraw],eax |
466 | mov [hScr.all_redraw],eax |
441 | mov [hScr.all_redraw],eax |
Line 467... | Line 442... | ||
467 | ;--------------------------------------------- |
442 | ;--------------------------------------------- |
468 | 443 | ||
469 | mov eax,13 |
444 | mov eax,13 |
470 | ;left-bottom square |
445 | ;left-bottom square |
471 | mov bx,word[wndMain.left] |
446 | mov ebx,ted_wnd_l |
472 | shl ebx,16 |
447 | shl ebx,16 |
473 | mov bx,word[recMain.left] |
448 | add ebx,ted_rec_l |
474 | mov ecx,[wndMain.top] |
449 | mov ecx,ted_wnd_t |
475 | add ecx,[wndMain.height] |
450 | add ecx,ted_wnd_h |
476 | shl ecx,16 |
451 | shl ecx,16 |
477 | mov cx,word[hScr.size_y] |
452 | mov cx,word[hScr.size_y] |
478 | inc cx |
453 | inc cx |
Line 479... | Line 454... | ||
479 | mov edx,[sc.work] |
454 | mov edx,[sc.work] |
480 | int 0x40 |
455 | int 0x40 |
481 | 456 | ||
482 | ;right-bottom square |
457 | ;right-bottom square |
483 | mov ebx,[wndMain.left] |
458 | mov ebx,ted_wnd_l |
484 | add ebx,[wndMain.width] |
459 | add ebx,ted_wnd_w |
485 | shl ebx,16 |
460 | shl ebx,16 |
Line 486... | Line -... | ||
486 | mov bx,word[wScr.size_x] |
- | |
487 | inc bx |
461 | mov bx,word[wScr.size_x] |
488 | int 0x40 |
462 | inc bx |
- | 463 | int 0x40 |
|
489 | 464 | ||
- | 465 | stdcall draw_panel_find, edi |
|
Line 490... | Line 466... | ||
490 | pop esi edi edx ecx ebx eax |
466 | stdcall draw_panel_syntax, edi |
491 | call draw_panel_find |
467 | popad |
492 | call draw_panel_syntax |
468 | ret |
493 | ret |
469 | endp |
494 | 470 | ||
- | 471 | ;txtBUp db 24 |
|
- | 472 | ;txtBDn db 25 |
|
- | 473 | ;txtBRi db 26 |
|
495 | ;txtBUp db 24 |
474 | ;txtBLe db 27 |
496 | ;txtBDn db 25 |
475 | proc draw_panel_find, edit:dword |
497 | ;txtBRi db 26 |
476 | push edi |
Line 498... | Line 477... | ||
498 | ;txtBLe db 27 |
477 | mov edi,dword[edit] |
499 | draw_panel_find: |
478 | |
500 | cmp byte[panel_id],TE_PANEL_FIND ;if not panel |
479 | cmp byte[panel_id],TE_PANEL_FIND ;if not panel |
501 | jne @f |
480 | jne @f |
502 | push eax ebx ecx edx |
481 | push eax ebx ecx edx |
503 | 482 | ||
504 | mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà |
483 | mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà |
Line 505... | Line 484... | ||
505 | mov ebx,TE_PANEL_WIDTH |
484 | mov ebx,TE_PANEL_WIDTH |
506 | mov cx,word[wndMain.top] |
485 | mov ecx,ted_wnd_t |
507 | shl ecx,16 |
486 | shl ecx,16 |
508 | mov cx,20 |
487 | mov cx,20 |
509 | mov edx,[sc.work] |
488 | mov edx,[sc.work] |
510 | int 0x40 |
489 | int 0x40 |
511 | 490 | ||
Line 512... | Line 491... | ||
512 | mov eax,4 ;ðèñîâàíèå òåêñòà |
491 | mov eax,4 ;ðèñîâàíèå òåêñòà |
513 | mov ebx,30*65536+5 |
492 | mov ebx,30*65536+5 |
Line 514... | Line 493... | ||
514 | add bx,word[wndMain.top] |
493 | add ebx,ted_wnd_t |
515 | mov ecx,[sc.work_text] |
494 | mov ecx,[sc.work_text] |
516 | or ecx,0x80000000 |
495 | or ecx,0x80000000 |
517 | mov edx,txtFindCapt |
496 | mov edx,txtFindCapt |
518 | int 0x40 |
497 | int 0x40 |
519 | 498 | ||
520 | push dword edit2 |
499 | push dword edit2 |
521 | call [edit_box_draw] |
500 | call [edit_box_draw] |
522 | 501 | ||
523 | mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà |
502 | mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà |
Line 524... | Line 503... | ||
524 | mov ebx,TE_PANEL_WIDTH |
503 | mov ebx,TE_PANEL_WIDTH |
525 | mov cx,word[wndMain.top] |
504 | mov ecx,ted_wnd_t |
526 | add cx,20+15 ; 15 - height text box |
505 | add cx,20+15 ; 15 - height text box |
527 | shl ecx,16 |
506 | shl ecx,16 |
528 | mov cx,word[wndMain.height] |
507 | add ecx,ted_wnd_h |
529 | add cx,word[hScr.size_y] |
508 | add cx,word[hScr.size_y] |
530 | sub cx,20+15-1 ; 15 - height text box |
509 | sub cx,20+15-1 ; 15 - height text box |
531 | mov edx,[sc.work] |
510 | mov edx,[sc.work] |
532 | int 0x40 |
511 | int 0x40 |
Line 533... | Line 512... | ||
533 | 512 | ||
534 | mov eax,8 ;êíîïêà |
513 | mov eax,8 ;êíîïêà |
535 | mov ebx,5*65536+85 |
514 | mov ebx,5*65536+85 |
536 | mov cx,word[wndMain.top] |
515 | mov ecx,ted_wnd_t |
537 | add cx,20+15+5 |
516 | add cx,20+15+5 |
538 | shl ecx,16 |
517 | shl ecx,16 |
539 | mov cx,20 |
518 | mov cx,20 |
Line 540... | Line 519... | ||
540 | mov edx,201 ;button id |
519 | mov edx,201 ;button id |
541 | mov esi,[sc.work_button] |
520 | mov esi,[sc.work_button] |
542 | int 0x40 |
521 | int 0x40 |
543 | 522 | ||
544 | mov eax,4 ;ðèñîâàíèå òåêñòà |
523 | mov eax,4 ;ðèñîâàíèå òåêñòà |
545 | mov ebx,15*65536+(20+15+10) |
524 | mov ebx,15*65536+(20+15+10) |
546 | add bx,word[wndMain.top] |
525 | add ebx,ted_wnd_t |
547 | mov ecx,[sc.work_text] |
526 | mov ecx,[sc.work_text] |
548 | or ecx,0x80000000 |
527 | or ecx,0x80000000 |
- | 528 | mov edx,txtFindNext |
|
- | 529 | int 0x40 |
|
549 | mov edx,txtFindNext |
530 | |
- | 531 | pop edx ecx ebx eax |
|
- | 532 | jmp .end_f |
|
- | 533 | @@: |
|
- | 534 | push eax edx |
|
- | 535 | mov eax,8 |
|
Line 550... | Line -... | ||
550 | int 0x40 |
- | |
551 | 536 | mov edx,201 |
|
552 | pop edx ecx ebx eax |
537 | or edx,0x80000000 |
553 | ret |
538 | int 0x40 |
Line 554... | Line 539... | ||
554 | @@: |
539 | pop edx eax |
555 | push eax edx |
540 | .end_f: |
556 | mov eax,8 |
541 | pop edi |
557 | mov edx,201 |
542 | ret |
558 | or edx,0x80000000 |
543 | endp |
559 | int 0x40 |
544 | |
560 | pop edx eax |
545 | proc draw_panel_syntax, edit:dword |
Line 561... | Line -... | ||
561 | ret |
- | |
562 | 546 | push edi |
|
563 | draw_panel_syntax: |
- | |
564 | cmp byte[panel_id],TE_PANEL_SYNTAX ;if not panel |
547 | mov edi,dword[edit] |
565 | jne @f |
- | |
566 | push eax ebx ecx edx |
548 | |
Line 567... | Line 549... | ||
567 | 549 | cmp byte[panel_id],TE_PANEL_SYNTAX ;if not panel |
|
568 | mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà |
550 | jne @f |
569 | mov ebx,TE_PANEL_WIDTH |
551 | push eax ebx ecx edx |
- | 552 | ||
570 | mov cx,word[wndMain.top] |
553 | mov eax,13 ;ðèñîâàíèå ïðÿìîóãîëüíèêà |
571 | shl ecx,16 |
554 | mov ebx,TE_PANEL_WIDTH |
572 | mov cx,20 |
555 | mov ecx,ted_wnd_t |
573 | mov edx,[sc.work] |
556 | shl ecx,16 |
574 | int 0x40 |
557 | mov cx,20 |
575 | 558 | mov edx,[sc.work] |
|
576 | push dword tree1 |
559 | int 0x40 ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà |
Line 577... | Line 560... | ||
577 | call dword[tl_draw] |
560 | |
578 | 561 | stdcall dword[tl_draw], dword tree1 |
|
579 | mov [ws_dir_lbox.all_redraw],1 |
562 | mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà |
580 | push dword ws_dir_lbox |
563 | stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox |
581 | call dword[scrollbar_ver_draw] |
564 | |
582 | 565 | ror ecx,16 |
|
583 | ror ecx,16 |
566 | add ecx,dword[tree1.box_height] |
584 | add ecx,dword[tree1.box_height] |
567 | add ecx,20 |
585 | add ecx,20 |
568 | and ecx,0xffff |
586 | ror ecx,16 |
569 | ror ecx,16 |
Line 587... | Line 570... | ||
587 | mov cx,word[wndMain.height] |
570 | add ecx,ted_wnd_h |
588 | add cx,word[hScr.size_y] |
571 | add cx,word[hScr.size_y] |
589 | sub cx,20 |
572 | sub cx,20 |
590 | sub ecx,dword[tree1.box_height] |
573 | sub ecx,dword[tree1.box_height] |
591 | inc cx |
574 | inc cx |
592 | int 0x40 |
575 | int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà |
593 | 576 | ||
Line 594... | Line 577... | ||
594 | mov eax,8 ;êíîïêà |
577 | mov eax,8 ;êíîïêà |
595 | mov ebx,5*65536+65 |
578 | mov ebx,5*65536+65 |
596 | mov cx,word[wndMain.top] |
579 | mov ecx,ted_wnd_t |
597 | add cx,25 |
580 | add ecx,25 |
598 | add ecx,dword[tree1.box_height] |
581 | add ecx,dword[tree1.box_height] |
Line 599... | Line 582... | ||
599 | shl ecx,16 |
582 | shl ecx,16 |
600 | mov cx,20 |
583 | mov cx,20 |
601 | mov edx,200 ;button id |
584 | mov edx,200 ;button id |
602 | mov esi,[sc.work_button] |
585 | mov esi,[sc.work_button] |
603 | int 0x40 |
586 | int 0x40 |
604 | 587 | ||
605 | mov eax,4 ;ðèñîâàíèå òåêñòà |
588 | mov eax,4 ;ðèñîâàíèå òåêñòà |
606 | mov ebx,30*65536+5 |
589 | mov ebx,30*65536+5 |
607 | add bx,word[wndMain.top] |
590 | add ebx,ted_wnd_t |
- | 591 | mov ecx,[sc.work_text] |
|
- | 592 | or ecx,0x80000000 |
|
608 | mov ecx,[sc.work_text] |
593 | mov edx,txtFormatCapt |
- | 594 | int 0x40 |
|
Line 609... | Line 595... | ||
609 | or ecx,0x80000000 |
595 | |
- | 596 | mov ebx,10*65536+30 |
|
610 | mov edx,txtFormatCapt |
597 | add ebx,dword[tree1.box_height] |
Line 611... | Line -... | ||
611 | int 0x40 |
- | |
612 | - | ||
613 | mov ebx,10*65536+30 |
598 | add ebx,ted_wnd_t |
614 | add ebx,dword[tree1.box_height] |
599 | mov edx,txtFormatApply |
615 | add bx,word[wndMain.top] |
- | |
616 | mov edx,txtFormatApply |
600 | int 0x40 |
617 | int 0x40 |
601 | |
618 | 602 | pop edx ecx ebx eax |
|
619 | pop edx ecx ebx eax |
603 | jmp .end_f |
620 | ret |
604 | @@: |
621 | @@: |
- | |
- | 605 | push eax edx |
|
- | 606 | mov eax,8 |
|
Line 622... | Line -... | ||
622 | push eax edx |
- | |
623 | mov eax,8 |
- | |
624 | mov edx,200 |
607 | mov edx,200 |
- | 608 | or edx,0x80000000 |
|
- | 609 | int 0x40 ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó |
|
625 | or edx,0x80000000 |
610 | pop edx eax |
Line 626... | Line 611... | ||
626 | int 0x40 |
611 | .end_f: |
627 | pop edx eax |
- | |
628 | ret |
612 | pop edi |
Line 629... | Line 613... | ||
629 | 613 | ret |
|
630 | draw_cur_line: |
614 | endp |
631 | push eax ebx ecx edx esi edi |
615 | |
Line 681... | Line 665... | ||
681 | jmp .no_draw_text |
665 | jmp .no_draw_text |
682 | .no_13: |
666 | .no_13: |
Line 683... | Line 667... | ||
683 | 667 | ||
684 | int 0x40 |
668 | int 0x40 |
685 | ror ebx,16 |
669 | ror ebx,16 |
686 | add bx,word[recMain.width] |
- | |
687 | ; cmp bx,word[wndMain.width] |
670 | add ebx,ted_rec_w |
688 | mov ax,word[wndMain.width] |
671 | mov eax,ted_wnd_w |
689 | add ax,word[wndMain.left] ;ax = îòñòóï ïî îñè x |
672 | add eax,ted_wnd_l ;ax = îòñòóï ïî îñè x |
690 | cmp bx,ax |
673 | cmp bx,ax |
691 | jge .no_draw_text ;Opt |
674 | jge .no_draw_text ;Opt |
692 | ror ebx,16 |
675 | ror ebx,16 |
693 | call IteratNext |
676 | call IteratNext |
694 | jmp @b |
677 | jmp @b |
Line 695... | Line -... | ||
695 | .no_draw_text: |
- | |
696 | 678 | .no_draw_text: |
|
- | 679 | ||
697 | pop edi esi edx ecx ebx eax |
680 | stdcall draw_main_cursor, tedit0 |
- | 681 | popad |
|
Line 698... | Line 682... | ||
698 | call draw_main_cursor |
682 | ret |
699 | ret |
683 | endp |
700 | 684 | ||
701 | MIN_M_WND_H equ 100 |
685 | MIN_M_WND_H equ 100 |
702 | MIN_W_SCRL_ARE equ 3 |
686 | MIN_W_SCRL_ARE equ 3 |
703 | MIN_H_SCRL_ARE equ 3 |
687 | MIN_H_SCRL_ARE equ 3 |
- | 688 | proc EvSize, edit:dword |
|
- | 689 | push eax ecx edx edi |
|
704 | EvSize: |
690 | mov edi,dword[edit] |
705 | push eax ecx edx edi |
691 | |
706 | m2m [wndMain.width],[procinfo.client_box.width] |
692 | m2m ted_wnd_w,[procinfo.client_box.width] ;ñòàâèì øèðèíó îêíà ðåäàêòîðà ðàâíîé øèðèíå âñåãî îêíà |
707 | mov ax,word[wndMain.left] |
693 | mov eax,ted_wnd_l |
- | 694 | sub ted_wnd_w,eax ;îòíèìàåì îòñòóï ñëåâà |
|
Line 708... | Line 695... | ||
708 | sub word[wndMain.width],ax |
695 | mov eax,[wScr] ;+0 size_x |
709 | mov eax,[wScr] ;+0 size_x |
696 | and eax,0xffff |
710 | sub word[wndMain.width],ax |
697 | sub ted_wnd_w,eax ;îòíèìàåì øèðèíó âåðò. ñêðîëëèíãà |
711 | 698 | ||
712 | m2m [wndMain.height],[procinfo.client_box.height] |
699 | m2m ted_wnd_h,[procinfo.client_box.height] ;ñòàâèì âûñîòó îêíà ðåäàêòîðà ðàâíîé âûñîòå âñåãî îêíà |
Line 713... | Line 700... | ||
713 | cmp [wndMain.height],MIN_M_WND_H |
700 | cmp ted_wnd_h,MIN_M_WND_H |
714 | jg @f |
701 | jg @f |
- | 702 | mov ted_wnd_h,MIN_M_WND_H |
|
715 | mov [wndMain.height],MIN_M_WND_H |
703 | @@: |
716 | @@: |
704 | |
717 | 705 | mov ax,word[hScr.size_y] |
|
718 | mov ax,word[hScr.size_y] |
706 | and eax,0xffff |
719 | sub word[wndMain.height],ax |
707 | sub ted_wnd_h,eax ;îòíèìàåì âûñîòó ãîðèç. ñêðîëëèíãà |
720 | mov eax,[wndMain.height] ;.height = .top+.height |
708 | mov eax,ted_wnd_h ;eax = âûñîòà îêíà - âûñîòà ãîðèç. ñêðîëëèíãà |
721 | mov word[hScr.start_y],ax |
709 | mov word[hScr.start_y],ax ;ïåðåäâèãàåì ãîðèç. ñêðîëëèíã |
722 | mov eax,[wndMain.top] |
710 | mov eax,ted_wnd_t |
- | 711 | sub ted_wnd_h,eax ;îòíèìàåì îòñòóï ñâåðõó |
|
- | 712 | ||
723 | sub word[wndMain.height],ax |
713 | mov eax,ted_wnd_w |
724 | 714 | mov ecx,ted_wnd_l |
|
725 | m2m word[wScr.start_x],word[wndMain.width] |
715 | add eax,ecx |
726 | mov ax,word[wndMain.left] |
716 | mov word[wScr.start_x],ax ;ïåðåäâèãàåì âåðò. ñêðîëëèíã |
727 | add [wScr.start_x],ax |
717 | mov eax,ted_wnd_h |
728 | m2m word[wScr.size_y],word[wndMain.height] |
718 | mov word[wScr.size_y],ax ;çàäàåì âûñîòó âåðò. ñêðîëëèíãà |
729 | 719 | ||
Line 730... | Line 720... | ||
730 | m2m word[hScr.start_x],word[recMain.left] |
720 | add ecx,ted_rec_l ;ecx=ted_wnd_l+ted_rec_l |
731 | add [hScr.start_x],ax ;ax=[wndMain.left] |
721 | mov [hScr.start_x],cx ;ñäâèãàåì ãîðèç. ñêðîëëèíã ïî ðàçìåðó ëåâîãî îòñòóïà äëÿ öèôð |
732 | mov eax,[wndMain.width] |
722 | mov eax,ted_wnd_w |
733 | sub ax,word[recMain.left] |
723 | sub eax,ted_rec_l |
734 | mov word[hScr.size_x],ax |
724 | mov word[hScr.size_x],ax ;çàäàåì øèðèíó ãîðèç. ñêðîëëèíãà |
735 | 725 | ||
736 | mov eax,[wndMain.height] ;calculate lines in page |
726 | mov eax,ted_wnd_h ;calculate lines in page |
737 | sub eax,[recMain.top] |
727 | sub eax,ted_rec_t |
738 | xor edx,edx |
728 | xor edx,edx |
739 | mov ecx,[recMain.height] |
729 | mov ecx,ted_rec_h |
Line 740... | Line 730... | ||
740 | div ecx |
730 | div ecx |
741 | cmp eax,MIN_W_SCRL_ARE |
731 | cmp eax,MIN_W_SCRL_ARE |
742 | jg @f |
732 | jg @f |
743 | mov eax,MIN_W_SCRL_ARE |
733 | mov eax,MIN_W_SCRL_ARE |
744 | @@: |
734 | @@: |
745 | mov [wScr.cur_area],eax |
735 | mov [wScr.cur_area],eax |
746 | 736 | ||
747 | mov eax,[wndMain.width] ;calculate cols in page |
737 | mov eax,ted_wnd_w ;calculate cols in page |
748 | sub eax,[recMain.left] |
738 | sub eax,ted_rec_l |
749 | xor edx,edx |
739 | xor edx,edx |
750 | mov ecx,[recMain.width] |
740 | mov ecx,ted_rec_w |
Line -... | Line 741... | ||
- | 741 | div ecx |
|
751 | div ecx |
742 | cmp eax,MIN_H_SCRL_ARE |
752 | cmp eax,MIN_H_SCRL_ARE |
743 | jg @f |
753 | jg @f |
744 | mov eax,MIN_H_SCRL_ARE |
Line 754... | Line 745... | ||
754 | mov eax,MIN_H_SCRL_ARE |
745 | @@: |
755 | @@: |
746 | dec eax ; ??? |
Line 756... | Line 747... | ||
756 | dec eax ; ??? |
747 | mov [hScr.cur_area],eax |
757 | mov [hScr.cur_area],eax |
748 | |
758 | 749 | mov eax,ted_wnd_t |
|
- | 750 | mov edi,dword tree1 |
|
Line 759... | Line 751... | ||
759 | mov edi,dword tree1 |
751 | mov tl_box_top,eax ;=ted_wnd_t |
760 | m2m tl_box_top,dword[wndMain.top] |
752 | add tl_box_top,20 |
761 | add tl_box_top,20 |
753 | |
762 | 754 | mov dword[edit2.top],eax ;=ted_wnd_t |
|
Line 868... | Line 860... | ||
868 | mov edx,eax ;perv sumbol |
860 | mov edx,eax ;perv sumbol |
869 | pop eax |
861 | pop eax |
870 | call GetSymbColor |
862 | call GetSymbColor |
871 | ret |
863 | ret |
Line 872... | Line 864... | ||
872 | 864 | ||
- | 865 | proc draw_main_cursor, edit:dword |
|
873 | draw_main_cursor: |
866 | pushad |
Line 874... | Line 867... | ||
874 | push eax ebx ecx edx edi esi |
867 | mov edi,dword[edit] |
875 | 868 | ||
876 | mov eax,13 ;draw cursor |
869 | mov eax,13 ;draw cursor |
877 | mov ecx,[wndMain.top] ;calc rect -> y0,y1 |
870 | mov ecx,ted_wnd_t ;calc rect -> y0,y1 |
878 | add ecx,[recMain.top] |
871 | add ecx,ted_rec_t |
879 | mov edx,[cur_y] |
872 | mov edx,[cur_y] |
Line 880... | Line 873... | ||
880 | imul edx,[recMain.height] |
873 | imul edx,ted_rec_h |
881 | add ecx,edx |
874 | add ecx,edx |
882 | 875 | ||
883 | cmp [curMod],1 |
876 | cmp [curMod],1 ;ïðîâåðêà ðåæèìà ðàáîòû êóðñîðà (îáû÷íûé èëè âñòàâêà) |
884 | jne @f |
877 | jne @f |
885 | mov edx,[recMain.height] |
878 | mov edx,ted_rec_h |
886 | inc edx ; 1->1, 3->2, 5->3, ... |
879 | inc edx ;1->1, 3->2, 5->3, ... |
887 | shr edx,1 |
880 | shr edx,1 ;edx = âûñîòà ñòðîêè äåëåííàÿ íà 2 (êîãäà êóðñîð íå ïîëíûé) |
888 | add ecx,edx |
881 | add ecx,edx |
889 | @@: |
882 | @@: |
890 | shl ecx,16 |
883 | shl ecx,16 |
891 | add ecx,[recMain.height] |
884 | add ecx,ted_rec_h |
892 | cmp [curMod],1 |
885 | cmp [curMod],1 |
Line 893... | Line 886... | ||
893 | jne @f |
886 | jne @f |
894 | shr cx,1 |
887 | shr cx,1 ;äåëèì âûñîòó êóðñîðà íà 2 |
895 | @@: |
888 | @@: |
896 | 889 | ||
897 | mov ebx,[wndMain.left] ;calc rect -> x0,x1 |
890 | mov ebx,ted_wnd_l ;calc rect -> x0,x1 |
898 | add ebx,[recMain.left] |
891 | add ebx,ted_rec_l |
899 | mov edx,[cur_x] |
892 | mov edx,[cur_x] |
Line 900... | Line 893... | ||
900 | imul edx,[recMain.width] |
893 | imul edx,ted_rec_w |
901 | add ebx,edx |
894 | add ebx,edx |
Line 902... | Line 895... | ||
902 | shl ebx,16 |
895 | shl ebx,16 |
903 | add ebx,[recMain.width] |
896 | add ebx,ted_rec_w |
904 | 897 | ||
905 | mov edx,[CURSOR_COLOR] |
898 | mov edx,[CURSOR_COLOR] |
Line 913... | Line 906... | ||
913 | ror ecx,16 |
906 | ror ecx,16 |
914 | mov bx,cx |
907 | mov bx,cx |
915 | add ebx,0x10001 |
908 | add ebx,0x10001 |
916 | cmp [curMod],1 |
909 | cmp [curMod],1 |
917 | jne .no_up_tetx |
910 | jne .no_up_tetx |
918 | mov cx,word[recMain.height] |
911 | mov ecx,ted_rec_h |
919 | inc cx ; 1->1, 3->2, 5->3, ... |
912 | inc cx ; 1->1, 3->2, 5->3, ... |
920 | shr cx,1 |
913 | shr cx,1 |
921 | sub bx,cx |
914 | sub bx,cx |
922 | .no_up_tetx: |
915 | .no_up_tetx: |
923 | mov ecx,[CUR_TEXT_COLOR] |
916 | mov ecx,[CUR_TEXT_COLOR] |
924 | call ConvertInvisSymb |
917 | call ConvertInvisSymb |
925 | int 0x40 |
918 | int 0x40 |
926 | @@: |
919 | @@: |
Line 927... | Line -... | ||
927 | - | ||
928 | - | ||
929 | 920 | ||
930 | mov eax,4 |
921 | mov eax,4 |
931 | mov ebx,[wndMain.left] |
922 | mov ebx,ted_wnd_l |
932 | add ebx,[recMain.left] |
923 | add ebx,ted_rec_l |
933 | shl ebx,16 |
924 | shl ebx,16 |
934 | add ebx,[wndMain.top] |
925 | add ebx,ted_wnd_t |
935 | add ebx,3 |
926 | add ebx,3 |
936 | mov ecx,[WND_BORD_COLOR] |
927 | mov ecx,[WND_BORD_COLOR] |
937 | or ecx,0x80000000 |
928 | or ecx,0x80000000 |
938 | mov edx,txtRow |
929 | mov edx,txtRow |
Line 939... | Line 930... | ||
939 | int 0x40 |
930 | int 0x40 ;âûâîä ïîäïèñè 'Ñòðîêà' |
940 | 931 | ||
941 | add ebx,0x500000 |
932 | add ebx,0x500000 |
Line 942... | Line 933... | ||
942 | mov edx,txtCol |
933 | mov edx,txtCol |
943 | int 0x40 |
934 | int 0x40 ;âûâîä ïîäïèñè 'Çíàê' |
944 | 935 | ||
945 | cmp [tim_Undo],0 |
936 | cmp [tim_Undo],0 |
946 | je @f |
937 | je @f |
947 | add ebx,0x500000 |
938 | add ebx,0x500000 |
948 | mov edx,txtOtm |
939 | mov edx,txtOtm |
Line 949... | Line 940... | ||
949 | int 0x40 |
940 | int 0x40 |
950 | sub ebx,0x500000 |
941 | sub ebx,0x500000 |
Line 951... | Line 942... | ||
951 | @@: |
942 | @@: |
952 | 943 | ||
953 | call draw_bufer |
944 | stdcall draw_bufer, edi |
954 | call draw_help_f1 |
- | |
Line 955... | Line 945... | ||
955 | 945 | stdcall draw_help_f1, edi |
|
956 | mov eax,47 ;draw cursor coords |
946 | |
957 | mov esi,[WND_BORD_COLOR] |
947 | mov eax,47 ;draw cursor coords |
958 | or esi,0x40000000 |
948 | mov esi,[WND_BORD_COLOR] |
959 | mov edi,[WND_WORK_COLOR] |
949 | or esi,0x40000000 |
960 | 950 | ||
961 | mov edx,ebx |
951 | mov edx,ebx |
962 | ror edx,16 |
952 | ror edx,16 |
963 | sub edx,35 |
953 | sub edx,35 |
- | 954 | ror edx,16 |
|
- | 955 | ;add edx,3 |
|
964 | ror edx,16 |
956 | mov ebx,0x40000 ;Row=... |
Line 965... | Line 957... | ||
965 | ;add edx,3 |
957 | mov ecx,[cur_y] |
966 | mov ebx,0x40000 ;Row=... |
958 | inc ecx |
967 | mov ecx,[cur_y] |
959 | add ecx,[wScr.position] |
Line 981... | Line 973... | ||
981 | mov ecx,[tim_Undo] |
973 | mov ecx,[tim_Undo] |
982 | add edx,0x500000 |
974 | add edx,0x500000 |
983 | int 0x40 |
975 | int 0x40 |
984 | @@: |
976 | @@: |
Line 985... | Line 977... | ||
985 | 977 | ||
986 | pop esi edi edx ecx ebx eax |
978 | popad |
- | 979 | ret |
|
Line -... | Line 980... | ||
- | 980 | endp |
|
- | 981 | ||
- | 982 | proc draw_bufer, edit:dword |
|
Line 987... | Line -... | ||
987 | ret |
- | |
988 | - | ||
989 | 983 | pushad |
|
990 | draw_bufer: |
984 | mov edi,dword[edit] |
991 | push eax ebx ecx edx esi edi |
985 | |
992 | cmp byte[buf],0 |
986 | cmp byte[buf],0 |
993 | je @f |
987 | je @f |
994 | mov ebx,[wndMain.left] |
988 | mov ebx,ted_wnd_l |
995 | add ebx,[recMain.left] |
989 | add ebx,ted_rec_l |
996 | add bx,250 |
990 | add bx,250 |
997 | shl ebx,16 |
991 | shl ebx,16 |
998 | add ebx,[wndMain.top] |
992 | add ebx,ted_wnd_t |
999 | add ebx,3 |
993 | add ebx,3 |
Line 1020... | Line 1014... | ||
1020 | add esi,eax |
1014 | add esi,eax |
Line 1021... | Line 1015... | ||
1021 | 1015 | ||
1022 | mov eax,4 |
1016 | mov eax,4 |
1023 | int 0x40 |
1017 | int 0x40 |
1024 | @@: |
1018 | @@: |
1025 | pop edi esi edx ecx ebx eax |
1019 | popad |
- | 1020 | ret |
|
- | 1021 | endp |
|
- | 1022 | ||
- | 1023 | proc draw_help_f1, edit:dword |
|
- | 1024 | pushad |
|
Line 1026... | Line -... | ||
1026 | ret |
- | |
1027 | - | ||
1028 | draw_help_f1: |
1025 | mov edi,dword[edit] |
1029 | push eax ebx ecx edx edi |
1026 | |
1030 | mov eax,13 ;clear place before draw help |
1027 | mov eax,13 ;clear place before draw help |
1031 | mov ebx,[wndMain.left] |
1028 | mov ebx,ted_wnd_l |
1032 | add ebx,[recMain.left] |
1029 | add ebx,ted_rec_l |
1033 | shl ebx,16 |
1030 | shl ebx,16 |
1034 | add ebx,[wndMain.width] |
1031 | add ebx,ted_wnd_w |
1035 | sub ebx,[recMain.left] |
1032 | sub ebx,ted_rec_l |
1036 | mov ecx,[wndMain.top] |
1033 | mov ecx,ted_wnd_t |
1037 | add ecx,13 |
1034 | add ecx,13 |
1038 | shl ecx,16 |
1035 | shl ecx,16 |
1039 | add ecx,[recMain.height] |
1036 | add ecx,ted_rec_h |
Line 1040... | Line 1037... | ||
1040 | mov edx,[WND_CAPT_COLOR] |
1037 | mov edx,[WND_CAPT_COLOR] |
1041 | int 0x40 |
1038 | int 0x40 |
1042 | 1039 | ||
1043 | cmp [help_id],-1 |
1040 | cmp [help_id],-1 |
Line 1044... | Line 1041... | ||
1044 | je @f;.no_help |
1041 | je @f |
1045 | mov eax,[help_id] |
1042 | mov eax,[help_id] |
1046 | ColToIndexOffset eax,edx |
1043 | ColToIndexOffset eax,edx |
1047 | 1044 | ||
1048 | ;SetCoordinates |
1045 | ;SetCoordinates |
1049 | mov ebx,[wndMain.left] |
1046 | mov ebx,ted_wnd_l |
Line 1050... | Line 1047... | ||
1050 | add ebx,[recMain.left] |
1047 | add ebx,ted_rec_l |
1051 | shl ebx,16 |
1048 | shl ebx,16 |
1052 | add ebx,[wndMain.top] |
1049 | add ebx,ted_wnd_t |
Line 1060... | Line 1057... | ||
1060 | add ecx,eax |
1057 | add ecx,eax |
1061 | push dword[ecx] |
1058 | push dword[ecx] |
1062 | pop ecx |
1059 | pop ecx |
1063 | or ecx,0xc0000000 ;SetTextStyles |
1060 | or ecx,0xc0000000 ;SetTextStyles |
1064 | mov edi,[WND_WORK_COLOR] |
1061 | mov edi,[WND_WORK_COLOR] |
1065 | - | ||
- | 1062 | ; edi <> edit ----------------------------------------------------------------- |
|
1066 | mov eax,4 |
1063 | mov eax,4 |
1067 | int 0x40 |
1064 | int 0x40 |
Line 1068... | Line 1065... | ||
1068 | 1065 | ||
1069 | ;*** draw help string *** |
1066 | ;*** draw help string *** |
Line 1075... | Line 1072... | ||
1075 | add edi,dword[tex_help_f1] |
1072 | add edi,dword[tex_help_f1] |
1076 | mov edx,edi |
1073 | mov edx,edi |
1077 | add ebx,0x500000 |
1074 | add ebx,0x500000 |
1078 | int 0x40 |
1075 | int 0x40 |
1079 | @@: |
1076 | @@: |
1080 | ;.no_help: |
1077 | popad |
1081 | pop edi edx ecx ebx eax |
- | |
1082 | ret |
1078 | ret |
- | 1079 | endp |
|
- | 1080 | ||
- | 1081 | proc draw_line_numbers, edit:dword |
|
- | 1082 | pushad |
|
- | 1083 | mov edi,dword[edit] |
|
- | 1084 | ||
- | 1085 | ;top panel with caption |
|
- | 1086 | mov ebx,ted_wnd_l |
|
- | 1087 | ; add ebx,ted_rec_l |
|
- | 1088 | shl ebx,16 |
|
- | 1089 | add ebx,ted_wnd_w |
|
- | 1090 | ; sub ebx,ted_rec_l |
|
- | 1091 | mov edx,[WND_WORK_COLOR] |
|
- | 1092 | mov ecx,ted_wnd_t |
|
- | 1093 | shl ecx,16 |
|
- | 1094 | add ecx,ted_rec_t |
|
- | 1095 | mov eax,13 |
|
- | 1096 | mov edx,[WND_CAPT_COLOR] |
|
- | 1097 | int 0x40 |
|
Line 1083... | Line -... | ||
1083 | - | ||
1084 | draw_line_numbers: |
- | |
1085 | push eax ebx ecx edx esi ;edi |
1098 | |
1086 | ;line numbers |
- | |
1087 | mov eax,47 |
- | |
1088 | mov esi,[WND_BORD_COLOR] |
- | |
1089 | ;or esi,0x40000000 |
- | |
1090 | ;mov edi,[WND_WORK_COLOR] |
1099 | ;line numbers |
1091 | mov ebx,0x40000 ;format |
- | |
1092 | 1100 | mov ebx,0x40000 ;format |
|
1093 | mov ecx,[wScr.position] |
1101 | mov ecx,[wScr.position] |
1094 | inc ecx |
1102 | inc ecx |
1095 | mov dx,3 |
1103 | mov edx,3 |
1096 | add dx,word[wndMain.left] |
1104 | add edx,ted_wnd_l |
1097 | shl edx,16 |
1105 | rol edx,16 |
1098 | mov dx,word[wndMain.top] |
1106 | add edx,ted_wnd_t |
1099 | add dx,word[recMain.top] |
1107 | add edx,ted_rec_t |
Line 1100... | Line 1108... | ||
1100 | @@: |
1108 | @@: |
1101 | - | ||
1102 | push eax ebx ecx edx |
1109 | |
1103 | mov eax,13 |
1110 | push ebx ecx edx |
1104 | ;left panel with numbers |
1111 | ;left panel with numbers |
1105 | mov ebx,[wndMain.left] |
1112 | mov ebx,ted_wnd_l |
- | 1113 | shl ebx,16 |
|
- | 1114 | add ebx,ted_rec_l |
|
1106 | shl ebx,16 |
1115 | mov ecx,ted_rec_h |
1107 | add ebx,[recMain.left] |
- | |
1108 | mov cx,dx |
- | |
1109 | ; mov ecx,[wndMain.top] ;draw caption |
1116 | rol ecx,16 |
1110 | ; add ecx,[recMain.top] |
1117 | mov cx,dx |
1111 | shl ecx,16 |
1118 | rol ecx,16 |
1112 | mov cx,word [recMain.height] |
1119 | mov eax,13 |
1113 | mov edx,[WND_CAPT_COLOR] |
1120 | mov edx,[WND_CAPT_COLOR] |
Line 1114... | Line 1121... | ||
1114 | int 0x40 |
1121 | int 0x40 ;ðèñóåì ïðÿìîóãîëüíèê ïîä íîìåðîì ñòðîêè |
- | 1122 | pop edx ecx ebx |
|
- | 1123 | ||
1115 | pop edx ecx ebx eax |
1124 | mov eax,47 |
1116 | 1125 | mov esi,[WND_BORD_COLOR] |
|
1117 | int 0x40 |
1126 | int 0x40 ;ðèñóåì íîìåð ñòðîêè |
- | 1127 | inc ecx |
|
- | 1128 | add edx,ted_rec_h |
|
1118 | inc ecx |
1129 | sub edx,ted_wnd_t |
1119 | add dx,word[recMain.height] |
1130 | mov esi,edx |
1120 | sub dx,word[wndMain.top] |
1131 | and esi,0xffff |
1121 | cmp dx,word[wndMain.height] |
1132 | cmp esi,ted_wnd_h |
1122 | jge @f |
1133 | jge @f |
Line 1123... | Line 1134... | ||
1123 | add dx,word[wndMain.top] |
1134 | add edx,ted_wnd_t |
1124 | jmp @b |
1135 | jmp @b |
- | 1136 | @@: |
|
Line -... | Line 1137... | ||
- | 1137 | ||
- | 1138 | popad |
|
- | 1139 | ret |
|
- | 1140 | endp |
|
Line 1125... | Line -... | ||
1125 | @@: |
- | |
1126 | - | ||
1127 | pop esi edx ecx ebx eax |
1141 | |
1128 | ret |
1142 | ;this function need to optimize output |
1129 | 1143 | proc draw_cursor_sumb, edit:dword |
|
1130 | 1144 | push eax ecx edx edi |
|
1131 | draw_cursor_sumb: ;this function need to optimize output |
1145 | mov edi,dword[edit] |
1132 | push eax ecx edx |
1146 | |
1133 | mov eax,13 ;rect |
1147 | mov eax,13 ;rect |
1134 | mov ebx,[wndMain.left] |
1148 | mov ebx,ted_wnd_l |
Line 1135... | Line 1149... | ||
1135 | add ebx,[recMain.left] |
1149 | add ebx,ted_rec_l |
1136 | mov edx,[cur_x] |
1150 | mov edx,[cur_x] |
1137 | imul edx,[recMain.width] |
1151 | imul edx,ted_rec_w |
1138 | add ebx,edx |
1152 | add ebx,edx |
1139 | shl ebx,16 |
1153 | shl ebx,16 |
1140 | add ebx,[recMain.width] |
1154 | add ebx,ted_rec_w |
1141 | 1155 | ||
Line 1142... | Line 1156... | ||
1142 | mov ecx,[wndMain.top] ;calc rect -> y0,y1 |
1156 | mov ecx,ted_wnd_t ;calc rect -> y0,y1 |
1143 | add ecx,[recMain.top] |
1157 | add ecx,ted_rec_t |
1144 | mov edx,[cur_y] |
1158 | mov edx,[cur_y] |
Line 1198... | Line 1212... | ||
1198 | call ConvertInvisSymb |
1212 | call ConvertInvisSymb |
1199 | int 0x40 |
1213 | int 0x40 |
1200 | pop esi |
1214 | pop esi |
1201 | @@: |
1215 | @@: |
Line 1202... | Line 1216... | ||
1202 | 1216 | ||
1203 | pop edx ecx eax |
1217 | pop edi edx ecx eax |
1204 | ret |
1218 | ret |
Line 1205... | Line 1219... | ||
1205 | 1219 | endp |
|
1206 | 1220 | ||
1207 | 1221 |