Subversion Repositories Kolibri OS

Rev

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

Rev 7573 Rev 7576
1
align 16
1
align 16
2
draw_window:
2
draw_window:
3
	mcall SF_REDRAW,SSF_BEGIN_DRAW
3
	mcall SF_REDRAW,SSF_BEGIN_DRAW
4
 
4
 
5
	mov edx,[sc.work]
5
	mov edx,[sc.work]
6
	or  edx,0x73000000
6
	or  edx,0x73000000
7
	mcall SF_CREATE_WINDOW,dword[wnd_s_pos],dword[wnd_s_pos+4],,,hed
7
	mcall SF_CREATE_WINDOW,dword[wnd_s_pos],dword[wnd_s_pos+4],,,hed
8
 
8
 
9
	mcall SF_THREAD_INFO,procinfo,-1
9
	mcall SF_THREAD_INFO,procinfo,-1
10
	mov edi,tedit0 ;çíà÷åíèå edi íóæíî äëÿ EvSize è ted_wnd_t
10
	mov edi,tedit0 ;çíà÷åíèå edi íóæíî äëÿ EvSize è ted_wnd_t
11
	call EvSize
11
	call EvSize
12
 
12
 
13
	movzx ebx,word[procinfo.client_box.width]
13
	movzx ebx,word[procinfo.client_box.width]
14
	inc bx
14
	inc bx
15
	mcall SF_DRAW_RECT,,ted_wnd_t ;âåðõíèé ïðÿìîóãîëüíèê, äëÿ î÷èñòêè âåðõíåé ïàíåëè
15
	mcall SF_DRAW_RECT,,ted_wnd_t ;âåðõíèé ïðÿìîóãîëüíèê, äëÿ î÷èñòêè âåðõíåé ïàíåëè
16
	call draw_but_toolbar
16
	call draw_but_toolbar
17
	stdcall [kmainmenu_draw], [main_menu]
17
	stdcall [kmainmenu_draw], [main_menu]
18
	stdcall [ted_draw], tedit0
18
	stdcall [ted_draw], tedit0
19
 
19
 
20
	mcall SF_REDRAW,SSF_END_DRAW
20
	mcall SF_REDRAW,SSF_END_DRAW
21
	ret
21
	ret
22
 
22
 
23
align 4
23
align 4
24
draw_but_toolbar: ;ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
24
draw_but_toolbar: ;ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
25
	pushad
25
	pushad
26
	mov edi,tedit0
26
	mov edi,tedit0
27
 
27
 
28
	mov ecx,0x40000000+ID_BUT_NEW
28
	mov ecx,0x40000000+ID_BUT_NEW
29
	mov edx,(5 shl 16)+25
29
	mov edx,(5 shl 16)+25
30
	bt word[panel_but],0
30
	bt word[panel_but],0
31
	jnc @f
31
	jnc @f
32
		call draw_but_icon ;New
32
		call draw_but_icon ;New
33
	@@:
33
	@@:
34
 
34
 
35
	mov cx,ID_BUT_OPEN
35
	mov cx,ID_BUT_OPEN
36
	bt word[panel_but+1],0
36
	bt word[panel_but+1],0
37
	jnc @f
37
	jnc @f
38
		add edx,25 shl 16
38
		add edx,25 shl 16
39
		call draw_but_icon ;Open
39
		call draw_but_icon ;Open
40
	@@:
40
	@@:
41
 
41
 
42
	stdcall [ted_can_save],edi
42
	stdcall [ted_can_save],edi
43
	cmp al,1
43
	cmp al,1
44
	je @f
44
	je @f
45
		and ecx,0xffff
45
		and ecx,0xffff
46
	@@:
46
	@@:
47
	mov cx,ID_BUT_SAVE
47
	mov cx,ID_BUT_SAVE
48
	bt word[panel_but+2],0
48
	bt word[panel_but+2],0
49
	jnc @f
49
	jnc @f
50
		add edx,25 shl 16
50
		add edx,25 shl 16
51
		call draw_but_icon ;Save
51
		call draw_but_icon ;Save
52
	@@:
52
	@@:
53
	or ecx,0x40000000
53
	or ecx,0x40000000
54
 
54
 
55
	mov cx,ID_BUT_SAVE_AS
55
	mov cx,ID_BUT_SAVE_AS
56
	bt word[panel_but+3],0
56
	bt word[panel_but+3],0
57
	jnc @f
57
	jnc @f
58
		add edx,25 shl 16
58
		add edx,25 shl 16
59
		call draw_but_icon ;Save as
59
		call draw_but_icon ;Save as
60
	@@:
60
	@@:
61
 
61
 
62
	mov cx,ID_BUT_SELECT
62
	mov cx,ID_BUT_SELECT
63
	bt word[panel_but+4],0
63
	bt word[panel_but+4],0
64
	jnc @f
64
	jnc @f
65
		add edx,30 shl 16
65
		add edx,30 shl 16
66
		call draw_but_icon ;Select word
66
		call draw_but_icon ;Select word
67
	@@:
67
	@@:
68
 
68
 
69
	call [ted_is_select]
69
	call [ted_is_select]
70
	or al,al
70
	or al,al
71
	jnz @f
71
	jnz @f
72
		and ecx,0xffff
72
		and ecx,0xffff
73
	@@:
73
	@@:
74
	mov cx,ID_BUT_CUT
74
	mov cx,ID_BUT_CUT
75
	bt word[panel_but+5],0
75
	bt word[panel_but+5],0
76
	jnc @f
76
	jnc @f
77
		add edx,25 shl 16
77
		add edx,25 shl 16
78
		call draw_but_icon ;Cut
78
		call draw_but_icon ;Cut
79
	@@:
79
	@@:
80
 
80
 
81
	mov cx,ID_BUT_COPY
81
	mov cx,ID_BUT_COPY
82
	bt word[panel_but+6],0
82
	bt word[panel_but+6],0
83
	jnc @f
83
	jnc @f
84
		add edx,25 shl 16
84
		add edx,25 shl 16
85
		call draw_but_icon ;Copy
85
		call draw_but_icon ;Copy
86
	@@:
86
	@@:
87
	or ecx,0x40000000
87
	or ecx,0x40000000
88
 
88
 
89
	cmp dword[buf],0
89
	cmp dword[buf],0
90
	jne @f
90
	jne @f
91
		and ecx,0xffff
91
		and ecx,0xffff
92
	@@:
92
	@@:
93
	mov cx,ID_BUT_PASTE
93
	mov cx,ID_BUT_PASTE
94
	bt word[panel_but+7],0
94
	bt word[panel_but+7],0
95
	jnc @f
95
	jnc @f
96
		add edx,25 shl 16
96
		add edx,25 shl 16
97
		call draw_but_icon ;Paste
97
		call draw_but_icon ;Paste
98
	@@:
98
	@@:
99
	or ecx,0x40000000
99
	or ecx,0x40000000
100
 
100
 
101
	mov cx,ID_BUT_FIND
101
	mov cx,ID_BUT_FIND
102
	bt word[panel_but+8],0
102
	bt word[panel_but+8],0
103
	jnc @f
103
	jnc @f
104
		add edx,25 shl 16
104
		add edx,25 shl 16
105
		call draw_but_icon ;Found
105
		call draw_but_icon ;Found
106
	@@:
106
	@@:
107
 
107
 
108
	mov cx,ID_BUT_REPLACE
108
	mov cx,ID_BUT_REPLACE
109
	bt word[panel_but+9],0
109
	bt word[panel_but+9],0
110
	jnc @f
110
	jnc @f
111
		add edx,25 shl 16
111
		add edx,25 shl 16
112
		call draw_but_icon ;Replace
112
		call draw_but_icon ;Replace
113
	@@:
113
	@@:
114
 
114
 
115
	mov cx,ID_BUT_KEY_WORDS
115
	mov cx,ID_BUT_KEY_WORDS
116
	bt word[panel_but+10],0
116
	bt word[panel_but+10],0
117
	jnc @f
117
	jnc @f
118
		add edx,25 shl 16
118
		add edx,25 shl 16
119
		call draw_but_icon ;Key words
119
		call draw_but_icon ;Key words
120
	@@:
120
	@@:
121
 
121
 
122
	call [ted_is_select]
122
	call [ted_is_select]
123
	or al,al
123
	or al,al
124
	jnz @f
124
	jnz @f
125
		and ecx,0xffff
125
		and ecx,0xffff
126
	@@:
126
	@@:
127
	mov cx,ID_BUT_UPPER
127
	mov cx,ID_BUT_UPPER
128
	bt word[panel_but+11],0
128
	bt word[panel_but+11],0
129
	jnc @f
129
	jnc @f
130
		add edx,30 shl 16
130
		add edx,30 shl 16
131
		call draw_but_icon ;Upper
131
		call draw_but_icon ;Upper
132
	@@:
132
	@@:
133
 
133
 
134
	mov cx,ID_BUT_LOWER
134
	mov cx,ID_BUT_LOWER
135
	bt word[panel_but+12],0
135
	bt word[panel_but+12],0
136
	jnc @f
136
	jnc @f
137
		add edx,25 shl 16
137
		add edx,25 shl 16
138
		call draw_but_icon ;Lower
138
		call draw_but_icon ;Lower
139
	@@:
139
	@@:
140
 
140
 
141
	mov cx,ID_BUT_REVERSE
141
	mov cx,ID_BUT_REVERSE
142
	bt word[panel_but+13],0
142
	bt word[panel_but+13],0
143
	jnc @f
143
	jnc @f
144
		add edx,25 shl 16
144
		add edx,25 shl 16
145
		call draw_but_icon ;Reverse
145
		call draw_but_icon ;Reverse
146
	@@:
146
	@@:
147
	or ecx,0x40000000
147
	or ecx,0x40000000
148
 
148
 
149
	mov ebx,ted_tim_undo
149
	mov ebx,ted_tim_undo
150
	cmp ted_tim_ch,ebx
150
	cmp ted_tim_ch,ebx
151
	jg @f
151
	jg @f
152
		and ecx,0xffff
152
		and ecx,0xffff
153
	@@:
153
	@@:
154
	mov cx,ID_BUT_UNDO
154
	mov cx,ID_BUT_UNDO
155
	bt word[panel_but+14],0
155
	bt word[panel_but+14],0
156
	jnc @f
156
	jnc @f
157
		add edx,30 shl 16
157
		add edx,30 shl 16
158
		call draw_but_icon ;Undo
158
		call draw_but_icon ;Undo
159
	@@:
159
	@@:
160
	or ecx,0x40000000
160
	or ecx,0x40000000
161
 
161
 
162
	cmp ted_tim_undo,1
162
	cmp ted_tim_undo,1
163
	jge @f
163
	jge @f
164
		and ecx,0xffff
164
		and ecx,0xffff
165
	@@:
165
	@@:
166
	mov cx,ID_BUT_REDO
166
	mov cx,ID_BUT_REDO
167
	bt word[panel_but+15],0
167
	bt word[panel_but+15],0
168
	jnc @f
168
	jnc @f
169
		add edx,25 shl 16
169
		add edx,25 shl 16
170
		call draw_but_icon ;Redo
170
		call draw_but_icon ;Redo
171
	@@:
171
	@@:
172
	or ecx,0x40000000
172
	or ecx,0x40000000
173
 
173
 
174
	mov cx,ID_BUT_INVISIBLE
174
	mov cx,ID_BUT_INVISIBLE
175
	bt word[panel_but+16],0
175
	bt word[panel_but+16],0
176
	jnc @f
176
	jnc @f
177
		add edx,30 shl 16
177
		add edx,30 shl 16
178
		call draw_but_icon ;Invisible on|off
178
		call draw_but_icon ;Invisible on|off
179
	@@:
179
	@@:
180
 
180
 
181
	mov cx,ID_BUT_SYNTAX_LIST
181
	mov cx,ID_BUT_SYNTAX_LIST
182
	bt word[panel_but+17],0
182
	bt word[panel_but+17],0
183
	jnc @f
183
	jnc @f
184
		add edx,25 shl 16
184
		add edx,25 shl 16
185
		call draw_but_icon ;Âûáîð ôàéëà ïîäñâåòêè
185
		call draw_but_icon ;Âûáîð ôàéëà ïîäñâåòêè
186
	@@:
186
	@@:
187
 
187
 
188
	mov cx,ID_BUT_SYNTAX_MODE
188
	mov cx,ID_BUT_SYNTAX_MODE
189
	bt word[panel_but+18],0
189
	bt word[panel_but+18],0
190
	jnc @f
190
	jnc @f
191
		add edx,25 shl 16
191
		add edx,25 shl 16
192
		call draw_but_icon ;Ïîäñâåòêà âêë|âûêë
192
		call draw_but_icon ;Ïîäñâåòêà âêë|âûêë
193
	@@:
193
	@@:
194
 
194
 
195
	mov cx,ID_BUT_CONVERT_1251_866
195
	mov cx,ID_BUT_CONVERT_1251_866
196
	bt word[panel_but+19],0
196
	bt word[panel_but+19],0
197
	jnc @f
197
	jnc @f
198
		add edx,30 shl 16
198
		add edx,30 shl 16
199
		call draw_but_icon ;cp 1251 -> 866
199
		call draw_but_icon ;cp 1251 -> 866
200
	@@:
200
	@@:
201
 
201
 
202
	mov cx,ID_BUT_CONVERT_866_1251
202
	mov cx,ID_BUT_CONVERT_866_1251
203
	bt word[panel_but+20],0
203
	bt word[panel_but+20],0
204
	jnc @f
204
	jnc @f
205
		add edx,25 shl 16
205
		add edx,25 shl 16
206
		call draw_but_icon ;cp 866 -> 1251
206
		call draw_but_icon ;cp 866 -> 1251
207
	@@:
207
	@@:
208
 
208
 
209
	popad
209
	popad
210
	ret
210
	ret
211
 
211
 
212
;txtBUp db 24
212
;txtBUp db 24
213
;txtBDn db 25
213
;txtBDn db 25
214
;txtBRi db 26
214
;txtBRi db 26
215
;txtBLe db 27
215
;txtBLe db 27
216
 
216
 
217
;input:
217
;input:
218
; edi = pointer to tedit struct
218
; edi = pointer to tedit struct
219
align 4
219
align 4
220
proc draw_panel_find
220
proc draw_panel_find
221
	cmp ted_panel_id,TED_PANEL_FIND ;if not panel
221
	cmp ted_panel_id,TED_PANEL_FIND
222
	jne @f
222
	jne @f
223
	push eax ebx ecx edx
223
		call p_find
224
		mov ecx,ted_wnd_t
224
		jmp .end_f
-
 
225
	@@:
-
 
226
	cmp ted_panel_id,TED_PANEL_REPLACE
-
 
227
	jne @f
-
 
228
		call p_replace
-
 
229
		jmp .end_f
-
 
230
	@@:
-
 
231
	push eax edx
-
 
232
		mcall SF_DEFINE_BUTTON,,,0x80000000+201
-
 
233
		mcall ,,,0x80000000+202
-
 
234
		mcall ,,,0x80000000+203
-
 
235
	pop edx eax
-
 
236
	.end_f:
-
 
237
	ret
-
 
238
endp
-
 
239
 
-
 
240
align 4
-
 
241
p_find:
-
 
242
	push eax ebx ecx edx
-
 
243
		mov ecx,ted_wnd_t
225
		shl ecx,16
244
		shl ecx,16
226
		mov cx,20
245
		mov cx,20
227
		mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
246
		mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
228
 
247
 
229
		mov ebx,(30 shl 16)+25
248
		mov ecx,ted_wnd_t
-
 
249
		add cx,20+15 ; 15 - height text box
-
 
250
		shl ecx,16
-
 
251
		add ecx,ted_wnd_h
-
 
252
		mov edx,ted_scr_h
-
 
253
		add cx,word[edx+sb_offs_size_y]
-
 
254
		sub cx,20+15-1 ; 15 - height text box
-
 
255
		mcall ,,,[sc.work]
-
 
256
 
-
 
257
		stdcall [edit_box_draw], edit2
-
 
258
 
-
 
259
		mov ecx,ted_wnd_t
-
 
260
		shl ecx,16
-
 
261
		add ecx,(93 shl 16)+20
-
 
262
		mcall SF_DEFINE_BUTTON,(5 shl 16)+85,,201,[sc.work_button] ;201 - button id
-
 
263
 
-
 
264
		mov ebx,(23 shl 16)+7
230
		add ebx,ted_wnd_t
265
		add ebx,ted_wnd_t
231
		mov ecx,[sc.work_text]
266
		mov ecx,[sc.work_text]
232
		or ecx,0x80000000
267
		or ecx,0x80000000
233
		mcall SF_DRAW_TEXT,,,txtFindCapt
268
		mcall SF_DRAW_TEXT,,,txtFindCapt
234
 
269
 
235
		stdcall [edit_box_draw], edit2
270
		mov ecx,[sc.work_button_text]
-
 
271
		or ecx,0x80000000
-
 
272
		mov ebx,(15 shl 16)+100
-
 
273
		add ebx,ted_wnd_t
-
 
274
		mcall ,,,txtFindNext
-
 
275
 
-
 
276
		stdcall [option_box_draw], opt_grlist1
236
 
277
	pop edx ecx ebx eax
-
 
278
	ret
-
 
279
 
-
 
280
align 4
-
 
281
p_replace:
-
 
282
	push eax ebx ecx edx
-
 
283
		mov ecx,ted_wnd_t
-
 
284
		shl ecx,16
-
 
285
		mov cx,20
-
 
286
		mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
-
 
287
 
237
		mov ecx,ted_wnd_t
288
		mov ecx,ted_wnd_t
238
		add cx,20+15 ; 15 - height text box
289
		add cx,20+15 ; 15 - height text box
239
		shl ecx,16
290
		shl ecx,16
240
		add ecx,ted_wnd_h
291
		add ecx,ted_wnd_h
241
		mov edx,ted_scr_h
292
		mov edx,ted_scr_h
242
		add cx,word[edx+sb_offs_size_y]
293
		add cx,word[edx+sb_offs_size_y]
243
		sub cx,20+15-1 ; 15 - height text box
294
		sub cx,20+15-1 ; 15 - height text box
244
		mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
295
		mcall ,,,[sc.work]
245
 
296
 
246
		mov ecx,ted_wnd_t
297
		stdcall [edit_box_draw], edit1
-
 
298
		stdcall [edit_box_draw], edit2
-
 
299
 
-
 
300
		mov ecx,ted_wnd_t
247
		add cx,20+15+5
301
		shl ecx,16
248
		shl ecx,16
-
 
249
		mov cx,20
302
		add ecx,(133 shl 16)+20
250
		mcall SF_DEFINE_BUTTON,(5 shl 16)+85,,201,[sc.work_button] ;201 - button id
303
		mcall SF_DEFINE_BUTTON,(5 shl 16)+95,,202,[sc.work_button] ;replace next
251
 
304
 
252
		mov ebx,(15 shl 16)+(20+15+10)
305
		add ecx,(26 shl 16)
-
 
306
		mcall ,,,203 ;replace all
-
 
307
 
253
		add ebx,ted_wnd_t
308
		mov ebx,ted_wnd_t
-
 
309
		add ebx,(23 shl 16)+7
254
		mov ecx,[sc.work_text]
310
		mov ecx,[sc.work_text]
255
		or ecx,0x80000000
311
		or ecx,0x80000000
256
		mcall SF_DRAW_TEXT,,,txtFindNext
312
		mcall SF_DRAW_TEXT,,,txtFindCapt
-
 
313
		add ebx,93
-
 
314
		mcall SF_DRAW_TEXT,,,txtRerlaceCapt
-
 
315
 
-
 
316
		mov ecx,[sc.work_button_text]
-
 
317
		or ecx,0x80000000
-
 
318
		mov ebx,ted_wnd_t
-
 
319
		add ebx,(15 shl 16)+140
-
 
320
		mcall ,,,txtRerlace
-
 
321
		add ebx,26
-
 
322
		mcall ,,,txtRerlaceAll
-
 
323
 
-
 
324
		stdcall [option_box_draw], opt_grlist1
257
	pop edx ecx ebx eax
325
	pop edx ecx ebx eax
258
	jmp .end_f
-
 
259
	@@:
-
 
260
	push eax edx
-
 
261
		mov edx,201
-
 
262
		or edx,0x80000000
-
 
263
		mcall SF_DEFINE_BUTTON
-
 
264
	pop edx eax
-
 
265
	.end_f:
-
 
266
	ret
326
	ret
267
endp
-
 
268
 
327
 
269
;input:
328
;input:
270
; edi = pointer to tedit struct
329
; edi = pointer to tedit struct
271
align 4
330
align 4
272
proc draw_panel_syntax
331
proc draw_panel_syntax
273
	cmp ted_panel_id,TED_PANEL_SYNTAX ;if not panel
332
	cmp ted_panel_id,TED_PANEL_SYNTAX ;if not panel
274
	jne @f
333
	jne @f
275
	pushad
334
	pushad
276
 
335
 
277
	mov ecx,ted_wnd_t
336
	mov ecx,ted_wnd_t
278
	shl ecx,16
337
	shl ecx,16
279
	mov cx,20
338
	mov cx,20
280
	mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work] ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
339
	mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work] ;ðèñîâàíèå âåðõíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
281
 
340
 
282
	stdcall dword[tl_draw], tree1
341
	stdcall dword[tl_draw], tree1
283
	mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà
342
	mov [ws_dir_lbox.all_redraw],1 ;äëÿ ïîëíîé ïåðåðèñîâêè äî÷åðíåãî ñêðîëëèíãà
284
	stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
343
	stdcall dword[scrollbar_ver_draw], dword ws_dir_lbox
285
 
344
 
286
	ror ecx,16
345
	ror ecx,16
287
	add ecx,dword[tree1.box_height]
346
	add ecx,dword[tree1.box_height]
288
	add ecx,20
347
	add ecx,20
289
	and ecx,0xffff
348
	and ecx,0xffff
290
	ror ecx,16
349
	ror ecx,16
291
	add ecx,ted_wnd_h
350
	add ecx,ted_wnd_h
292
	mov esi,ted_scr_h
351
	mov esi,ted_scr_h
293
	add cx,word[esi+sb_offs_size_y]
352
	add cx,word[esi+sb_offs_size_y]
294
	sub cx,20
353
	sub cx,20
295
	sub ecx,dword[tree1.box_height]
354
	sub ecx,dword[tree1.box_height]
296
	inc cx
355
	inc cx
297
	int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
356
	int 0x40 ;ðèñîâàíèå íèæíåãî ôîíîâîãî ïðÿìîóãîëüíèêà
298
 
357
 
299
	mov ecx,ted_wnd_t
358
	mov ecx,ted_wnd_t
300
	add ecx,25
359
	add ecx,25
301
	add ecx,dword[tree1.box_height]
360
	add ecx,dword[tree1.box_height]
302
	shl ecx,16
361
	shl ecx,16
303
	mov cx,20
362
	mov cx,20
304
	mcall SF_DEFINE_BUTTON,(5 shl 16)+65,,200,[sc.work_button] ;200 - button id
363
	mcall SF_DEFINE_BUTTON,(5 shl 16)+65,,200,[sc.work_button] ;200 - button id
305
 
364
 
306
	mov ebx,(30 shl 16)+5
365
	mov ebx,(30 shl 16)+5
307
	add ebx,ted_wnd_t
366
	add ebx,ted_wnd_t
308
	mov ecx,[sc.work_text]
367
	mov ecx,[sc.work_text]
309
	or ecx,0x80000000
368
	or ecx,0x80000000
310
	mcall SF_DRAW_TEXT,,,txtFormatCapt
369
	mcall SF_DRAW_TEXT,,,txtFormatCapt
311
 
370
 
312
	mov ebx,(10 shl 16)+31
371
	mov ebx,(10 shl 16)+31
313
	add ebx,dword[tree1.box_height]
372
	add ebx,dword[tree1.box_height]
314
	add ebx,ted_wnd_t
373
	add ebx,ted_wnd_t
315
	mcall ,,,txtFormatApply
374
	mcall ,,,txtFormatApply
316
 
375
 
317
	popad
376
	popad
318
	jmp .end_f
377
	jmp .end_f
319
	@@:
378
	@@:
320
		push eax edx
379
		push eax edx
321
		mov edx,200
380
		mov edx,200
322
		or edx,0x80000000
381
		or edx,0x80000000
323
		mcall SF_DEFINE_BUTTON ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó
382
		mcall SF_DEFINE_BUTTON ;åñëè íåò ïàíåëè òî óäàëÿåì êíîïêó
324
		pop edx eax
383
		pop edx eax
325
	.end_f:
384
	.end_f:
326
	ret
385
	ret
327
endp
386
endp
328
 
387
 
329
MIN_M_WND_H equ 100 ;ìèíèìàëüíàÿ âûñîòà ãëàâíîãî îêíà
388
MIN_M_WND_H equ 100 ;ìèíèìàëüíàÿ âûñîòà ãëàâíîãî îêíà
330
;input:
389
;input:
331
; edi = pointer to tedit struct
390
; edi = pointer to tedit struct
332
align 4
391
align 4
333
EvSize:
392
EvSize:
334
	pushad
393
	pushad
335
	mov ebx,ted_scr_h
394
	mov ebx,ted_scr_h
336
	mov esi,ted_scr_w
395
	mov esi,ted_scr_w
337
 
396
 
338
	m2m ted_wnd_w,[procinfo.client_box.width] ;ñòàâèì øèðèíó îêíà ðåäàêòîðà ðàâíîé øèðèíå âñåãî îêíà
397
	m2m ted_wnd_w,[procinfo.client_box.width] ;ñòàâèì øèðèíó îêíà ðåäàêòîðà ðàâíîé øèðèíå âñåãî îêíà
339
	mov eax,ted_wnd_l
398
	mov eax,ted_wnd_l
340
	sub ted_wnd_w,eax ;îòíèìàåì îòñòóï ñëåâà
399
	sub ted_wnd_w,eax ;îòíèìàåì îòñòóï ñëåâà
341
	movzx eax,word[esi+sb_offs_size_x]
400
	movzx eax,word[esi+sb_offs_size_x]
342
	sub ted_wnd_w,eax ;îòíèìàåì øèðèíó âåðò. ñêðîëëèíãà
401
	sub ted_wnd_w,eax ;îòíèìàåì øèðèíó âåðò. ñêðîëëèíãà
343
 
402
 
344
	m2m ted_wnd_h,[procinfo.client_box.height] ;ñòàâèì âûñîòó îêíà ðåäàêòîðà ðàâíîé âûñîòå âñåãî îêíà
403
	m2m ted_wnd_h,[procinfo.client_box.height] ;ñòàâèì âûñîòó îêíà ðåäàêòîðà ðàâíîé âûñîòå âñåãî îêíà
345
	cmp ted_wnd_h,MIN_M_WND_H
404
	cmp ted_wnd_h,MIN_M_WND_H
346
	jg @f
405
	jg @f
347
		mov ted_wnd_h,MIN_M_WND_H
406
		mov ted_wnd_h,MIN_M_WND_H
348
	@@:
407
	@@:
349
 
408
 
350
	movzx eax,word[ebx+sb_offs_size_y]
409
	movzx eax,word[ebx+sb_offs_size_y]
351
	sub ted_wnd_h,eax	      ;îòíèìàåì âûñîòó ãîðèç. ñêðîëëèíãà
410
	sub ted_wnd_h,eax	      ;îòíèìàåì âûñîòó ãîðèç. ñêðîëëèíãà
352
	mov eax,ted_wnd_t
411
	mov eax,ted_wnd_t
353
	sub ted_wnd_h,eax	      ;îòíèìàåì îòñòóï ñâåðõó
412
	sub ted_wnd_h,eax	      ;îòíèìàåì îòñòóï ñâåðõó
354
 
413
 
355
	stdcall [ted_init_scroll_bars], tedit0,2
414
	stdcall [ted_init_scroll_bars], tedit0,2
356
 
415
 
357
	mov eax,ted_wnd_t
416
	mov eax,ted_wnd_t
358
	mov edi,dword tree1
417
	mov edi,tree1
359
	mov tl_box_top,eax ;=ted_wnd_t
418
	mov tl_box_top,eax ;=ted_wnd_t
360
	add tl_box_top,20
419
	add tl_box_top,20
361
 
420
 
362
	mov [edit2.top],eax ;=ted_wnd_t
421
	mov [edit2.top],eax ;=ted_wnd_t
363
	add dword[edit2.top],20
422
	add dword[edit2.top],20
364
 
423
	mov [edit1.top],eax ;=ted_wnd_t
365
	popad
424
	add dword[edit1.top],113
366
	ret
-
 
-
 
425
	popad
-
 
426
	ret
367
 
427
 
368
;input:
428
;input:
369
;  ecx = 0x4000____
429
;  ecx = 0x4000____
370
;   cx = ID button
430
;   cx = ID button
371
;  edx = x*2^16+y
431
;  edx = x*2^16+y
372
align 4
432
align 4
373
draw_but_icon:
433
draw_but_icon:
374
	push eax ebx
434
	push eax ebx
375
 
435
 
376
	mov eax,SF_DEFINE_BUTTON
436
	mov eax,SF_DEFINE_BUTTON
377
	push ecx edx esi
437
	push ecx edx esi
378
		mov ebx,edx
438
		mov ebx,edx
379
		mov edx,ecx
439
		mov edx,ecx
380
		mov cx,bx
440
		mov cx,bx
381
		shl ecx,16
441
		shl ecx,16
382
		mov cx,19 ;=20-1
442
		mov cx,19 ;=20-1
383
		mov bx,19 ;=20-1
443
		mov bx,19 ;=20-1
384
		mov esi,ebx
444
		mov esi,ebx
385
		shr esi,16
445
		shr esi,16
386
		add esi,20
446
		add esi,20
387
		cmp esi,[procinfo.client_box.width]
447
		cmp esi,[procinfo.client_box.width]
388
		jge @f ;êíîïêà íå âëåçëà â îêíî
448
		jge @f ;êíîïêà íå âëåçëà â îêíî
389
			mov esi,[sc.work_button]
449
			mov esi,[sc.work_button]
390
			int 0x40 ;ñòàâèì êíîïêó
450
			int 0x40 ;ñòàâèì êíîïêó
391
			mov eax,SF_PUT_IMAGE
451
			mov eax,SF_PUT_IMAGE
392
		@@:
452
		@@:
393
	pop esi edx ecx
453
	pop esi edx ecx
394
 
454
 
395
	cmp eax,SF_PUT_IMAGE
455
	cmp eax,SF_PUT_IMAGE
396
	jne @f ;êíîïêà íå âëåçëà â îêíî
456
	jne @f ;êíîïêà íå âëåçëà â îêíî
397
		mov ebx,[bmp_icon]
457
		mov ebx,[bmp_icon]
398
		bt ecx,30 ;if (ecx & 0x40000000)
458
		bt ecx,30 ;if (ecx & 0x40000000)
399
		jc .gray
459
		jc .gray
400
			add ebx,TOOLBAR_ICONS_SIZE ;ïåðåìåùàåìñÿ íà ñåðûå êíîïêè
460
			add ebx,TOOLBAR_ICONS_SIZE ;ïåðåìåùàåìñÿ íà ñåðûå êíîïêè
401
		.gray:
461
		.gray:
402
		push ecx
462
		push ecx
403
		sub ecx,ID_BUT_0
463
		sub ecx,ID_BUT_0
404
		and ecx,0xffff
464
		and ecx,0xffff
405
		imul ecx,1200
465
		imul ecx,1200
406
		add ebx,ecx
466
		add ebx,ecx
407
		mov ecx,(20 shl 16)+20
467
		mov ecx,(20 shl 16)+20
408
		int 0x40 ;ñòàâèì ðèñóíîê íà êíîïêó
468
		int 0x40 ;ñòàâèì ðèñóíîê íà êíîïêó
409
		pop ecx
469
		pop ecx
410
	@@:
470
	@@:
411
	pop ebx eax
471
	pop ebx eax
412
	ret
472
	ret
413
 
473
 
414
;descrition:
474
;descrition:
415
; ôóíêöèÿ äëÿ ãåíåðèðîâàíèÿ ñåðûõ èêîíîê
475
; ôóíêöèÿ äëÿ ãåíåðèðîâàíèÿ ñåðûõ èêîíîê
416
;input:
476
;input:
417
; buf_rgb - áóôåð ñ âõîäíûì 24 áèòíûì öâåòíûì èçîáðàæåíèåì
477
; buf_rgb - áóôåð ñ âõîäíûì 24 áèòíûì öâåòíûì èçîáðàæåíèåì
418
; buf_g24 - áóôåð ñ âûõîäíûì 24 áèòíûì ñåðûì èçîáðàæåíèåì
478
; buf_g24 - áóôåð ñ âûõîäíûì 24 áèòíûì ñåðûì èçîáðàæåíèåì
419
; pixels - ÷èñëî ïèêñåëåé â èçîáðàæåíèè
479
; pixels - ÷èñëî ïèêñåëåé â èçîáðàæåíèè
420
align 4
480
align 4
421
proc img_to_gray, buf_rgb:dword, buf_g24:dword, pixels:dword
481
proc img_to_gray, buf_rgb:dword, buf_g24:dword, pixels:dword
422
pushad
482
pushad
423
	mov esi,[buf_rgb]
483
	mov esi,[buf_rgb]
424
	mov edi,[buf_g24]
484
	mov edi,[buf_g24]
425
	mov ecx,[pixels]
485
	mov ecx,[pixels]
426
	mov ebx,3
486
	mov ebx,3
427
	@@:
487
	@@:
428
		movzx eax,byte[esi]
488
		movzx eax,byte[esi]
429
		movzx edx,byte[esi+1]
489
		movzx edx,byte[esi+1]
430
		add eax,edx
490
		add eax,edx
431
		movzx edx,byte[esi+2]
491
		movzx edx,byte[esi+2]
432
		add eax,edx
492
		add eax,edx
433
		xor edx,edx
493
		xor edx,edx
434
		div ebx ;shr eax,2
494
		div ebx ;shr eax,2
435
		mov ah,al
495
		mov ah,al
436
		mov word[edi],ax
496
		mov word[edi],ax
437
		mov byte[edi+2],al
497
		mov byte[edi+2],al
438
		add esi,3
498
		add esi,3
439
		add edi,3
499
		add edi,3
440
		loop @b
500
		loop @b
441
popad
501
popad
442
	ret
502
	ret
443
endp
503
endp