Subversion Repositories Kolibri OS

Rev

Rev 7571 | Rev 7576 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7571 Rev 7573
Line -... Line 1...
-
 
1
align 16
-
 
2
draw_window:
-
 
3
	mcall SF_REDRAW,SSF_BEGIN_DRAW
-
 
4
 
-
 
5
	mov edx,[sc.work]
-
 
6
	or  edx,0x73000000
-
 
7
	mcall SF_CREATE_WINDOW,dword[wnd_s_pos],dword[wnd_s_pos+4],,,hed
-
 
8
 
-
 
9
	mcall SF_THREAD_INFO,procinfo,-1
-
 
10
	mov edi,tedit0 ;çíà÷åíèå edi íóæíî äëÿ EvSize è ted_wnd_t
-
 
11
	call EvSize
-
 
12
 
-
 
13
	movzx ebx,word[procinfo.client_box.width]
-
 
14
	inc bx
-
 
15
	mcall SF_DRAW_RECT,,ted_wnd_t ;âåðõíèé ïðÿìîóãîëüíèê, äëÿ î÷èñòêè âåðõíåé ïàíåëè
-
 
16
	call draw_but_toolbar
-
 
17
	stdcall [kmainmenu_draw], [main_menu]
-
 
18
	stdcall [ted_draw], tedit0
-
 
19
 
-
 
20
	mcall SF_REDRAW,SSF_END_DRAW
-
 
21
	ret
-
 
22
 
-
 
23
align 4
-
 
24
draw_but_toolbar: ;ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
1
align 4
25
	pushad
2
draw_but_toolbar: ;ôóíêöèÿ äëÿ ðèñîâàíèÿ ïàíåëè èíñòðóìåíòîâ
26
	mov edi,tedit0
3
	pushad
27
 
4
	mov edi,tedit0
28
	mov ecx,0x40000000+ID_BUT_NEW
Line 5... Line 29...
5
 
29
	mov edx,(5 shl 16)+25
6
	mov ecx,0x40000000
30
	bt word[panel_but],0
7
	mov edx,(5 shl 16)+25
31
	jnc @f
8
	bt word[panel_but],0
32
		call draw_but_icon ;New
9
	jnc @f
33
	@@:
10
		call draw_but_icon ;New
34
 
Line 11... Line 35...
11
	@@:
35
	mov cx,ID_BUT_OPEN
12
 
36
	bt word[panel_but+1],0
13
	inc cx
37
	jnc @f
14
	bt word[panel_but+1],0
38
		add edx,25 shl 16
15
	jnc @f
39
		call draw_but_icon ;Open
16
		add edx,25 shl 16
40
	@@:
Line 20... Line 44...
20
	stdcall [ted_can_save],edi
44
	je @f
21
	cmp al,1
45
		and ecx,0xffff
22
	je @f
46
	@@:
23
		and ecx,0xffff
47
	mov cx,ID_BUT_SAVE
24
	@@:
48
	bt word[panel_but+2],0
25
	inc cx
49
	jnc @f
26
	bt word[panel_but+2],0
50
		add edx,25 shl 16
27
	jnc @f
51
		call draw_but_icon ;Save
28
		add edx,25 shl 16
52
	@@:
29
		call draw_but_icon ;Save
53
	or ecx,0x40000000
30
	@@:
54
 
31
	or ecx,0x40000000
55
	mov cx,ID_BUT_SAVE_AS
Line 32... Line 56...
32
 
56
	bt word[panel_but+3],0
33
	inc cx
57
	jnc @f
34
	bt word[panel_but+3],0
58
		add edx,25 shl 16
35
	jnc @f
59
		call draw_but_icon ;Save as
36
		add edx,25 shl 16
60
	@@:
37
		call draw_but_icon ;Save as
61
 
Line 38... Line 62...
38
	@@:
62
	mov cx,ID_BUT_SELECT
39
 
63
	bt word[panel_but+4],0
40
	inc cx
64
	jnc @f
41
	bt word[panel_but+4],0
65
		add edx,30 shl 16
42
	jnc @f
66
		call draw_but_icon ;Select word
43
		add edx,30 shl 16
67
	@@:
Line 47... Line 71...
47
	call [ted_is_select]
71
	jnz @f
48
	or al,al
72
		and ecx,0xffff
49
	jnz @f
73
	@@:
50
		and ecx,0xffff
74
	mov cx,ID_BUT_CUT
51
	@@:
75
	bt word[panel_but+5],0
52
	inc cx
76
	jnc @f
53
	bt word[panel_but+5],0
77
		add edx,25 shl 16
54
	jnc @f
78
		call draw_but_icon ;Cut
55
		add edx,25 shl 16
79
	@@:
56
		call draw_but_icon ;Cut
80
 
57
	@@:
81
	mov cx,ID_BUT_COPY
Line 58... Line 82...
58
 
82
	bt word[panel_but+6],0
59
	inc cx
83
	jnc @f
60
	bt word[panel_but+6],0
84
		add edx,25 shl 16
61
	jnc @f
85
		call draw_but_icon ;Copy
62
		add edx,25 shl 16
86
	@@:
63
		call draw_but_icon ;Copy
87
	or ecx,0x40000000
Line 66... Line 90...
66
 
90
	jne @f
67
	cmp dword[buf],0
91
		and ecx,0xffff
68
	jne @f
92
	@@:
69
		and ecx,0xffff
93
	mov cx,ID_BUT_PASTE
70
	@@:
94
	bt word[panel_but+7],0
71
	inc cx
95
	jnc @f
72
	bt word[panel_but+7],0
96
		add edx,25 shl 16
73
	jnc @f
97
		call draw_but_icon ;Paste
74
		add edx,25 shl 16
98
	@@:
75
		call draw_but_icon ;Paste
99
	or ecx,0x40000000
76
	@@:
100
 
Line 77... Line 101...
77
	or ecx,0x40000000
101
	mov cx,ID_BUT_FIND
78
 
102
	bt word[panel_but+8],0
79
	inc cx
103
	jnc @f
80
	bt word[panel_but+8],0
104
		add edx,25 shl 16
81
	jnc @f
105
		call draw_but_icon ;Found
82
		add edx,25 shl 16
106
	@@:
Line 83... Line 107...
83
		call draw_but_icon ;Found
107
 
84
	@@:
108
	mov cx,ID_BUT_REPLACE
85
 
109
	bt word[panel_but+9],0
86
	inc cx
110
	jnc @f
87
	bt word[panel_but+9],0
111
		add edx,25 shl 16
88
	jnc @f
112
		call draw_but_icon ;Replace
Line 89... Line 113...
89
		add edx,25 shl 16
113
	@@:
90
		call draw_but_icon ;Replace
114
 
91
	@@:
115
	mov cx,ID_BUT_KEY_WORDS
92
 
116
	bt word[panel_but+10],0
93
	inc cx
117
	jnc @f
94
	bt word[panel_but+10],0
118
		add edx,25 shl 16
Line 100... Line 124...
100
	call [ted_is_select]
124
	jnz @f
101
	or al,al
125
		and ecx,0xffff
102
	jnz @f
126
	@@:
103
		and ecx,0xffff
127
	mov cx,ID_BUT_UPPER
104
	@@:
128
	bt word[panel_but+11],0
105
	inc cx
129
	jnc @f
106
	bt word[panel_but+11],0
130
		add edx,30 shl 16
107
	jnc @f
131
		call draw_but_icon ;Upper
108
		add edx,30 shl 16
132
	@@:
109
		call draw_but_icon ;Upper
133
 
110
	@@:
134
	mov cx,ID_BUT_LOWER
Line 111... Line 135...
111
 
135
	bt word[panel_but+12],0
112
	inc cx
136
	jnc @f
113
	bt word[panel_but+12],0
137
		add edx,25 shl 16
114
	jnc @f
138
		call draw_but_icon ;Lower
115
		add edx,25 shl 16
139
	@@:
116
		call draw_but_icon ;Lower
140
 
Line 117... Line 141...
117
	@@:
141
	mov cx,ID_BUT_REVERSE
118
 
142
	bt word[panel_but+13],0
119
	inc cx
143
	jnc @f
120
	bt word[panel_but+13],0
144
		add edx,25 shl 16
121
	jnc @f
145
		call draw_but_icon ;Reverse
122
		add edx,25 shl 16
146
	@@:
Line 127... Line 151...
127
	mov ebx,ted_tim_undo
151
	jg @f
128
	cmp ted_tim_ch,ebx
152
		and ecx,0xffff
129
	jg @f
153
	@@:
130
		and ecx,0xffff
154
	mov cx,ID_BUT_UNDO
131
	@@:
155
	bt word[panel_but+14],0
132
	inc cx
156
	jnc @f
133
	bt word[panel_but+14],0
157
		add edx,30 shl 16
134
	jnc @f
158
		call draw_but_icon ;Undo
135
		add edx,30 shl 16
159
	@@:
136
		call draw_but_icon ;Undo
160
	or ecx,0x40000000
137
	@@:
161
 
Line 139... Line 163...
139
 
163
	jge @f
140
	cmp ted_tim_undo,1
164
		and ecx,0xffff
141
	jge @f
165
	@@:
142
		and ecx,0xffff
166
	mov cx,ID_BUT_REDO
143
	@@:
167
	bt word[panel_but+15],0
144
	inc cx
168
	jnc @f
145
	bt word[panel_but+15],0
169
		add edx,25 shl 16
146
	jnc @f
170
		call draw_but_icon ;Redo
147
		add edx,25 shl 16
171
	@@:
148
		call draw_but_icon ;Redo
172
	or ecx,0x40000000
149
	@@:
173
 
Line 150... Line 174...
150
	or ecx,0x40000000
174
	mov cx,ID_BUT_INVISIBLE
151
 
175
	bt word[panel_but+16],0
152
	inc cx
176
	jnc @f
153
	bt word[panel_but+16],0
177
		add edx,30 shl 16
154
	jnc @f
178
		call draw_but_icon ;Invisible on|off
155
		add edx,30 shl 16
179
	@@:
Line 156... Line 180...
156
		call draw_but_icon ;Invisible on|off
180
 
157
	@@:
181
	mov cx,ID_BUT_SYNTAX_LIST
158
 
182
	bt word[panel_but+17],0
159
	inc cx
183
	jnc @f
160
	bt word[panel_but+17],0
184
		add edx,25 shl 16
161
	jnc @f
185
		call draw_but_icon ;Âûáîð ôàéëà ïîäñâåòêè
Line 162... Line 186...
162
		add edx,25 shl 16
186
	@@:
163
		call draw_but_icon ;Âûáîð ôàéëà ïîäñâåòêè
187
 
164
	@@:
188
	mov cx,ID_BUT_SYNTAX_MODE
165
 
189
	bt word[panel_but+18],0
166
	inc cx
190
	jnc @f
167
	bt word[panel_but+18],0
191
		add edx,25 shl 16
Line 168... Line 192...
168
	jnc @f
192
		call draw_but_icon ;Ïîäñâåòêà âêë|âûêë
169
		add edx,25 shl 16
193
	@@:
170
		call draw_but_icon ;Ïîäñâåòêà âêë|âûêë
194
 
171
	@@:
195
	mov cx,ID_BUT_CONVERT_1251_866
172
 
196
	bt word[panel_but+19],0
173
	inc cx
197
	jnc @f
Line 174... Line 198...
174
	bt word[panel_but+19],0
198
		add edx,30 shl 16
175
	jnc @f
199
		call draw_but_icon ;cp 1251 -> 866
176
		add edx,30 shl 16
200
	@@:
177
		call draw_but_icon ;cp 1251 -> 866
201
 
178
	@@:
202
	mov cx,ID_BUT_CONVERT_866_1251
179
 
203
	bt word[panel_but+20],0
Line 202... Line 226...
202
		mov ecx,ted_wnd_t
226
		mov cx,20
203
		shl ecx,16
227
		mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
204
		mov cx,20
228
 
205
		mcall SF_DRAW_RECT,TED_PANEL_WIDTH,,[sc.work]
229
		mov ebx,(30 shl 16)+25
Line 206... Line 230...
206
 
230
		add ebx,ted_wnd_t
207
		mov ebx,30*65536+25
231
		mov ecx,[sc.work_text]
208
		add ebx,ted_wnd_t
232
		or ecx,0x80000000
209
		mov ecx,[sc.work_text]
233
		mcall SF_DRAW_TEXT,,,txtFindCapt
210
		or ecx,0x80000000
234
 
Line 223... Line 247...
223
 
247
		add cx,20+15+5
224
		mov ecx,ted_wnd_t
248
		shl ecx,16
225
		add cx,20+15+5
249
		mov cx,20
226
		shl ecx,16
250
		mcall SF_DEFINE_BUTTON,(5 shl 16)+85,,201,[sc.work_button] ;201 - button id
227
		mov cx,20
251
 
Line 228... Line 252...
228
		mcall SF_DEFINE_BUTTON,5*65536+85,,201,[sc.work_button] ;201 - button id
252
		mov ebx,(15 shl 16)+(20+15+10)
229
 
253
		add ebx,ted_wnd_t
230
		mov ebx,15*65536+(20+15+10)
254
		mov ecx,[sc.work_text]
231
		add ebx,ted_wnd_t
255
		or ecx,0x80000000
232
		mov ecx,[sc.work_text]
256
		mcall SF_DRAW_TEXT,,,txtFindNext
233
		or ecx,0x80000000
257
	pop edx ecx ebx eax
Line 343... Line 367...
343
	popad
367
 
344
	ret
368
;input:
Line 345... Line 369...
345
 
369
;  ecx = 0x4000____
346
;input:
370
;   cx = ID button
347
;  ecx = 0x4000____
371
;  edx = x*2^16+y
348
;   cx = icon index
372
align 4
349
;  edx = x*2^16+y
373
draw_but_icon:
350
align 4
374
	push eax ebx
351
draw_but_icon:
375
 
Line 352... Line 376...
352
	push eax ebx
376
	mov eax,SF_DEFINE_BUTTON
353
 
377
	push ecx edx esi
354
	mov eax,SF_DEFINE_BUTTON
378
		mov ebx,edx
355
	push ecx edx esi
379
		mov edx,ecx
356
		mov ebx,edx
-
 
357
		mov edx,ecx
380
		mov cx,bx
358
		add edx,3
381
		shl ecx,16
359
		mov cx,bx
382
		mov cx,19 ;=20-1
360
		shl ecx,16
383
		mov bx,19 ;=20-1
361
		mov cx,19 ;=20-1
384
		mov esi,ebx
Line 377... Line 400...
377
		bt ecx,30 ;if (ecx & 0x40000000)
400
			add ebx,TOOLBAR_ICONS_SIZE ;ïåðåìåùàåìñÿ íà ñåðûå êíîïêè
378
		jc .gray
401
		.gray:
379
			add ebx,TOOLBAR_ICONS_SIZE ;ïåðåìåùàåìñÿ íà ñåðûå êíîïêè
402
		push ecx
380
		.gray:
403
		sub ecx,ID_BUT_0
381
		push ecx
404
		and ecx,0xffff
-
 
405
		imul ecx,1200
382
		and ecx,0xffff
406
		add ebx,ecx
383
		imul ecx,1200
407
		mov ecx,(20 shl 16)+20
384
		add ebx,ecx
408
		int 0x40 ;ñòàâèì ðèñóíîê íà êíîïêó
385
		mov ecx,(20 shl 16)+20
409
		pop ecx
386
		int 0x40 ;ñòàâèì ðèñóíîê íà êíîïêó
410
	@@: