Subversion Repositories Kolibri OS

Rev

Rev 595 | Rev 629 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
178 heavyiron 1
;-----------------------------------------------------------------------------
617 mikedld 2
proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
178 heavyiron 3
;-----------------------------------------------------------------------------
4
 
5
	cmp	[just_from_popup],1
6
	jne	@f
7
	ret
8
    @@:
9
 
10
	mcall	48,3,sc,sizeof.system_colors
11
	call	calc_3d_colors
12
 
617 mikedld 13
	;mcall   12,1
14
	invoke	gfx.open,TRUE
15
	mov	[ctx],eax
178 heavyiron 16
 
617 mikedld 17
	;m2m     [sc.work],dword[color_tbl.back]
178 heavyiron 18
 
19
	mov	edx,[sc.work]
303 mikedld 20
	add	edx,0x73000000
178 heavyiron 21
	mov	ebx,[mainwnd_pos.x-2]
22
	mov	bx,word[mainwnd_pos.w]
23
	mov	ecx,[mainwnd_pos.y-2]
24
	mov	cx,word[mainwnd_pos.h]
25
	mcall	0,,,,,s_title
26
 
27
	mcall	9,p_info,-1
28
	mov	esi,p_info.box.left
29
	mov	edi,mainwnd_pos
30
	mov	ecx,4
31
	cld
32
	rep	movsd
33
 
34
	cmp	[p_info.client_box.height],LINEH
35
	jl	.exit.2
36
 
259 mikedld 37
	mov	[tab_bar.Bounds.Left],0
38
	mov	[tab_bar.Bounds.Top],ATOPH
39
	mov	eax,[p_info.client_box.width]
40
	mov	[tab_bar.Bounds.Right],eax
41
	mov	eax,[p_info.client_box.height]
42
	sub	eax,[bot_dlg_height]
43
	add	eax,-STATH-1
44
	mov	[tab_bar.Bounds.Bottom],eax
45
 
46
	call	align_editor_in_tab
47
 
178 heavyiron 48
	mov	[top_ofs],ATOPH;+1
49
 
259 mikedld 50
	mov	eax,[p_info.client_box.height]
51
	add	eax,-STATH+1;*3-2-2
178 heavyiron 52
	sub	eax,[bot_dlg_height]
53
	mov	[bot_ofs],eax
54
 
55
	call	draw_bottom_dialog
56
 
259 mikedld 57
;        mov     [do_not_draw],1 ; do_not_draw = true
178 heavyiron 58
 
259 mikedld 59
;        mov     ebx,eax
60
;        sub     ebx,[top_ofs]
61
;        sub     ebx,SCRLW*3+AMINS+5
62
;        js      .no_draw
178 heavyiron 63
 
259 mikedld 64
;        dec     [do_not_draw]    ; do_not_draw = false
65
;        sub     eax,SCRLW+3
66
;        sub     eax,[top_ofs]
67
;        cdq
68
;        mov     ebx,LINEH
69
;        div     ebx
70
;        mov     [lines.scr],eax
178 heavyiron 71
 
72
	inc	[top_ofs]
73
 
74
	call	draw_main_menu
75
 
76
	jmp	.exit
77
 
78
  .no_draw:
79
	mov	[top_ofs],2
80
	mov	eax,[p_info.client_box.height]
81
	inc	eax
82
	mov	[bot_ofs],eax
83
	sub	eax,2
84
	push	eax
85
	add	eax,-2-SCRLW
86
	cdq
87
	mov	ebx,LINEH
88
	idiv	ebx
89
	mov	[lines.scr],eax
90
	pop	eax
91
 
92
	mov	ebx,[p_info.client_box.height]
93
	sub	ebx,SCRLW*3+AMINS+2
94
	jns	@f
95
 
96
	inc	[do_not_draw]
97
 
98
	dec	eax
99
	cdq
100
	mov	ebx,LINEH
101
	idiv	ebx
102
	mov	[lines.scr],eax
103
 
104
	mov	eax,[p_info.client_box.width]
105
	cdq
106
	mov	ebx,6
107
	idiv	ebx
108
	mov	[columns.scr],eax
109
    @@:
110
 
111
  .exit:
259 mikedld 112
	call	draw_editor
113
	call	draw_tabctl
178 heavyiron 114
  .exit.2:
617 mikedld 115
	;mcall   12,2
116
	invoke	gfx.close,[ctx]
178 heavyiron 117
	ret
617 mikedld 118
endp
178 heavyiron 119
 
120
;-----------------------------------------------------------------------------
617 mikedld 121
proc draw_bottom_dialog ;/////////////////////////////////////////////////////
178 heavyiron 122
;-----------------------------------------------------------------------------
123
	cmp	[bot_dlg_height],0
124
	je	.exit
125
	pushad
617 mikedld 126
	invoke	gfx.pen.color,[ctx],[cl_3d_inset]
178 heavyiron 127
	mov	ecx,[bot_ofs]
128
	dec	ecx
617 mikedld 129
	invoke	gfx.line,[ctx],0,ecx,[p_info.client_box.width],ecx
130
	invoke	gfx.brush.color,[ctx],[cl_3d_normal]
131
	inc	ecx
132
	mov	eax,ecx
133
	add	eax,[bot_dlg_height]
134
	invoke	gfx.fillrect,[ctx],0,ecx,[p_info.client_box.width],eax
135
	;mov     ebx,[p_info.client_box.width]
136
	;mov     ecx,[bot_ofs]
137
	;dec     ecx
138
	;push    cx
139
	;shl     ecx,16
140
	;pop     cx
141
	;mcall   38,,,[cl_3d_inset]
142
	;mov     ecx,[bot_ofs-2]
143
	;mov     cx,word[bot_dlg_height]
144
	;dec     ecx
145
	;mov     ebx,[p_info.client_box.width]
146
	;inc     ebx
147
	;mcall   13,,,[cl_3d_normal]
178 heavyiron 148
	mov	al,1
149
	call	[bot_dlg_handler]
150
	popad
151
 
152
  .exit:
153
	ret
617 mikedld 154
endp
178 heavyiron 155
 
156
mi_sel	 dd ?
157
mi_cur	 dd -1
158
 
159
;-----------------------------------------------------------------------------
617 mikedld 160
proc draw_main_menu ;/////////////////////////////////////////////////////////
178 heavyiron 161
;-----------------------------------------------------------------------------
162
	mov	ebx,[p_info.client_box.width]
163
	inc	ebx
164
	mcall	13,,ATOPH-1,[cl_3d_normal]
165
 
280 mikedld 166
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
259 mikedld 167
 
178 heavyiron 168
	mov	edx,main_menu
280 mikedld 169
	mov	ebx,9*65536+ATOPH/2-3;4
178 heavyiron 170
	mov	[mi_sel],0
171
	mov	edi,[mi_cur]
172
    @@: inc	[mi_sel]
173
	cmp	[mi_sel],main_menu.cnt_item
174
	ja	.exit
280 mikedld 175
	mov	ecx,[sc.work_text]
178 heavyiron 176
	cmp	edi,[mi_sel]
177
	jne	.lp1
178
	pushad
179
	push	edx
280 mikedld 180
	mov	ecx,[edx+4]
181
	add	ecx,2*65536-2
297 mikedld 182
	mcall	13,[edx+0],,[sc.work]
178 heavyiron 183
	mov	edx,[esp]
280 mikedld 184
	mov	cx,[edx+6]
185
	add	ecx,-1*65536+1
186
	add	bx,[edx+2]
187
	mcall	38,,,[cl_3d_inset]
188
 
189
	mov	edx,[esp]
190
	add	cx,[edx+4]
191
	add	cx,-2
178 heavyiron 192
	mov	bx,[edx+2]
297 mikedld 193
	mcall	,,,[cl_3d_inset]
178 heavyiron 194
	pop	edx
195
	movzx	eax,word[edx]
196
	add	ebx,eax
197
	shl	eax,16
198
	add	ebx,eax
199
	mcall	38,,,[cl_3d_inset]
200
	popad
297 mikedld 201
	mov	ecx,[color_tbl.text]
178 heavyiron 202
  .lp1: add	edx,8+1
203
	movzx	esi,byte[edx-1]
204
	mcall	4
205
	add	edx,esi
206
	add	esi,2
207
	imul	esi,6*65536
208
	add	ebx,esi
209
	jmp	@b
210
 
211
  .exit:
595 Rus 212
	mov	eax, 8
213
	mov	bx, word [mainwnd_pos.w]
214
	sub	bx, 25
215
	shl	ebx, 16
216
	add	ebx, 12
217
 
218
	mov	ecx, 3 * 65536 + 12
219
	mov	edx, 177
220
	mov	esi, 0x00bcbec6
221
	int	0x40
222
 
223
	;mov     eax, 4
224
	shr	eax, 1
225
	sub	ebx, -4 * 65536
226
	mov	bx, 6
227
	mov	ecx, 0
228
	mov	edx, cross
229
	mov	esi, 1
230
	int	0x40
231
 
178 heavyiron 232
	ret
595 Rus 233
 
234
cross:
235
	db	'X'
617 mikedld 236
endp
178 heavyiron 237
 
238
;-----------------------------------------------------------------------------
617 mikedld 239
proc draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
178 heavyiron 240
;-----------------------------------------------------------------------------
241
	cmp	[do_not_draw],1  ; return if drawing is not permitted
242
	jae	.exit
243
	pusha
244
 
259 mikedld 245
	mov	ecx,[p_info.client_box.height-2]
246
	mov	cx,word[p_info.client_box.height]
247
	sub	ecx,STATH*65536+STATH
280 mikedld 248
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
259 mikedld 249
 
178 heavyiron 250
;       mcall   9,p_info,-1
251
 
252
	mov	ecx,[p_info.client_box.height-2]
253
	mov	cx,word[p_info.client_box.height]
254
	sub	ecx,STATH*65536
255
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
256
 
257
	pushad
259 mikedld 258
	add	ecx,1*65536
259
	mov	cx,STATH
178 heavyiron 260
	mcall	13,<0,6*13>,,[cl_3d_normal]
261
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
262
	mov	ebx,(6*(s_modified.size+15)+1)*65536
263
	mov	bx,word[p_info.client_box.width]
264
	sub	bx,6*(s_modified.size+15)
265
	mcall
266
	popad
267
 
268
	add	ebx,6*(s_modified.size+2)*65536+6*(s_modified.size+2)
269
	mcall
270
 
271
	and	ecx,0x0000FFFF
272
	push	ecx
273
 
297 mikedld 274
	mov	eax,[cur_editor.Caret.Y]
178 heavyiron 275
	inc	eax
276
	mov	ecx,10
297 mikedld 277
	mov	edi,p_info+0x100
178 heavyiron 278
	cld
279
	call	uint2str
280
	mov	al,','
281
	stosb
297 mikedld 282
	mov	eax,[cur_editor.Caret.X]
178 heavyiron 283
	inc	eax
284
	call	uint2str
285
 
286
	pop	ebx
287
 
288
	lea	esi,[edi-p_info-0x100]
289
	lea	edi,[esi*3]
290
	shl	edi,16
291
 
292
	add	ebx,(1+6*6+3)*65536-STATH/2-3
293
	sub	ebx,edi
294
	mcall	4,,[sc.work_text],p_info+0x100
295
 
297 mikedld 296
	cmp	[cur_editor.Modified],0
178 heavyiron 297
	je	@f
298
	and	ebx,0x0000FFFF
299
	add	ebx,(1+12*6+12+1)*65536
300
	mcall	,,,s_modified,s_modified.size
301
 
302
    @@: cmp	[s_status],0
303
	je	@f
304
	and	ebx,0x0000FFFF
305
	add	ebx,6*(s_modified.size+16)*65536
306
	or	ecx, 80000000h
307
	mcall	,,,[s_status]
308
 
309
    @@: popa
310
 
311
  .exit:
312
	ret
617 mikedld 313
endp
178 heavyiron 314
 
617 mikedld 315
proc draw_fillrect ; ebx,ecx,edx
297 mikedld 316
	; ebx = 
317
	; ecx = 
318
	push	ebx ecx edx
319
	call	draw_framerect
320
	add	ebx,1*65536-2
321
	add	ecx,1*65536-2
322
	mcall	13,,,esi
323
	pop	edx ecx ebx
324
	ret
617 mikedld 325
endp
297 mikedld 326
 
617 mikedld 327
proc draw_framerect ; ebx,ecx,edx
297 mikedld 328
	; ebx = 
329
	; ecx = 
178 heavyiron 330
	push	ebx ecx
331
 
297 mikedld 332
	add	bx,[esp+6]	 ; ebx = 
333
	mov	cx,[esp+2]	 ; ecx = 
178 heavyiron 334
	dec	ebx
259 mikedld 335
	mcall	38
297 mikedld 336
	add	cx,[esp]	 ; ecx = 
178 heavyiron 337
	rol	ecx,16
297 mikedld 338
	add	cx,[esp]	 ; ecx = 
178 heavyiron 339
	sub	ecx,0x00010001
340
	mcall
341
 
297 mikedld 342
	mov	ebx,[esp+4]	 ; ebx = 
343
	mov	ecx,[esp]	 ; ecx = 
344
	mov	bx,[esp+6]	 ; ebx = 
178 heavyiron 345
	add	cx,[esp+2]
346
	dec	ecx
347
	mcall
348
	add	bx,[esp+4]
349
	rol	ebx,16
350
	add	bx,[esp+4]
351
	sub	ebx,0x00010001
352
	mcall
353
 
259 mikedld 354
	pop	ecx ebx
178 heavyiron 355
	ret
617 mikedld 356
endp
267 mikedld 357
 
617 mikedld 358
proc draw_check
280 mikedld 359
	push	bx
360
	shl	ebx,16
361
	pop	bx
362
	add	ebx,0x00010000
363
	push	cx
364
	shl	ecx,16
365
	pop	cx
366
	add	ecx,0x00020001
367
	mcall	38
368
	add	ecx,0x00010001
369
	mcall
370
	add	ebx,4
371
	sub	ecx,2
372
	mcall
373
	sub	ecx,0x00010001
374
	mcall
375
	ret
617 mikedld 376
endp
280 mikedld 377
 
617 mikedld 378
proc calc_middle
267 mikedld 379
	shr	eax,1
380
	shr	ebx,1
381
	and	eax,0x007F7F7F
382
	and	ebx,0x007F7F7F
383
	add	eax,ebx
384
	ret
617 mikedld 385
endp
267 mikedld 386
 
617 mikedld 387
proc calc_3d_colors
267 mikedld 388
	pushad
389
	m2m	[cl_3d_normal],[sc.work]
390
	m2m	[cl_3d_inset],[sc.work_graph]
391
	push	[cl_3d_normal]
392
	add	byte[esp],48
393
	jnc	@f
394
	mov	byte[esp],255
395
    @@: add	byte[esp+1],48
396
	jnc	@f
397
	mov	byte[esp+1],255
398
    @@: add	byte[esp+2],48
399
	jnc	@f
400
	mov	byte[esp+2],255
401
    @@: pop	[cl_3d_outset]
402
	mov	eax,[cl_3d_inset]
403
	mov	ebx,[cl_3d_outset]
404
	call	calc_middle
280 mikedld 405
	mov	ebx,[cl_3d_normal]
406
	call	calc_middle
267 mikedld 407
	mov	[cl_3d_pushed],eax
408
	mov	eax,[cl_3d_normal]
409
	mov	ebx,[sc.work_text]
410
	call	calc_middle
411
	mov	[cl_3d_grayed],eax
412
	popad
413
	ret
617 mikedld 414
endp
267 mikedld 415
 
617 mikedld 416
proc draw_3d_panel ; x,y,w,h
267 mikedld 417
	push	eax ebx ecx edx
418
	cmp	dword[esp+16+8],4
419
	jl	.exit
420
	cmp	dword[esp+16+4],4
421
	jl	.exit
422
	mov	ebx,[esp+16+16-2]
423
	mov	bx,[esp+16+8]
424
	inc	ebx
425
	mov	ecx,[esp+16+12-2]
426
	mov	cx,[esp+16+4]
427
	inc	ecx
428
	mcall	13,,,[cl_3d_normal]
429
	dec	ebx
430
	add	bx,[esp+16+16]
431
	mov	cx,[esp+16+12]
432
	mcall	38,,,[cl_3d_inset]
433
	add	ecx,[esp+16+4-2]
434
	add	cx,[esp+16+4]
435
	mcall
436
	mov	bx,[esp+16+16]
437
	mov	ecx,[esp+16+12-2]
438
	mov	cx,[esp+16+4]
439
	add	cx,[esp+16+12]
440
	mcall
441
	add	ebx,[esp+16+8-2]
442
	add	bx,[esp+16+8]
443
	mcall
444
	mov	ebx,[esp+16+16-2]
445
	mov	bx,[esp+16+8]
446
	add	bx,[esp+16+16]
447
	add	ebx,1*65536-1
448
	mov	ecx,[esp+16+12-2]
449
	mov	cx,[esp+16+12]
450
	add	ecx,0x00010001
451
	mcall	,,,[cl_3d_outset]
452
	mov	bx,[esp+16+16]
453
	inc	ebx
454
	mov	ecx,[esp+16+12-2]
455
	mov	cx,[esp+16+4]
456
	add	cx,[esp+16+12]
457
	add	ecx,2*65536-1
458
	mcall
459
  .exit:
460
	pop	edx ecx ebx eax
461
	ret	4*4
617 mikedld 462
endp