Subversion Repositories Kolibri OS

Rev

Rev 617 | Rev 824 | 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:
629 mikedld 212
	mov	ebx,[mainwnd_pos.w]
213
	add	ebx,-10-(ATOPH-6)-3
214
	push	ebx 2 (ATOPH-6) (ATOPH-6)
215
	call	draw_3d_panel
216
	shl	ebx,16
217
	add	ebx,ATOPH-6
218
	mcall	8,,<2,ATOPH-6>,<0x4000,2>
219
	and	ebx,0xFFFF0000
220
	add	ebx,(ATOPH-8)/2*65536+(ATOPH-8)/2
221
	mcall	4,,[sc.work_text],.cross,1
595 Rus 222
 
178 heavyiron 223
	ret
595 Rus 224
 
629 mikedld 225
.cross db 'x'
617 mikedld 226
endp
178 heavyiron 227
 
228
;-----------------------------------------------------------------------------
617 mikedld 229
proc draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
178 heavyiron 230
;-----------------------------------------------------------------------------
231
	cmp	[do_not_draw],1  ; return if drawing is not permitted
232
	jae	.exit
233
	pusha
234
 
259 mikedld 235
	mov	ecx,[p_info.client_box.height-2]
236
	mov	cx,word[p_info.client_box.height]
237
	sub	ecx,STATH*65536+STATH
280 mikedld 238
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
259 mikedld 239
 
178 heavyiron 240
;       mcall   9,p_info,-1
241
 
242
	mov	ecx,[p_info.client_box.height-2]
243
	mov	cx,word[p_info.client_box.height]
244
	sub	ecx,STATH*65536
245
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
246
 
247
	pushad
259 mikedld 248
	add	ecx,1*65536
249
	mov	cx,STATH
178 heavyiron 250
	mcall	13,<0,6*13>,,[cl_3d_normal]
251
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
252
	mov	ebx,(6*(s_modified.size+15)+1)*65536
253
	mov	bx,word[p_info.client_box.width]
254
	sub	bx,6*(s_modified.size+15)
255
	mcall
256
	popad
257
 
258
	add	ebx,6*(s_modified.size+2)*65536+6*(s_modified.size+2)
259
	mcall
260
 
261
	and	ecx,0x0000FFFF
262
	push	ecx
263
 
297 mikedld 264
	mov	eax,[cur_editor.Caret.Y]
178 heavyiron 265
	inc	eax
266
	mov	ecx,10
297 mikedld 267
	mov	edi,p_info+0x100
178 heavyiron 268
	cld
269
	call	uint2str
270
	mov	al,','
271
	stosb
297 mikedld 272
	mov	eax,[cur_editor.Caret.X]
178 heavyiron 273
	inc	eax
274
	call	uint2str
275
 
276
	pop	ebx
277
 
278
	lea	esi,[edi-p_info-0x100]
279
	lea	edi,[esi*3]
280
	shl	edi,16
281
 
282
	add	ebx,(1+6*6+3)*65536-STATH/2-3
283
	sub	ebx,edi
284
	mcall	4,,[sc.work_text],p_info+0x100
285
 
297 mikedld 286
	cmp	[cur_editor.Modified],0
178 heavyiron 287
	je	@f
288
	and	ebx,0x0000FFFF
289
	add	ebx,(1+12*6+12+1)*65536
290
	mcall	,,,s_modified,s_modified.size
291
 
292
    @@: cmp	[s_status],0
293
	je	@f
294
	and	ebx,0x0000FFFF
295
	add	ebx,6*(s_modified.size+16)*65536
296
	or	ecx, 80000000h
297
	mcall	,,,[s_status]
298
 
299
    @@: popa
300
 
301
  .exit:
302
	ret
617 mikedld 303
endp
178 heavyiron 304
 
617 mikedld 305
proc draw_fillrect ; ebx,ecx,edx
297 mikedld 306
	; ebx = 
307
	; ecx = 
308
	push	ebx ecx edx
309
	call	draw_framerect
310
	add	ebx,1*65536-2
311
	add	ecx,1*65536-2
312
	mcall	13,,,esi
313
	pop	edx ecx ebx
314
	ret
617 mikedld 315
endp
297 mikedld 316
 
617 mikedld 317
proc draw_framerect ; ebx,ecx,edx
297 mikedld 318
	; ebx = 
319
	; ecx = 
178 heavyiron 320
	push	ebx ecx
321
 
297 mikedld 322
	add	bx,[esp+6]	 ; ebx = 
323
	mov	cx,[esp+2]	 ; ecx = 
178 heavyiron 324
	dec	ebx
259 mikedld 325
	mcall	38
297 mikedld 326
	add	cx,[esp]	 ; ecx = 
178 heavyiron 327
	rol	ecx,16
297 mikedld 328
	add	cx,[esp]	 ; ecx = 
178 heavyiron 329
	sub	ecx,0x00010001
330
	mcall
331
 
297 mikedld 332
	mov	ebx,[esp+4]	 ; ebx = 
333
	mov	ecx,[esp]	 ; ecx = 
334
	mov	bx,[esp+6]	 ; ebx = 
178 heavyiron 335
	add	cx,[esp+2]
336
	dec	ecx
337
	mcall
338
	add	bx,[esp+4]
339
	rol	ebx,16
340
	add	bx,[esp+4]
341
	sub	ebx,0x00010001
342
	mcall
343
 
259 mikedld 344
	pop	ecx ebx
178 heavyiron 345
	ret
617 mikedld 346
endp
267 mikedld 347
 
617 mikedld 348
proc draw_check
280 mikedld 349
	push	bx
350
	shl	ebx,16
351
	pop	bx
352
	add	ebx,0x00010000
353
	push	cx
354
	shl	ecx,16
355
	pop	cx
356
	add	ecx,0x00020001
357
	mcall	38
358
	add	ecx,0x00010001
359
	mcall
360
	add	ebx,4
361
	sub	ecx,2
362
	mcall
363
	sub	ecx,0x00010001
364
	mcall
365
	ret
617 mikedld 366
endp
280 mikedld 367
 
617 mikedld 368
proc calc_middle
267 mikedld 369
	shr	eax,1
370
	shr	ebx,1
371
	and	eax,0x007F7F7F
372
	and	ebx,0x007F7F7F
373
	add	eax,ebx
374
	ret
617 mikedld 375
endp
267 mikedld 376
 
617 mikedld 377
proc calc_3d_colors
267 mikedld 378
	pushad
379
	m2m	[cl_3d_normal],[sc.work]
380
	m2m	[cl_3d_inset],[sc.work_graph]
381
	push	[cl_3d_normal]
382
	add	byte[esp],48
383
	jnc	@f
384
	mov	byte[esp],255
385
    @@: add	byte[esp+1],48
386
	jnc	@f
387
	mov	byte[esp+1],255
388
    @@: add	byte[esp+2],48
389
	jnc	@f
390
	mov	byte[esp+2],255
391
    @@: pop	[cl_3d_outset]
392
	mov	eax,[cl_3d_inset]
393
	mov	ebx,[cl_3d_outset]
394
	call	calc_middle
280 mikedld 395
	mov	ebx,[cl_3d_normal]
396
	call	calc_middle
267 mikedld 397
	mov	[cl_3d_pushed],eax
398
	mov	eax,[cl_3d_normal]
399
	mov	ebx,[sc.work_text]
400
	call	calc_middle
401
	mov	[cl_3d_grayed],eax
402
	popad
403
	ret
617 mikedld 404
endp
267 mikedld 405
 
617 mikedld 406
proc draw_3d_panel ; x,y,w,h
267 mikedld 407
	push	eax ebx ecx edx
408
	cmp	dword[esp+16+8],4
409
	jl	.exit
410
	cmp	dword[esp+16+4],4
411
	jl	.exit
412
	mov	ebx,[esp+16+16-2]
413
	mov	bx,[esp+16+8]
414
	inc	ebx
415
	mov	ecx,[esp+16+12-2]
416
	mov	cx,[esp+16+4]
417
	inc	ecx
418
	mcall	13,,,[cl_3d_normal]
419
	dec	ebx
420
	add	bx,[esp+16+16]
421
	mov	cx,[esp+16+12]
422
	mcall	38,,,[cl_3d_inset]
423
	add	ecx,[esp+16+4-2]
424
	add	cx,[esp+16+4]
425
	mcall
426
	mov	bx,[esp+16+16]
427
	mov	ecx,[esp+16+12-2]
428
	mov	cx,[esp+16+4]
429
	add	cx,[esp+16+12]
430
	mcall
431
	add	ebx,[esp+16+8-2]
432
	add	bx,[esp+16+8]
433
	mcall
434
	mov	ebx,[esp+16+16-2]
435
	mov	bx,[esp+16+8]
436
	add	bx,[esp+16+16]
437
	add	ebx,1*65536-1
438
	mov	ecx,[esp+16+12-2]
439
	mov	cx,[esp+16+12]
440
	add	ecx,0x00010001
441
	mcall	,,,[cl_3d_outset]
442
	mov	bx,[esp+16+16]
443
	inc	ebx
444
	mov	ecx,[esp+16+12-2]
445
	mov	cx,[esp+16+4]
446
	add	cx,[esp+16+12]
447
	add	ecx,2*65536-1
448
	mcall
449
  .exit:
450
	pop	edx ecx ebx eax
451
	ret	4*4
617 mikedld 452
endp