Subversion Repositories Kolibri OS

Rev

Rev 2549 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4385 hidnplayr 1
include '../../../proc32.inc'
1547 Asper 2
 
2549 leency 3
macro start_draw_window x,y,xsize,ysize,areacolor,caption
1547 Asper 4
{
5
	;pusha
6
	mov	eax, 12 		; function 12:tell os about windowdraw
7
	mov	ebx, 1			; 1, start of draw
8
	int	0x40
9
	; DRAW WINDOW
2549 leency 10
	mov	eax, 0			     ; function 0 : define and draw window
11
	mov	ebx, x*65536+xsize	 ; [x start] *65536 + [x size]
12
	mov	ecx, y*65536+ysize	 ; [y start] *65536 + [y size]
1547 Asper 13
	mov	edx, areacolor		 ; color of work area RRGGBB
2549 leency 14
	mov	edi, caption         ; color of frames    RRGGBB
1547 Asper 15
	int	0x40
16
	;popa
17
}
18
 
19
macro end_draw_window
20
{
21
	mov	eax, 12 		; end of redraw
22
	mov	ebx, 2
23
	int	0x40
24
}
25
 
26
proc draw_button stdcall, x:dword, y:dword, xsize:dword, ysize:dword, \
27
	id:dword, butcolor:dword, text:dword, textlen:byte, textcolor:dword
28
 
29
	;pusha
30
	mov	ebx, dword [x]
31
	shl	ebx, 16
32
	add	ebx, dword [xsize]	  ; [x start] *65536 + [x size]
33
 
34
	mov	ecx, dword [y]
35
	shl	ecx, 16
36
	add	ecx, dword [ysize]	  ; [y start] *65536 + [y size]
37
 
38
	mov	edx, dword [id] 		; button id
39
	mov	esi, dword [butcolor]		; button color RRGGBB
40
	mov	eax, 8			; function 8 : define and draw button
41
	int	0x40
42
 
43
	mov	ebx, dword [x]
44
	add	ebx, 5
45
	shl	ebx, 16
46
	mov	eax, dword [ysize]
47
	sub	eax, 5
48
	shr	eax, 1
49
	add	ebx, eax
50
	add	ebx, dword [y]	;mov    ebx, (x+5)*65536+y+(ysize-5)/2  ; Draw button text
51
 
52
	mov	ecx, dword [textcolor]
53
	mov	edx, dword [text]
54
	xor	eax, eax
55
	mov	al,  byte [textlen]
56
	mov	esi, eax
57
	mov	eax, 4
58
	int	0x40
59
	;popa
60
ret
61
endp
62
 
63
macro outtextxy x,y,prompt,prompt_len,color
64
{
65
	pusha
66
	mov	ebx, x*65536+y	       ; draw info text with function 4
67
	mov	ecx, color
68
	mov	edx, prompt
69
	xor	eax, eax
70
	mov	al,  prompt_len
71
	mov	esi, eax
72
	mov	eax, 4
73
	int	0x40
74
	popa
75
}
76
 
77
;proc bar x:dword, y:dword, xsize:dword, ysize:dword, color:dword
78
macro bar x, y, xsize, ysize, color
79
{
80
	pusha
81
	mov eax, 13
82
	;mov ebx, [x]
83
	;shl ebx, 16
84
	;add ebx, [xsize]
85
	;mov ecx, [y]
86
	;shl ecx, 16
87
	;add ecx, [ysize]
88
	;mov edx, [color]
89
	mov	ebx, x*65536+xsize
90
	mov	ecx, y*65536+ysize
91
	mov edx, color
92
 
93
	int 0x40
94
	popa
95
;ret
96
;endp
97
}
98
 
99
macro line x1,y1,x2,y2,color
100
{
101
  pusha
102
  mov eax, 38
103
  mov ebx, x1*65536+x2
104
  mov ecx, y1*65536+y2
105
  mov edx, color
106
  int 0x40
107
  popa
108
}
109
 
110
macro rectangle x,y,xsize,ysize,color
111
{
112
  x2=x+xsize
113
  y2=y+ysize
114
  line x,y,x2,y,color
115
  line x,y,x,y2,color
116
  line x,y2,x2,y2,color
117
  line x2,y,x2,y2,color
118
}
119
 
120
macro putpixel x,y,color
121
{
122
  mov eax, 1
123
  mov ebx, x
124
  mov ecx, y
125
  mov edx, color
126
  int 0x40
127
}
128