Subversion Repositories Kolibri OS

Rev

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

Rev 1003 Rev 1006
Line 6... Line 6...
6
dword  final_addr   = #stop+32;
6
dword  final_addr   = #stop+32;
7
dword  alloc_mem    = 0x00100000;
7
dword  alloc_mem    = 0x00100000;
8
dword  x86esp_reg   = 0x0007fff0;
8
dword  x86esp_reg   = 0x0007fff0;
9
dword  I_Param      = 0x0;
9
dword  I_Param      = 0x0;
10
dword  I_Icon       = 0x0;
10
dword  I_Icon       = 0x0;
11
dword  skin_width;
-
 
Line 12... Line 11...
12
 
11
 
13
#define evButton  3
12
#define evButton  3
14
#define evKey     2
13
#define evKey     2
15
#define evReDraw  1
-
 
Line 16... Line 14...
16
#define evNet	  8
14
#define evReDraw  1
17
 
15
 
18
#define BT_DEL		0x80000000
16
#define BT_DEL		0x80000000
Line 84... Line 82...
84
 
82
 
85
void DefineButton(dword x,y,w,h,EDX,ESI)
83
void DefineButton(dword x,y,w,h,EDX,ESI)
86
{
84
{
87
 	EAX = 8;
85
 	EAX = 8;
88
	EBX = x<<16+w;
86
	EBX = x<<16+w;
89
	ECX = skin_width+y<<16+h;
87
	ECX = y<<16+h;
90
 	$int 0x40
88
 	$int 0x40
Line 91... Line 89...
91
}
89
}
92
 
90
 
93
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
91
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
94
{
92
{
95
	EAX = 4;
93
	EAX = 4;
96
	EBX = x<<16+skin_width+y;
94
	EBX = x<<16+y;
97
	ECX = fontType<<24+color;
95
	ECX = fontType<<24+color;
Line 98... Line 96...
98
	$int 0x40;
96
	$int 0x40;
99
}
97
}
100
 
98
 
101
 
99
 
102
void DrawBar(dword x,y,w,h,EDX)
100
void DrawBar(dword x,y,w,h,EDX)
103
{
101
{
104
	EAX = 13;
102
	EAX = 13;
Line 105... Line 103...
105
	EBX = x<<16+w;
103
	EBX = x<<16+w;
Line 127... Line 125...
127
	IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //îïðåäåëÿåì êíîïêó
125
	IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //îïðåäåëÿåì êíîïêó
128
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
126
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
129
}
127
}
Line 130... Line 128...
130
 
128
 
131
 
129
 
132
void PutImage(dword buf,w,h,x,y)
-
 
133
{
130
void PutImage(dword EBX,w,h,x,y)
134
	EDI=buf;
-
 
135
	EAX = 7;
131
{
136
	EBX = buf;
132
	EAX = 7;
137
	ECX = w<<16+h;
133
	ECX = w<<16+h;
138
	EDX = x<<16+y+skin_width;
134
	EDX = x<<16+y;
Line 139... Line 135...
139
	$int 0x40
135
	$int 0x40
Line 150... Line 146...
150
	$stosb
146
	$stosb
151
	$test al,al
147
	$test al,al
152
	$jnz l1
148
	$jnz l1
153
}
149
}
Line 154... Line -...
154
 
-
 
155
 
-
 
156
char	buffer[11]="";
150
 
157
inline fastcall dword IntToStr(dword ESI)
151
void WriteNumber(dword x,y,byte fontType, ESI, ECX)
158
{
-
 
159
     $mov     edi, #buffer
-
 
160
     $mov     ecx, 10
-
 
161
     $test     esi, esi
152
{
162
     $jns     f1
-
 
163
     $mov     al, '-'
153
	EAX = 47;
164
     $stosb
154
	EBX = 2<<16;
165
     $neg     esi
-
 
166
f1:
155
	/*ecx = 0
167
     $mov     eax, esi
-
 
168
     $push     -'0'
156
	while(eax>10)
169
f2:
-
 
170
     $xor     edx, edx
157
	{
171
     $div     ecx
-
 
172
     $push     edx
-
 
173
     $test     eax, eax
158
		ecx ++;
174
     $jnz     f2
159
		eax /= 10;
175
f3:
-
 
176
     $pop     eax
-
 
177
     $add     al, '0'
-
 
178
     $stosb
160
	}*/
179
     $jnz     f3
161
	EDX = x<<16+y;
180
     $mov     eax, #buffer
162
	ESI = fontType<<24+ESI;
181
     $ret
163
	$int 0x40;