Subversion Repositories Kolibri OS

Rev

Rev 483 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 483 Rev 491
1
; SEE YOU File FAQ.txt and HISTORY. Good Like! 
1
; SEE YOU File FAQ.txt and HISTORY. Good Like! 
2
;;;;;;;;;;;;;;;;;;
2
;;;;;;;;;;;;;;;;;;
3
include 'editbox.mac'    ;¬ ªà®á ª®â®àë© ¤®«¦¥­ ®¡«¥£ç¨âì ¦¨§­ì :) ᯥ樠«ì­® ¤«ï editbox
3
include 'editbox.mac'    ;¬ ªà®á ª®â®àë© ¤®«¦¥­ ®¡«¥£ç¨âì ¦¨§­ì :) ᯥ樠«ì­® ¤«ï editbox
4
;;;;;;;;;;;;;;;;;;
4
;;;;;;;;;;;;;;;;;;
5
macro use_edit_box procinfo,scr_h,scr_w
5
macro use_edit_box procinfo,scr_h,scr_w
6
{
6
{
7
edit_box:
7
edit_box:
8
ed_width        equ [edi]               ;è¨à¨­  ª®¬¯®­¥­â 
8
ed_width        equ [edi]               ;è¨à¨­  ª®¬¯®­¥­â 
9
ed_left         equ [edi+4]             ;¯®«®¦¥­¨¥ ¯® ®á¨ å
9
ed_left         equ [edi+4]             ;¯®«®¦¥­¨¥ ¯® ®á¨ å
10
ed_top          equ [edi+8]             ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
10
ed_top          equ [edi+8]             ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
11
ed_color        equ [edi+12]            ;梥â ä®­  ª®¬¯®­¥­â 
11
ed_color        equ [edi+12]            ;梥â ä®­  ª®¬¯®­¥­â 
12
shift_color     equ [edi+16]            ;=0x6a9480
12
shift_color     equ [edi+16]            ;=0x6a9480
13
ed_focus_border_color   equ [edi+20]    ;梥â à ¬ª¨ ª®¬¯®­¥­â 
13
ed_focus_border_color   equ [edi+20]    ;梥â à ¬ª¨ ª®¬¯®­¥­â 
14
ed_blur_border_color    equ [edi+24]    ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
14
ed_blur_border_color    equ [edi+24]    ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
15
ed_text_color   equ [edi+28]            ;梥â ⥪áâ 
15
ed_text_color   equ [edi+28]            ;梥â ⥪áâ 
16
ed_max          equ [edi+32]                    ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
16
ed_max          equ [edi+32]                    ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
17
ed_text         equ [edi+36]                    ;㪠§ â¥«ì ­  ¡ãä¥à
17
ed_text         equ [edi+36]                    ;㪠§ â¥«ì ­  ¡ãä¥à
18
ed_flags        equ [edi+40]            ;ä« £¨
18
ed_flags        equ [edi+40]            ;ä« £¨
19
ed_size equ [edi+42]                    ;ª®«-¢® ᨬ¢®«®¢
19
ed_size equ [edi+42]                    ;ª®«-¢® ᨬ¢®«®¢
20
ed_pos  equ [edi+46]                    ;¯®§¨æ¨ï ªãàá®à 
20
ed_pos  equ [edi+46]                    ;¯®§¨æ¨ï ªãàá®à 
21
ed_offset       equ [edi+50]            ;ᬥ饭¨¥
21
ed_offset       equ [edi+50]            ;ᬥ饭¨¥
22
cl_curs_x       equ [edi+54]            ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
22
cl_curs_x       equ [edi+54]            ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
23
cl_curs_y       equ [edi+58]            ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
23
cl_curs_y       equ [edi+58]            ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
24
ed_shift_pos    equ [edi+62]            ;¯®«®¦¥­¨¥ ªãàá®à 
24
ed_shift_pos    equ [edi+62]            ;¯®«®¦¥­¨¥ ªãàá®à 
25
ed_shift_pos_old equ [edi+66]           ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
25
ed_shift_pos_old equ [edi+66]           ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
26
;==========================================================
26
;==========================================================
27
;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ =================================
27
;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ =================================
28
;==========================================================
28
;==========================================================
29
.draw:
29
.draw:
30
pusha
30
pusha
31
;--- à¨á㥬 à ¬ªã ---
31
;--- à¨á㥬 à ¬ªã ---
32
        call    .draw_border            ; ”ã­ªæ¨ï áâ ¡¨«ì­ 
32
        call    .draw_border            ; ”ã­ªæ¨ï áâ ¡¨«ì­ 
33
.draw_bg_cursor_text:
33
.draw_bg_cursor_text:
34
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥, ¥á«¨ ­ ¤® ---
34
;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥, ¥á«¨ ­ ¤® ---
35
        call    .check_offset           ;¢ëç¨á«¥­¨¥ ¯®§¨æ¨¨ ªãàá®à  áâ ¡¨«ì­ 
35
        call    .check_offset           ;¢ëç¨á«¥­¨¥ ¯®§¨æ¨¨ ªãàá®à  áâ ¡¨«ì­ 
36
;--- à¨á㥬 ¢­ãâ७­îî ®¡« áâì ---
36
;--- à¨á㥬 ¢­ãâ७­îî ®¡« áâì ---
37
        call    .draw_bg                ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª à ¡®ç¥© ®¡« áâ¨
37
        call    .draw_bg                ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª à ¡®ç¥© ®¡« áâ¨
38
;---- à¨á㥬 ¢ë¤¥«¥­¨¥, ¯® shift ¥á«¨ ¥áâì
38
;---- à¨á㥬 ¢ë¤¥«¥­¨¥, ¯® shift ¥á«¨ ¥áâì
39
        call    .draw_shift
39
        call    .draw_shift
40
.draw_cursor_text:
40
.draw_cursor_text:
41
;--- à¨á㥬 ªãàá®à ---
41
;--- à¨á㥬 ªãàá®à ---
42
        ;--- ¬®¦¥â ¥£® ­¥ ­ ¤® à¨á®¢ âì ----
42
        ;--- ¬®¦¥â ¥£® ­¥ ­ ¤® à¨á®¢ âì ----
43
        test    word ed_flags,ed_focus
43
        test    word ed_flags,ed_focus
44
        je     @f
44
        je     @f
45
        call    .draw_cursor
45
        call    .draw_cursor
46
@@:
46
@@:
47
        call    .draw_text
47
        call    .draw_text
48
edit_ex
48
edit_ex
49
;==========================================================
49
;==========================================================
50
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
50
;=== ®¡à ¡®âª  ª« ¢¨ âãàë =================================
51
;==========================================================
51
;==========================================================
52
.key:
52
.key:
53
pusha
53
pusha
54
        test    word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
54
        test    word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
55
        je      .no_figure
55
        je      .no_figure
56
;à®¢¥àª  ­ ¦ â shift ?
56
;à®¢¥àª  ­ ¦ â shift ?
57
        call    .check_shift
57
        call    .check_shift
58
;----------------------------------------------------------
58
;----------------------------------------------------------
59
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
59
;--- ¯à®¢¥à塞, çâ® ­ ¦ â® --------------------------------
60
;----------------------------------------------------------
60
;----------------------------------------------------------
61
use_key_process  backspase,delete,left,right,home,end,insert
61
use_key_process  backspase,delete,left,right,home,end,insert
62
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
62
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
63
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨ ®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
63
;‡ £«ã誠 ­  ®¡à ¡®âªã ª« ¢¨è ¢¢¥àå ¨ ¢­¨§ â.¥. ¯à¨ ®¡­ à㦥­¨¨ íâ¨å ª®¤®¢ ¯à®¨á室¨â ¢ë室 ¨§ ®¡à ¡®â稪 
64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;    
64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;    
65
use_key_no_process   up,down,esc
65
use_key_no_process   up,down,esc
66
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
66
;--- ­ ¦ â  ¤àã£ ï ª« ¢¨è  ---
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
68
;à®¢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥ ¥á«¨ â ª®©­¥®¡å®¤¨¬®á⨠­¥â ­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
68
;à®¢¥àª  ãáâ ­®¢«¥­ «¨ ä« £ ¯à¨ ª®â®à®¬ ­ã¦­® ¢ë¢®¤¨âì ⮫쪮 æ¨äàë ¢ ­ã¦­®¬ ¡®ªá¥ ¥á«¨ â ª®©­¥®¡å®¤¨¬®á⨠­¥â ­ã¦­® § ª®¬¥­â¨à®¢ âì ¬ ªà®á
69
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
69
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
70
use_key_figures_only
70
use_key_figures_only
71
;¯à®¢¥àª  ­  shift
71
;¯à®¢¥àª  ­  shift
72
@@:     test    word ed_flags,ed_shift_on
72
@@:     test    word ed_flags,ed_shift_on
73
        je      @f
73
        je      @f
74
        ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
74
        ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
75
        push    eax
75
        push    eax
76
        mov     edx,ed_size
76
        mov     edx,ed_size
77
        mov     ecx,ed_pos
77
        mov     ecx,ed_pos
78
        pusha
78
        pusha
79
;clear
79
;clear
80
;        mov     ebp,edx ;ed_size
80
;        mov     ebp,edx ;ed_size
81
;        call    .clear_bg
81
;        call    .clear_bg
82
        mov     ebp,ed_color
82
        mov     ebp,ed_color
83
        mov     ebx,dword       ed_shift_pos
83
        mov     ebx,dword       ed_shift_pos
84
        call    .sh_cl_
84
        call    .sh_cl_
85
 
85
 
86
.sh_nxt:popa 
86
.sh_nxt:popa 
87
        call    .del_char
87
        call    .del_char
88
;;;;
88
;;;;
89
        mov     eax,dword ed_shift_pos
89
        mov     eax,dword ed_shift_pos
90
        mov     ebx,ed_size
90
        mov     ebx,ed_size
91
        sub     ebx,eax
91
        sub     ebx,eax
92
        mov     ed_size,ebx
92
        mov     ed_size,ebx
93
        pop     eax
93
        pop     eax
94
        ; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥
94
        ; ¯à®¢¥à塞, ­ å®¤¨âáï «¨ ªãàá®à ¢ ª®­æ¥
95
@@:     mov     ecx,ed_size
95
@@:     mov     ecx,ed_size
96
        mov     edx, ed_max
96
        mov     edx, ed_max
97
        test    word ed_flags,ed_insert
97
        test    word ed_flags,ed_insert
98
        jne     @f
98
        jne     @f
99
        cmp     ecx,edx
99
        cmp     ecx,edx
100
        jae     .no_figure
100
        jae     .no_figure
101
@@:     mov     ebx, ed_pos
101
@@:     mov     ebx, ed_pos
102
        cmp     ebx,edx
102
        cmp     ebx,edx
103
        jl      @f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
103
        jl      @f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
104
.no_figure:
104
.no_figure:
105
edit_ex
105
edit_ex
106
.insert: test   word ed_flags,ed_insert ;not    word ed_insert
106
.insert: test   word ed_flags,ed_insert ;not    word ed_insert
107
         je     .insert_1
107
         je     .insert_1
108
         and    word ed_flags,ed_insert_cl
108
         and    word ed_flags,ed_insert_cl
109
        jmp     .no_figure
109
        jmp     .no_figure
110
.insert_1:
110
.insert_1:
111
        or      word ed_flags,ed_insert
111
        or      word ed_flags,ed_insert
112
        jmp     .no_figure
112
        jmp     .no_figure
113
.ins_v:
113
.ins_v:
114
        dec     dword [ebp+42];ed_size    ;processing is insert
114
        dec     dword [ebp+42];ed_size    ;processing is insert
115
        sub     esi,ecx
115
        sub     esi,ecx
116
        add     esi,ebx
116
        add     esi,ebx
117
        mov     edi,esi
117
        mov     edi,esi
118
;clear
118
;clear
119
pusha
119
pusha
120
        mov     edi,ebp
120
        mov     edi,ebp
121
        mov     ebp,ed_pos
121
        mov     ebp,ed_pos
122
        call    .clear_bg
122
        call    .clear_bg
123
popa
123
popa
124
        jmp     .In_k
124
        jmp     .In_k
125
@@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
125
@@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
126
        mov     ecx,ed_size
126
        mov     ecx,ed_size
127
        push    edi eax
127
        push    edi eax
128
        mov     ebp,edi
128
        mov     ebp,edi
129
        mov     esi,ed_text     ; “ª § â¥«ì ­  ¡ãä¥à
129
        mov     esi,ed_text     ; “ª § â¥«ì ­  ¡ãä¥à
130
                                ;ã¤¥¬ à ¡®â âì á® áâப®©
130
                                ;ã¤¥¬ à ¡®â âì á® áâப®©
131
        add     esi,ecx         ;add ed_size ¤®¡ ¢¨¬ max size
131
        add     esi,ecx         ;add ed_size ¤®¡ ¢¨¬ max size
132
        mov     edi,esi
132
        mov     edi,esi
133
 
133
 
134
        cmp     ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
134
        cmp     ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
135
        je      .In_k
135
        je      .In_k
136
 
136
 
137
        test    word [ebp+40],ed_insert ;IF insert is enable  â.ª. edi ¨§¬¥­¥­  ¤à¥á㥬 ç¥à¥§ ebp
137
        test    word [ebp+40],ed_insert ;IF insert is enable  â.ª. edi ¨§¬¥­¥­  ¤à¥á㥬 ç¥à¥§ ebp
138
        jne     .ins_v
138
        jne     .ins_v
139
;clear
139
;clear
140
pusha
140
pusha
141
        mov     edi,ebp
141
        mov     edi,ebp
142
        mov     ebp,ed_size
142
        mov     ebp,ed_size
143
        call    .clear_bg
143
        call    .clear_bg
144
popa
144
popa
145
        sub     ecx,ebx         ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï.
145
        sub     ecx,ebx         ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï.
146
        inc     edi             ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢ ¯à ¢®
146
        inc     edi             ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢ ¯à ¢®
147
        std
147
        std
148
        inc     ecx
148
        inc     ecx
149
   @@:  
149
   @@:  
150
        ;--------
150
        ;--------
151
        lodsb
151
        lodsb
152
        stosb
152
        stosb
153
        ;--------
153
        ;--------
154
        loop    @b
154
        loop    @b
155
.In_k:  cld
155
.In_k:  cld
156
        pop eax
156
        pop eax
157
        mov al,ah
157
        mov al,ah
158
        stosb
158
        stosb
159
        pop edi
159
        pop edi
160
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à
160
; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à
161
        ; 㢥«¨ç¨¢ ¥¬ §­ ç¥­¨¥ à §¬¥à  ¨ ¯®§¨æ¨¨
161
        ; 㢥«¨ç¨¢ ¥¬ §­ ç¥­¨¥ à §¬¥à  ¨ ¯®§¨æ¨¨
162
        inc      dword ed_size
162
        inc      dword ed_size
163
        inc      dword ed_pos
163
        inc      dword ed_pos
164
        call    .draw_all2
164
        call    .draw_all2
165
        jmp     .shift;.draw_cursor_text
165
        jmp     .shift;.draw_cursor_text
166
.delete:        
166
.delete:        
167
        mov     edx,ed_size
167
        mov     edx,ed_size
168
        mov     ecx,ed_pos
168
        mov     ecx,ed_pos
169
        cmp     edx,ecx
169
        cmp     edx,ecx
170
        jg      .bac_del
170
        jg      .bac_del
171
        test    word ed_flags,ed_shift_on
171
        test    word ed_flags,ed_shift_on
172
        jne     .del_bac
172
        jne     .del_bac
173
edit_ex
173
edit_ex
174
.bac_del:       
174
.bac_del:       
175
        call    .del_char
175
        call    .del_char
176
        jmp     .draw_all
176
        jmp     .draw_all
177
        
177
        
178
;--- ­ ¦ â  ª« ¢¨è  backspace ---
178
;--- ­ ¦ â  ª« ¢¨è  backspace ---
179
.backspace:
179
.backspace:
180
        ; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ?
180
        ; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ?
181
        mov     ecx,ed_pos
181
        mov     ecx,ed_pos
182
        test    ecx,ecx
182
        test    ecx,ecx
183
        jnz     .del_bac
183
        jnz     .del_bac
184
        test    word ed_flags,ed_shift_on
184
        test    word ed_flags,ed_shift_on
185
        jne     .bac_del
185
        jne     .bac_del
186
 
186
 
187
edit_ex
187
edit_ex
188
.del_bac:
188
.del_bac:
189
        mov     edx,ed_size
189
        mov     edx,ed_size
190
        cmp     edx,ecx ;if ed_pos=ed_size
190
        cmp     edx,ecx ;if ed_pos=ed_size
191
        je      @f
191
        je      @f
192
        dec     ecx
192
        dec     ecx
193
        call    .del_char
193
        call    .del_char
194
@@:     test    word ed_flags,ed_shift_on
194
@@:     test    word ed_flags,ed_shift_on
195
        jne     .bac_del
195
        jne     .bac_del
196
        dec      dword ed_pos
196
        dec      dword ed_pos
197
.draw_all:
197
.draw_all:
198
        push    .shift;.draw_cursor_text;eax
198
        push    .shift;.draw_cursor_text;eax
199
 
199
 
200
        test    word ed_flags,ed_shift_on
200
        test    word ed_flags,ed_shift_on
201
        je      @f
201
        je      @f
202
        mov     eax,dword ed_shift_pos
202
        mov     eax,dword ed_shift_pos
203
        mov     ebx,ed_size
203
        mov     ebx,ed_size
204
        sub     ebx,eax
204
        sub     ebx,eax
205
        mov     ed_size,ebx
205
        mov     ed_size,ebx
206
 
206
 
207
        mov     ebp,ed_color
207
        mov     ebp,ed_color
208
        call    .clear_cursor
208
        call    .clear_cursor
209
        call    .check_offset
209
        call    .check_offset
210
        call    .draw_bg
210
        call    .draw_bg
211
        ret
211
        ret
212
@@:     dec      dword ed_size
212
@@:     dec      dword ed_size
213
 
213
 
214
.draw_all2:
214
.draw_all2:
215
        and    word ed_flags,ed_shift_cl
215
        and    word ed_flags,ed_shift_cl
216
        mov     ebp,ed_color
216
        mov     ebp,ed_color
217
        call    .clear_cursor
217
        call    .clear_cursor
218
        call    .check_offset
218
        call    .check_offset
219
        mov     ebp,ed_size
219
        mov     ebp,ed_size
220
        call    .clear_bg
220
        call    .clear_bg
221
        ret
221
        ret
222
;--- ­ ¦ â  ª« ¢¨è  left ---
222
;--- ­ ¦ â  ª« ¢¨è  left ---
223
.left:  mov     ebx,ed_pos
223
.left:  mov     ebx,ed_pos
224
        test    ebx,ebx
224
        test    ebx,ebx
225
        jz      .sh_st_of
225
        jz      .sh_st_of
226
        or      word ed_flags,ed_left_fl
226
        or      word ed_flags,ed_left_fl
227
        call    .sh_first_sh
227
        call    .sh_first_sh
228
        dec      dword ed_pos
228
        dec      dword ed_pos
229
        call    .sh_enable
229
        call    .sh_enable
230
        jmp     .draw_cursor_text
230
        jmp     .draw_cursor_text
231
;--- ­ ¦ â  ª« ¢¨è  right ---
231
;--- ­ ¦ â  ª« ¢¨è  right ---
232
.right: mov     ebx,ed_pos
232
.right: mov     ebx,ed_pos
233
        cmp     ebx,ed_size
233
        cmp     ebx,ed_size
234
        je      .sh_st_of
234
        je      .sh_st_of
235
        and     word ed_flags,ed_right_fl
235
        and     word ed_flags,ed_right_fl
236
        call    .sh_first_sh
236
        call    .sh_first_sh
237
        inc     dword  ed_pos
237
        inc     dword  ed_pos
238
        call    .sh_enable
238
        call    .sh_enable
239
        jmp     .draw_cursor_text
239
        jmp     .draw_cursor_text
240
.home:  
240
.home:  
241
        mov     ebx,ed_pos
241
        mov     ebx,ed_pos
242
        test    ebx,ebx
242
        test    ebx,ebx
243
        jz      .sh_st_of
243
        jz      .sh_st_of
244
        call    .sh_first_sh
244
        call    .sh_first_sh
245
        xor     eax,eax
245
        xor     eax,eax
246
        mov     ed_pos,eax
246
        mov     ed_pos,eax
247
        call    .sh_home_end
247
        call    .sh_home_end
248
        jmp     .draw_cursor_text
248
        jmp     .draw_cursor_text
249
.end:   
249
.end:   
250
        mov     ebx,ed_pos
250
        mov     ebx,ed_pos
251
        cmp     ebx,dword ed_size
251
        cmp     ebx,dword ed_size
252
        je      .sh_st_of
252
        je      .sh_st_of
253
        call    .sh_first_sh
253
        call    .sh_first_sh
254
        mov     eax,ed_size
254
        mov     eax,ed_size
255
        mov     ed_pos,eax
255
        mov     ed_pos,eax
256
        call    .sh_home_end
256
        call    .sh_home_end
257
        jmp     .draw_cursor_text
257
        jmp     .draw_cursor_text
258
;==========================================================
258
;==========================================================
259
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
259
;=== ®¡à ¡®âª  ¬ëè¨ =======================================
260
;==========================================================
260
;==========================================================
261
.mouse:
261
.mouse:
262
pusha
262
pusha
263
;debug
263
;debug
264
;----------------------------------------------------------
264
;----------------------------------------------------------
265
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
265
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
266
;----------------------------------------------------------     
266
;----------------------------------------------------------     
267
        mcall   37,2
267
        mcall   37,2
268
;----------------------------------------------------------
268
;----------------------------------------------------------
269
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
269
;--- ¯à®¢¥à塞 á®áâ®ï­¨¥ ----------------------------------
270
;----------------------------------------------------------
270
;----------------------------------------------------------
271
        test    eax,1              
271
        test    eax,1              
272
        jnz     .mouse_left_button
272
        jnz     .mouse_left_button
273
        and     word ed_flags,ed_mouse_on_off
273
        and     word ed_flags,ed_mouse_on_off
274
        xor     ebx,ebx
274
        xor     ebx,ebx
275
        mov     dword [mouse_flag],ebx
275
        mov     dword [mouse_flag],ebx
276
edit_ex
276
edit_ex
277
.mouse_left_button:
277
.mouse_left_button:
278
;----------------------------------------------------------
278
;----------------------------------------------------------
279
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
279
;--- ¡«®ª¨à®¢ª  ®â 䮪ãá¨à®¢ª¨ ¢ ¤àã£¨å ¡®ªá å ¯à¨ ¯®¯ ¤ ­¨¨ ­  ­¨å ªãàá®à 
280
;----------------------------------------------------------
280
;----------------------------------------------------------
281
        mov     eax,dword [mouse_flag]
281
        mov     eax,dword [mouse_flag]
282
        test    eax,eax
282
        test    eax,eax
283
        jz      @f
283
        jz      @f
284
        cmp     eax,edi
284
        cmp     eax,edi
285
        je      @f
285
        je      @f
286
        jmp     ._blur
286
        jmp     ._blur
287
;----------------------------------------------------------
287
;----------------------------------------------------------
288
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
288
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
289
;----------------------------------------------------------
289
;----------------------------------------------------------
290
@@:     mcall   37,0
290
@@:     mcall   37,0
291
;----------------------------------------------------------
291
;----------------------------------------------------------
292
;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
292
;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
293
;----------------------------------------------------------
293
;----------------------------------------------------------
294
        mov     ecx,procinfo
-
 
295
        test    word ed_flags,ed_mouse_on
294
        test    word ed_flags,ed_mouse_on
296
        jne     .mouse_wigwag
295
        jne     .mouse_wigwag
297
;----------------------------------------------------------
296
;----------------------------------------------------------
298
;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box -------------
297
;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box -------------
299
;----------------------------------------------------------
298
;----------------------------------------------------------
300
        mov     ebx,dword [ecx+38]
299
        mov     ebx,[procinfo.box.top]
301
        add     ebx,ed_top
300
        add     ebx,ed_top
302
if scr_h eq 
301
if scr_h eq 
303
else
302
else
304
        add     ebx,scr_h
303
        add     ebx,scr_h
305
end if
304
end if
306
        cmp     ax,bx
305
        cmp     ax,bx
307
        jl      ._blur;.mouse_end_no_focus
306
        jl      ._blur;.mouse_end_no_focus
308
 
307
 
309
        add     ebx,ed_height
308
        add     ebx,ed_height
310
        cmp     ax,bx
309
        cmp     ax,bx
311
        jg      ._blur;.mouse_end_no_focus
310
        jg      ._blur;.mouse_end_no_focus
312
 
311
 
313
        shr     eax,16
312
        shr     eax,16
314
 
313
 
315
        mov     ebx,dword [ecx+34]
314
        mov     ebx,[procinfo.box.left]
316
        add     ebx,ed_left
315
        add     ebx,ed_left
317
if scr_w eq 
316
if scr_w eq 
318
else
317
else
319
        add     ebx,scr_w
318
        add     ebx,scr_w
320
end if
319
end if
321
        cmp     ax,bx
320
        cmp     ax,bx
322
        jl      ._blur;.mouse_end_no_focus
321
        jl      ._blur;.mouse_end_no_focus
323
 
322
 
324
        add     ebx,ed_width
323
        add     ebx,ed_width
325
        cmp     ax,bx
324
        cmp     ax,bx
326
        jg      ._blur;.mouse_end_no_focus
325
        jg      ._blur;.mouse_end_no_focus
327
;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
326
;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
328
        push    eax
327
        push    eax
329
        mov     ebp,ed_color
328
        mov     ebp,ed_color
330
        call    .clear_cursor
329
        call    .clear_cursor
331
        pop     eax
330
        pop     eax
332
._mvpos:
331
._mvpos:
333
        mov     ecx,procinfo
-
 
334
        mov     ebx,dword [ecx+34]
332
        mov     ebx,dword [procinfo.box.left]
335
        xor     edx,edx
333
        xor     edx,edx
336
        sub     eax,ed_left
334
        sub     eax,ed_left
337
        sub     eax,ebx
335
        sub     eax,ebx
338
if scr_w eq 
336
if scr_w eq 
339
else
337
else
340
        add     ebx,scr_w
338
        add     ebx,scr_w
341
        sub     eax,2
339
        sub     eax,2
342
end if
340
end if
343
        mov     ebx,6
341
        mov     ebx,6
344
        div     bx
342
        div     bx
345
        add     eax,ed_offset
343
        add     eax,ed_offset
346
        cmp     eax,ed_size
344
        cmp     eax,ed_size
347
        jna     ._mshift
345
        jna     ._mshift
348
        mov     eax,ed_size
346
        mov     eax,ed_size
349
._mshift:
347
._mshift:
350
;;;;;;;
348
;;;;;;;
351
;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
349
;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
352
;;;;;;;
350
;;;;;;;
353
        test    word ed_flags,ed_shift_bac
351
        test    word ed_flags,ed_shift_bac
354
        je      @f
352
        je      @f
355
        mov     ebp,dword       ed_color
353
        mov     ebp,dword       ed_color
356
        mov     ebx,dword ed_shift_pos
354
        mov     ebx,dword ed_shift_pos
357
        push    eax
355
        push    eax
358
        call    .sh_cl_
356
        call    .sh_cl_
359
        and     word ed_flags,ed_shift_bac_cl
357
        and     word ed_flags,ed_shift_bac_cl
360
        pop     eax
358
        pop     eax
361
@@:     
359
@@:     
362
        test    word ed_flags,ed_mouse_on
360
        test    word ed_flags,ed_mouse_on
363
        jne     @f
361
        jne     @f
364
        
362
        
365
        mov     dword ed_shift_pos,eax
363
        mov     dword ed_shift_pos,eax
366
        or      word  ed_flags,ed_mouse_on
364
        or      word  ed_flags,ed_mouse_on
367
        mov     dword ed_pos,eax
365
        mov     dword ed_pos,eax
368
        mov     dword [mouse_flag],edi          ;ãáâ ­®¢¨¬ ¨¤¥­â¨ä¨ª â®à
366
        mov     dword [mouse_flag],edi          ;ãáâ ­®¢¨¬ ¨¤¥­â¨ä¨ª â®à
369
        bts     word ed_flags,1                 ;ãáâ ­®¢ª  䮪ãá 
367
        bts     word ed_flags,1                 ;ãáâ ­®¢ª  䮪ãá 
370
        jmp     .m_sh
368
        jmp     .m_sh
371
@@:             
369
@@:             
372
        cmp     eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
370
        cmp     eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
373
        je      .mouse_ex
371
        je      .mouse_ex
374
        mov     ed_pos,eax
372
        mov     ed_pos,eax
375
        mov     ebp,dword shift_color
373
        mov     ebp,dword shift_color
376
        mov     ebx,dword ed_shift_pos
374
        mov     ebx,dword ed_shift_pos
377
        call    .sh_cl_
375
        call    .sh_cl_
378
        or      word ed_flags,ed_mous_adn_b     ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
376
        or      word ed_flags,ed_mous_adn_b     ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
379
.m_sh:  call    .draw_text
377
.m_sh:  call    .draw_text
380
        call    .draw_cursor
378
        call    .draw_cursor
381
;----------------------------------------------------------
379
;----------------------------------------------------------
382
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
380
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
383
;----------------------------------------------------------
381
;----------------------------------------------------------
384
        jmp     .drc
382
        jmp     .drc
385
._blur:
383
._blur:
386
        test    word ed_flags,ed_always_focus
384
        test    word ed_flags,ed_always_focus
387
        jne     .mouse_ex
385
        jne     .mouse_ex
388
        btr     word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
386
        btr     word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
389
        jnc     .mouse_ex
387
        jnc     .mouse_ex
390
 
388
 
391
        mov     ebp,ed_color
389
        mov     ebp,ed_color
392
        call    .clear_cursor
390
        call    .clear_cursor
393
.drc:   call    .draw_border
391
.drc:   call    .draw_border
394
.mouse_ex:
392
.mouse_ex:
395
 
393
 
396
edit_ex
394
edit_ex
397
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
395
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
398
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨ 
396
;Ž¡é¨¥ ä㭪樨 ®¡à ¡®âª¨ 
399
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
397
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
400
use_general_func
398
use_general_func
401
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
399
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
402
;”㭪樨 ¤«ï à ¡®âë á key
400
;”㭪樨 ¤«ï à ¡®âë á key
403
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
401
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
404
use_key_func
402
use_key_func
405
;----------------------------------------------------------
403
;----------------------------------------------------------
406
;--- ¯à®æ¥¤ãà  à §¬ë¢ ­¨ï 䮪ãá  --------------------------
404
;--- ¯à®æ¥¤ãà  à §¬ë¢ ­¨ï 䮪ãá  --------------------------
407
;----------------------------------------------------------
405
;----------------------------------------------------------
408
;.blur:
406
;.blur:
409
;pusha
407
;pusha
410
;._blur:
408
;._blur:
411
        ;btr     ed_flags,1
409
        ;btr     ed_flags,1
412
        ;jnc     @f
410
        ;jnc     @f
413
        ;call    .draw_border
411
        ;call    .draw_border
414
        ;call    .clear_cursor
412
        ;call    .clear_cursor
415
;@@:
413
;@@:
416
;edit_ex
414
;edit_ex
417
 
415
 
418
;----------------------------------------------------------
416
;----------------------------------------------------------
419
;--- Ž¡à ¡®âª  .mouse_wigwag
417
;--- Ž¡à ¡®âª  .mouse_wigwag
420
;----------------------------------------------------------
418
;----------------------------------------------------------
421
.mouse_wigwag:
419
.mouse_wigwag:
422
        shr     eax,16
420
        shr     eax,16
423
        or      word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
421
        or      word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
424
;;;;;;;;;;;;;;;;;;
422
;;;;;;;;;;;;;;;;;;
425
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
423
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
426
;;;;;;;;;;;;;;;;;;
424
;;;;;;;;;;;;;;;;;;
427
        mov     ecx,procinfo
425
        mov     ebx,[procinfo.box.left]
428
        mov     ebx,dword [ecx+34]
-
 
429
        add     ebx,ed_left
426
        add     ebx,ed_left
430
if scr_w eq 
427
if scr_w eq 
431
else
428
else
432
        add     ebx,scr_w
429
        add     ebx,scr_w
433
end if
430
end if
434
        cmp     eax,ebx
431
        cmp     eax,ebx
435
        jb      .mleft
432
        jb      .mleft
436
 
433
 
437
        add     ebx,ed_width
434
        add     ebx,ed_width
438
        cmp     eax,ebx
435
        cmp     eax,ebx
439
        ja      .mright 
436
        ja      .mright 
440
 
437
 
441
        sub     ebx,ed_width
438
        sub     ebx,ed_width
442
 
439
 
443
        xor     edx,edx
440
        xor     edx,edx
444
        sub     eax,ebx ; ¢ëç⨬ ¨§ ª®®à¤¨­ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨­ âë ¤® editbox ¯® ®á¨ å
441
        sub     eax,ebx ; ¢ëç⨬ ¨§ ª®®à¤¨­ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨­ âë ¤® editbox ¯® ®á¨ å
445
        mov     ebx,6
442
        mov     ebx,6
446
        div     ebx
443
        div     ebx
447
;;;;;;;;;;;;;;;;;;
444
;;;;;;;;;;;;;;;;;;
448
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox
445
;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox
449
;;;;;;;;;;;;;;;;;;
446
;;;;;;;;;;;;;;;;;;
450
;®«ã稫¨ ª®®à¤¨­ âë ¢ eax ¬ë誨, â.¥. ªã¤  ®­  ¯¥à¥¬¥á⨫ áì
447
;®«ã稫¨ ª®®à¤¨­ âë ¢ eax ¬ë誨, â.¥. ªã¤  ®­  ¯¥à¥¬¥á⨫ áì
451
;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
448
;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
452
        add     eax,ed_offset   ;¤®¡ ¢¨¬ ᬥ饭¨¥
449
        add     eax,ed_offset   ;¤®¡ ¢¨¬ ᬥ饭¨¥
453
        cmp     eax,dword ed_size       ;¥á«¨ ¢ë諨 §  ¯à¥¤¥«ë, â® ­¨ç¥£® ­¥ ¤¥« âì
450
        cmp     eax,dword ed_size       ;¥á«¨ ¢ë諨 §  ¯à¥¤¥«ë, â® ­¨ç¥£® ­¥ ¤¥« âì
454
        ja      .mwigvag
451
        ja      .mwigvag
455
.mdraw: 
452
.mdraw: 
456
        mov     dword   ed_pos,eax ;á®åà ­¨¬ ­®¢®¥ §­ ç¥­¨¥
453
        mov     dword   ed_pos,eax ;á®åà ­¨¬ ­®¢®¥ §­ ç¥­¨¥
457
;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
454
;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
458
        mov     ecx,dword       ed_shift_pos
455
        mov     ecx,dword       ed_shift_pos
459
        mov     ebx,dword       ed_shift_pos_old
456
        mov     ebx,dword       ed_shift_pos_old
460
        mov     dword   ed_shift_pos_old,eax    ;¢­¥á¥¬ ­®¢®¥ §­ ç¥­¨¥ áâ à®© ¯®§¨æ¨¨ ªãàá®à 
457
        mov     dword   ed_shift_pos_old,eax    ;¢­¥á¥¬ ­®¢®¥ §­ ç¥­¨¥ áâ à®© ¯®§¨æ¨¨ ªãàá®à 
461
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­ëå ®¡« á⥩
458
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­ëå ®¡« á⥩
462
        cmp     ecx,ebx         ;¢ëïá­ï¥¬ ªã¤  ¡ë«® ¤¢¨¦¥­¨¥ ­  ®¤¨­ è £ ­ § ¤
459
        cmp     ecx,ebx         ;¢ëïá­ï¥¬ ªã¤  ¡ë«® ¤¢¨¦¥­¨¥ ­  ®¤¨­ è £ ­ § ¤
463
        je      .m1_shem        ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥ 
460
        je      .m1_shem        ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥ 
464
        jb      .msmaller       ;¤¢¨¦¥­¨¥ ¡ë«® ->
461
        jb      .msmaller       ;¤¢¨¦¥­¨¥ ¡ë«® ->
465
        cmp     ebx,eax         ;¤¢¨¦¥­¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤  ¤¢¨¦¥­¨¥ ¯à®¨á室¨â
462
        cmp     ebx,eax         ;¤¢¨¦¥­¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤  ¤¢¨¦¥­¨¥ ¯à®¨á室¨â
466
        ja      .m1_shem        ;¥á«¨ ¡ë«® ¤¢¨¦¥­¨¥ <- â® ­ã¦­® § ªà á¨âì ®¡« áâì
463
        ja      .m1_shem        ;¥á«¨ ¡ë«® ¤¢¨¦¥­¨¥ <- â® ­ã¦­® § ªà á¨âì ®¡« áâì
467
        je      .mwigvag        ;¥á«¨ ¨§¬¥­¥­¨ï ­¥ ¡ë«®, â® ­¨ç¥£® ­¥ ¤¥« âì
464
        je      .mwigvag        ;¥á«¨ ¨§¬¥­¥­¨ï ­¥ ¡ë«®, â® ­¨ç¥£® ­¥ ¤¥« âì
468
        mov     ebp,ed_color    ;âã⠭㦭® ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old
465
        mov     ebp,ed_color    ;âã⠭㦭® ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old
469
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
466
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
470
        call    .sh_cl_
467
        call    .sh_cl_
471
        jmp     .mwigvag
468
        jmp     .mwigvag
472
.msmaller:
469
.msmaller:
473
        cmp     ebx,eax
470
        cmp     ebx,eax
474
        jb      .m1_shem
471
        jb      .m1_shem
475
        mov     ebp,ed_color
472
        mov     ebp,ed_color
476
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
473
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
477
        call    .sh_cl_
474
        call    .sh_cl_
478
        jmp     .mwigvag
475
        jmp     .mwigvag
479
;alike  =
476
;alike  =
480
.m1_shem: 
477
.m1_shem: 
481
        mov     ebp,shift_color
478
        mov     ebp,shift_color
482
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
479
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
483
        mov     ebx,ecx
480
        mov     ebx,ecx
484
        call    .sh_cl_
481
        call    .sh_cl_
485
        jmp     .mwigvag
482
        jmp     .mwigvag
486
.mwigvag:
483
.mwigvag:
487
        and     word ed_flags,ed_shift_mcl
484
        and     word ed_flags,ed_shift_mcl
488
        jmp     .draw_cursor_text
485
        jmp     .draw_cursor_text
489
;       popa
486
;       popa
490
;       ret
487
;       ret
491
.mleft:
488
.mleft:
492
        mov     eax,ed_pos
489
        mov     eax,ed_pos
493
        cmp     eax,0                                        
490
        cmp     eax,0                                        
494
        jbe      .mwigvag
491
        jbe      .mwigvag
495
        dec     eax
492
        dec     eax
496
        call    .check_offset
493
        call    .check_offset
497
        push    eax
494
        push    eax
498
        mov     ebx,ed_shift_pos
495
        mov     ebx,ed_shift_pos
499
        mov     ebp,shift_color
496
        mov     ebp,shift_color
500
        call    .sh_cl_
497
        call    .sh_cl_
501
        pop     eax
498
        pop     eax
502
        jmp     .mdraw
499
        jmp     .mdraw
503
.mright:
500
.mright:
504
        mov     eax,ed_pos
501
        mov     eax,ed_pos
505
        mov     ebx,ed_size
502
        mov     ebx,ed_size
506
        cmp     eax,ebx
503
        cmp     eax,ebx
507
        jae     .mwigvag
504
        jae     .mwigvag
508
        inc     eax
505
        inc     eax
509
        call    .check_offset
506
        call    .check_offset
510
        mov     ebx,ed_shift_pos
507
        mov     ebx,ed_shift_pos
511
        mov     ebp,shift_color
508
        mov     ebp,shift_color
512
        push    eax
509
        push    eax
513
        call    .sh_cl_
510
        call    .sh_cl_
514
        pop     eax
511
        pop     eax
515
        jmp     .mdraw  
512
        jmp     .mdraw  
516
 
513
 
517
}
514
}
518
ed_figure_only= 1000000000000000b   ;®¤­¨ ᨬ¢®«ë 
515
ed_figure_only= 1000000000000000b   ;®¤­¨ ᨬ¢®«ë 
519
ed_always_focus= 100000000000000b
516
ed_always_focus= 100000000000000b
520
ed_focus=                     10b   ;䮪ãá ¯à¨«®¦¥­¨ï
517
ed_focus=                     10b   ;䮪ãá ¯à¨«®¦¥­¨ï
521
ed_shift_on=                1000b   ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
518
ed_shift_on=                1000b   ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
522
ed_shift_on_off=1111111111110111b
519
ed_shift_on_off=1111111111110111b
523
ed_shift=                    100b   ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
520
ed_shift=                    100b   ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
524
ed_shift_off=   1111111111111011b
521
ed_shift_off=   1111111111111011b
525
ed_shift_bac=              10000b   ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
522
ed_shift_bac=              10000b   ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
526
ed_shift_bac_cl=1111111111101111b   ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
523
ed_shift_bac_cl=1111111111101111b   ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
527
ed_shift_cl=    1111111111100011b
524
ed_shift_cl=    1111111111100011b
528
ed_shift_mcl=   1111111111111011b
525
ed_shift_mcl=   1111111111111011b
529
ed_left_fl=               100000b
526
ed_left_fl=               100000b
530
ed_right_fl=    1111111111011111b
527
ed_right_fl=    1111111111011111b
531
ed_offset_fl=            1000000b
528
ed_offset_fl=            1000000b
532
ed_offset_cl=   1111111110111111b
529
ed_offset_cl=   1111111110111111b
533
ed_insert=              10000000b
530
ed_insert=              10000000b
534
ed_insert_cl=   1111111101111111b
531
ed_insert_cl=   1111111101111111b
535
ed_mouse_on =          100000000b
532
ed_mouse_on =          100000000b
536
ed_mous_adn_b=         100011000b
533
ed_mous_adn_b=         100011000b
537
ed_mouse_on_off=1111111011111111b
534
ed_mouse_on_off=1111111011111111b
538
ed_height=14 ; ¢ëá®â 
535
ed_height=14 ; ¢ëá®â 
539
macro draw_edit_boxes start,_end,use_f9,procinfo
536
macro draw_edit_boxes start,_end,use_f9,procinfo
540
{
537
{
541
if use_f9 eq 
538
if use_f9 eq 
542
else
539
else
543
        mcall   9,procinfo,-1
540
        mcall   9,procinfo,-1
544
end if
541
end if
545
        mov     edi,start
542
        mov     edi,start
546
        mov     ecx,((_end-start)/ed_struc_size)
543
        mov     ecx,((_end-start)/ed_struc_size)
547
@@:
544
@@:
548
        call    edit_box.draw
545
        call    edit_box.draw
549
        add     edi,ed_struc_size
546
        add     edi,ed_struc_size
550
        loop    @b
547
        loop    @b
551
}
548
}
552
 
549
 
553
macro mouse_edit_boxes start,_end
550
macro mouse_edit_boxes start,_end
554
{
551
{
555
        mov     edi,start
552
        mov     edi,start
556
        mov     ecx,((_end-start)/ed_struc_size)
553
        mov     ecx,((_end-start)/ed_struc_size)
557
@@:
554
@@:
558
        call    edit_box.mouse
555
        call    edit_box.mouse
559
        add     edi,ed_struc_size
556
        add     edi,ed_struc_size
560
        loop    @b
557
        loop    @b
561
}
558
}
562
 
559
 
563
macro key_edit_boxes start,end
560
macro key_edit_boxes start,end
564
{
561
{
565
        mov     edi,start
562
        mov     edi,start
566
        mov     ecx,((end-start)/ed_struc_size)
563
        mov     ecx,((end-start)/ed_struc_size)
567
@@:
564
@@:
568
        call    edit_box.key
565
        call    edit_box.key
569
        add     edi,ed_struc_size
566
        add     edi,ed_struc_size
570
        loop    @b
567
        loop    @b
571
}
568
}
572
ed_struc_size=70
569
ed_struc_size=70
573
struc  edit_box width,left,top,color,shift_color,focus_border_color,\
570
struc  edit_box width,left,top,color,shift_color,focus_border_color,\
574
       blur_border_color,text_color,max,text,flags,size,pos
571
       blur_border_color,text_color,max,text,flags,size,pos
575
{
572
{
576
.width dd width
573
.width dd width
577
.left dd left
574
.left dd left
578
.top dd top
575
.top dd top
579
.color dd color
576
.color dd color
580
.shift_color dd shift_color
577
.shift_color dd shift_color
581
.focus_border_color dd focus_border_color
578
.focus_border_color dd focus_border_color
582
.blur_border_color dd blur_border_color
579
.blur_border_color dd blur_border_color
583
.text_color dd text_color
580
.text_color dd text_color
584
.max dd max
581
.max dd max
585
.text dd text
582
.text dd text
586
.flags dw flags+0
583
.flags dw flags+0
587
.size dd size+0
584
.size dd size+0
588
.pos dd pos+0
585
.pos dd pos+0
589
.offset dd 0
586
.offset dd 0
590
.cl_curs_x dd 0
587
.cl_curs_x dd 0
591
.cl_curs_y dd 0
588
.cl_curs_y dd 0
592
.shift   dd 0
589
.shift   dd 0
593
.shift_old   dd 0
590
.shift_old   dd 0
594
}
591
}
595
 
592
 
596
 
593
 
597
macro edit_boxes_set_sys_color start,end,color_table
594
macro edit_boxes_set_sys_color start,end,color_table
598
{
595
{
599
        mov     edi,start
596
        mov     edi,start
600
        mov     ecx,((end-start)/ed_struc_size)
597
        mov     ecx,((end-start)/ed_struc_size)
601
        mov     esi,color_table
598
        mov     esi,color_table
602
@@:
599
@@:
603
        mov     eax,[esi+36]
600
        mov     eax,[esi+36]
604
        mov     ebx,[esi+20]
601
        mov     ebx,[esi+20]
605
        mov     ed_focus_border_color,eax
602
        mov     ed_focus_border_color,eax
606
        shr     bh,1
603
        shr     bh,1
607
        shr     bl,1
604
        shr     bl,1
608
        shr     ah,1
605
        shr     ah,1
609
        shr     al,1
606
        shr     al,1
610
        add     ah,bh
607
        add     ah,bh
611
        add     al,bl
608
        add     al,bl
612
        ror     eax,16
609
        ror     eax,16
613
        ror     ebx,16
610
        ror     ebx,16
614
        shr     bl,1
611
        shr     bl,1
615
        shr     al,1
612
        shr     al,1
616
        add     al,bl
613
        add     al,bl
617
        ror     eax,16
614
        ror     eax,16
618
        mov     ed_blur_border_color,eax
615
        mov     ed_blur_border_color,eax
619
        add     edi,ed_struc_size
616
        add     edi,ed_struc_size
620
        loop    @b
617
        loop    @b
621
}
618
}
622
 
619
 
623
macro draw_edit_box ed_ptr,use_f9,procinfo
620
macro draw_edit_box ed_ptr,use_f9,procinfo
624
{
621
{
625
if use_f9 eq 
622
if use_f9 eq 
626
else
623
else
627
        mcall   9,procinfo,-1
624
        mcall   9,procinfo,-1
628
end if
625
end if
629
        mov     edi,ed_ptr
626
        mov     edi,ed_ptr
630
        call    edit_box.draw
627
        call    edit_box.draw
631
}
628
}
632
 
629
 
633
macro mouse_edit_box ed_ptr
630
macro mouse_edit_box ed_ptr
634
{
631
{
635
        mov     edi,ed_ptr
632
        mov     edi,ed_ptr
636
        call    edit_box.mouse
633
        call    edit_box.mouse
637
}
634
}
638
 
635
 
639
macro key_edit_box ed_ptr
636
macro key_edit_box ed_ptr
640
{
637
{
641
        mov     edi,ed_ptr
638
        mov     edi,ed_ptr
642
        call    edit_box.key
639
        call    edit_box.key
643
}
640
}
644
macro default_box ed_ptr
641
macro default_box ed_ptr
645
{
642
{
646
pusha
643
pusha
647
;       xor     eax,eax
644
;       xor     eax,eax
648
;       mov     ed_shift_pos,eax
645
;       mov     ed_shift_pos,eax
649
;       mov     ed_shift_pos_old,eax
646
;       mov     ed_shift_pos_old,eax
650
        and     word ed_flags,ed_shift_cl
647
        and     word ed_flags,ed_shift_cl
651
;       mov     ed_offset,eax
648
;       mov     ed_offset,eax
652
popa
649
popa
653
}
650
}