Subversion Repositories Kolibri OS

Rev

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

Rev 4141 Rev 4152
Line 161... Line 161...
161
 
161
 
162
				break;				
162
				break;				
163
			case evKey:
163
			case evKey:
Line 164... Line -...
164
				key = GetKey();
-
 
165
 
-
 
166
				if (key == 177){ //down
-
 
167
					if (aim) break;
-
 
168
					if (mail_list.current >= mail_list.count-1) break;
-
 
169
					mail_list.current++ ;
-
 
170
					if (mail_list.current >= mail_list.first + mail_list.visible) mail_list.first++ ;
-
 
171
					DrawMailList();
-
 
172
					aim = SEND_RETR;
-
 
173
				}
-
 
174
				if (key == 178){ //up
164
				key = GetKey();
175
					if (aim) break;
-
 
176
					if (mail_list.current<=0) break;
-
 
177
					mail_list.current-- ;
-
 
178
					if (mail_list.current < mail_list.first) mail_list.first-- ;
-
 
179
					DrawMailList();
-
 
180
					aim = SEND_RETR;
-
 
181
				}
-
 
182
				if (key == 180){ //home
-
 
183
					if (aim) break;
-
 
184
					mail_list.first = mail_list.current = 0;
-
 
185
					DrawMailList();
165
 
186
					aim = SEND_RETR;
-
 
187
				}
-
 
188
				if (key == 181){ //end
-
 
189
					if (aim) break;
-
 
190
					mail_list.first = mail_list.count - mail_list.visible;
166
				if (!aim) && (mail_list.ProcessKey(key))
191
					mail_list.current = mail_list.count - 1; 
167
				{
192
					DrawMailList();
168
					DrawMailList();
Line 193... Line 169...
193
					aim = SEND_RETR;
169
					aim = SEND_RETR;
Line 283... Line 259...
283
					letter_size = atr.GetSize(mail_list.current+1) + 1024;
259
					letter_size = atr.GetSize(mail_list.current+1) + 1024;
284
					mailbuffer = malloc(letter_size);
260
					mailbuffer = malloc(letter_size);
285
					if (!mailbuffer) {debug("alloc error!"); aim=NULL; break;}					
261
					if (!mailbuffer) {debug("alloc error!"); aim=NULL; break;}					
286
					mailpointer = mailbuffer;
262
					mailpointer = mailbuffer;
287
					aim = GET_ANSWER_RETR;
263
					aim = GET_ANSWER_RETR;
-
 
264
					debugi(letter_size);
288
				}
265
				}
Line 289... Line 266...
289
				
266
				
290
				if (aim == GET_ANSWER_RETR)
267
				if (aim == GET_ANSWER_RETR)
291
				{
268
				{
-
 
269
					ticks = Receive(socketnum, mailpointer, letter_size + mailbuffer - mailpointer , MSG_DONTWAIT);
292
					ticks = Receive(socketnum, mailpointer, letter_size + mailbuffer - mailpointer , MSG_DONTWAIT);
270
					debugi(ticks);
293
					if (ticks == 0xffffffff) break;		
271
					if (ticks == 0xffffffff) break;		
Line 294... Line 272...
294
					//debugi(EAX);
272
					//debugi(EAX);
295
					
273
					
Line 350... Line 328...
350
	DrawBar(0, mail_list.y-3, mail_list.w,1, sc.work_graph);
328
	DrawBar(0, mail_list.y-3, mail_list.w,1, sc.work_graph);
351
	DrawBar(0, mail_list.y-2, mail_list.w,1, 0xdfdfdf);
329
	DrawBar(0, mail_list.y-2, mail_list.w,1, 0xdfdfdf);
352
	DrawBar(0, mail_list.y-1, mail_list.w,1, 0xf0f0f0);
330
	DrawBar(0, mail_list.y-1, mail_list.w,1, 0xf0f0f0);
353
}
331
}
Line 354... Line -...
354
 
-
 
355
 
332
 
356
void DrawMailList()
333
void DrawMailList()
357
{
334
{
-
 
335
	int i, on_y, on_x, direction;
358
	int i, on_y, on_x, direction;
336
	dword sel_col;
Line 359... Line 337...
359
	mail_list.visible = mail_list.h / mail_list.line_h;
337
	mail_list.visible = mail_list.h / mail_list.line_h;
360
 
338
 
361
	for (i=30; i<150; i++) DeleteButton(i); 
339
	for (i=30; i<150; i++) DeleteButton(i); 
362
	for (i=0; (i
340
	for (i=0; (i
363
	{
341
	{
364
		on_y = i*mail_list.line_h + mail_list.y;
-
 
365
		if (mail_list.current==mail_list.first+i)
342
		on_y = i*mail_list.line_h + mail_list.y;
366
		{
-
 
367
			DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xEEEeee);
-
 
368
		}
-
 
369
		else
-
 
370
		{
-
 
371
			DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xFFFfff);
343
		if (mail_list.current==mail_list.first+i) sel_col=0xEEEeee; else sel_col=0xFFFfff;
372
		}
344
		DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, sel_col);
-
 
345
		direction = atr.GetDirection(i+mail_list.first+1);
-
 
346
		on_x = strlen(itoa(i+mail_list.first+1))*6;
373
		direction = atr.GetDirection(i+mail_list.first+1);
347
		letter_icons_pal[0]=sel_col;
374
		on_x = strlen(itoa(i+mail_list.first+1))*6;
348
		PutPaletteImage(sizeof(letter_icons)/3*direction + #letter_icons, 18,12, on_x+18,
375
		_PutImage(on_x + 18, mail_list.line_h-12/2+ on_y, 18,12, sizeof(in_out_mail)/3*direction + #in_out_mail);
349
			mail_list.line_h-12/2+ on_y, 8, #letter_icons_pal);
376
		WriteText(on_x + 42, on_y+5, 0x80, 0, atr.GetSubject(i+mail_list.first+1));
350
		WriteText(on_x + 42, on_y+5, 0x80, 0, atr.GetSubject(i+mail_list.first+1));
377
		DefineButton(0, on_y, mail_list.w-1, mail_list.line_h, 30+i+BT_HIDE+BT_NOFRAME);
351
		DefineButton(0, on_y, mail_list.w-1, mail_list.line_h, 30+i+BT_HIDE+BT_NOFRAME);
378
		DrawBar(0, on_y + mail_list.line_h-1, mail_list.w, 1, 0xCCCccc);
352
		DrawBar(0, on_y + mail_list.line_h-1, mail_list.w, 1, 0xCCCccc);