forked from KolibriOS/kolibrios
letter icons wrap, key process using building library function
git-svn-id: svn://kolibrios.org@4152 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
659d2fcc62
commit
c683ddb194
@ -1,5 +1,5 @@
|
||||
..\C--\C-- liza.c
|
||||
@del liza_mail
|
||||
@rename liza.com liza_mail
|
||||
@del liza
|
||||
@rename liza.com liza
|
||||
@del warning.txt
|
||||
@pause
|
1
programs/cmm/liza/img/letter_icons.h
Normal file
1
programs/cmm/liza/img/letter_icons.h
Normal file
@ -0,0 +1 @@
|
||||
dword letter_icons_pal[]= {0x008080C0,0x00ADADAD,0x00ABABAB,0x00A9A9A9,0x00A8A8A8,0x00B2B2B2,0x00F0F0F0,0x00FFFFFF,0x00F1F1F1,0x00B0B0B0,0x00D1D1D1,0x00DEDEDE,0x00FCFCFC,0x00F6F6F6,0x00F4F4F4,0x00F5F5F5,0x00DFDFDF,0x00CECECE,0x00ACACAC,0x00F8F8F8,0x00BEBEBE,0x00D8D8D8,0x00F3F3F3,0x00ECECEC,0x00DCDCDC,0x00BBBBBB,0x00A5A5A5,0x00EEEEEE,0x00B5B5B5,0x00D6D6D6,0x00EDEDED,0x00E6E6E6,0x00DADADA,0x009F9F9F,0x00E3E3E3,0x00AEAEAE,0x00E9E9E9,0x00D7D7D7,0x00E4E4E4,0x00E5E5E5,0x00989898,0x00CFCFCF,0x007C7C7C,0x00787878,0x00E0E0E0,0x00919191,0x00D2D2D2,0x009D9D9D,0x00F2F2F2,0x00999999,0x009B9B9B,0x00A7A7A7,0x00A2A2A2,0x00D4D4D4,0x008B8B8B,0x00CDCDCD,0x00A1A1A1,0x00858585,0x00EBEBEB,0x00E7E7E7,0x009A9A9A,0x00818181,0x00D9D9D9,0x00EAEAEA,0x00828282,0x00606060,0x00848484,0x00838383,0x00179C15,0x00F7F7CD,0x008FF778,0x00E4F7C0,0x00C2F7A6,0x00F3F6C2,0x00EBF7BF,0x00ADF791,0x0095F77E,0x002CF21F,0x0038E82A,0x0026DC17,0x0025CC1D,0x0020E915,0x00179714,0x00169C13,0x0026E21D,0x0029EC1D,0x0015909B,0x00B7F7FA,0x0078F6EC,0x00C3F9FB,0x00A6F6E3,0x0091F6E5,0x007DF7EC,0x001FE9F2,0x0029E2E8,0x0021CFDB,0x001DC2CB,0x0015DEE9,0x0012818B,0x001DD7E2,0x001DE3EC}
|
BIN
programs/cmm/liza/img/letter_icons.png
Normal file
BIN
programs/cmm/liza/img/letter_icons.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
programs/cmm/liza/img/letter_icons.raw
Normal file
BIN
programs/cmm/liza/img/letter_icons.raw
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
@ -1 +0,0 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>幹雁艸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¦¦¦¦¦¦¦¦¦¦¦'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>蓙茣幹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>幹観冪玻璞嶹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>嶹增瘁蕨牢幹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>旭逸闖電土旙韶韭跛跛跛跛跛跛跛跛跟韶毫歛詑闖鎔旭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>艸裴蠎室忻恁跛聿聿聿聿聿聿跛齎旙幻瑚裴艸腦<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>いむ玻矜矮粐亀逆孚艸艢玻玻琅聿捶找臆粐籵矜玻爐い<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>旙旙旙湎渟栩<EFBFBD><EFBFBD><EFBFBD>墺壯窿窿窈慓<EFBFBD><EFBFBD><EFBFBD>樛權湎旙旙旙<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>墺墻嶽冪僥Ё裴雖⑬ゥェЁ<EFBFBD><EFBFBD>裴<EFBFBD><EFBFBD>嗷孚孕墺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>蕨鰐面いれ跛迯迥裴裴裴裴裴褄迯迯蹣<EFBFBD>様溶蕨<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>篤蕩□繞繖粐烝烝烝烝烝烝烝烝烝窿竍艸いで杷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ёл毫嶽嶬墺厰厶嗷嗷嗷嗷嗷嘔厰厰叟忻湎洫<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ddd<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ddd<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>幹雁艸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¦¦¦¦¦¦¦¦¦¦¦'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>蓙茣幹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>幹観冪玻璞嶹<15><15><17><><EFBFBD>齠齡<E9BDA0><E9BDA1><EFBFBD><EFBFBD>嶹增瘁蕨牢幹<E789A2><E5B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>旭逸闖電土旙<15>覧<><15>跛跛跛跛跛跛韶鞆毫詑啄闖旭<E99796><E697AD><EFBFBD><EFBFBD><15><15><15><15><15><15>x<>撣<EFBFBD><15>聿聿聿跛齎旙幻瑚裴艸腦<E889B8><E885A6><EFBFBD><EFBFBD><15><17>詑<EFBFBD>琢鸞<E790A2>雛<EFBFBD><E99B9B><EFBFBD>~<7E><>覧<EFBFBD><15>聿聆捶臆俄粐矜矗玻い<E78EBB><E38184><EFBFBD><EFBFBD><15><1F>,<1F>,<1F>,<1F>,*<2A>8<17>&<1D>%<15> <15>慓<><E68593><EFBFBD><EFBFBD>樛權湎旙旙旙<E69799><E69799><EFBFBD><EFBFBD><EFBFBD><EFBFBD><14><13><15><15><15><15><1D>&<1D>)<15><17><><EFBFBD><EFBFBD><EFBFBD>裴<EFBFBD><E8A3B4>嗷孚孕墺<E5AD95><E5A2BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>裴<EFBFBD><E8A3B4><EFBFBD><EFBFBD>誓製十<E8A3BD><E58D81><EFBFBD><15><1F>,<15>捶搖裴裴褄迯迯蹣<E8BFAF>様溶蕨<E6BAB6><E895A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>篤蕩□繞<E296A1><15><15>蕨<>烝烝烝烝烝焜窿艸腓い杷<E38184><E69DB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ёл毫嶽嶬墺厰厶嗷嗷嗷嗷嗷嘔厰厰叟忻湎洫<E6B98E><E6B4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ddd<64><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ddd<64><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>幹雁艸<E99B81><E889B8><EFBFBD><EFBFBD><EFBFBD>¦¦¦¦¦¦¦¦¦¦¦'<EFBFA4><EFBC87><EFBFBD><EFBFBD>蓙茣幹<E88CA3><E5B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>幹観冪玻璞嶹<E7929E><E5B6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><15><>蕨牢幹<E789A2><E5B9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>旭逸闖電土旙韶韭跛跛跛跛跛跛跛跛跟韶<E8B79F><E99FB6>焄<><E78484><EFBFBD>旭<><E697AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>艸裴蠎室忻恁跛聿<E8B79B><E881BF><EFBFBD><15><><15><><15><><15><><15><>踝x遧<78><E981A7><EFBFBD>裴<><E8A3B4><EFBFBD><EFBFBD>いむ玻矜矮粐亀逆孚艸<E5AD9A><E889B8><EFBFBD>笆<>兊遧兆兊遧着<E981A7><E79D80>踞}焄<><E78484><EFBFBD><15><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>旙旙旙湎渟栩<E6B89F><E6A0A9><EFBFBD>墺<EFBFBD><E5A2BA><EFBFBD>鱸鱸鱸鱸萵)柤!紡蛩<15><><12><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>墺墻嶽冪僥Ё裴雖⑬<E99B96><E291AC><12><><12><><12><><12><><12><>瞰趁<1D><>裴<><E8A3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>蕨鰐面いれ跛迯迥裴裴袮捶捶掉樛樛<E6A89B><E6A89B><EFBFBD>鱸<1F><><12><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>篤蕩□繞繖粐烝烝烝烝烝烝烝烝烝窿<E7839D><E7AABF><EFBFBD><12><>更<><E69BB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ёл毫嶽嶬墺厰厶嗷嗷嗷嗷嗷嘔厰厰叟忻湎洫<E6B98E><E6B4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ddd<64><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ddd<64><64><EFBFBD>
|
@ -2,24 +2,25 @@
|
||||
|
||||
//libraries
|
||||
#define MEMSIZE 0xA0000
|
||||
#include "..\lib\kolibri.h"
|
||||
#include "..\lib\strings.h"
|
||||
#include "..\lib\mem.h"
|
||||
#include "..\lib\dll.h"
|
||||
#include "..\lib\encoding.h"
|
||||
#include "..\lib\figures.h"
|
||||
#include "..\lib\file_system.h"
|
||||
#include "..\lib\list_box.h"
|
||||
#include "..\lib\socket_new.h"
|
||||
#include "../lib/kolibri.h"
|
||||
#include "../lib/strings.h"
|
||||
#include "../lib/mem.h"
|
||||
#include "../lib/dll.h"
|
||||
#include "../lib/encoding.h"
|
||||
#include "../lib/figures.h"
|
||||
#include "../lib/file_system.h"
|
||||
#include "../lib/list_box.h"
|
||||
#include "../lib/socket_new.h"
|
||||
//*.obj libraries
|
||||
#include "..\lib\lib.obj\box_lib.h"
|
||||
#include "..\lib\lib.obj\network.h"
|
||||
#include "..\lib\lib.obj\libio_lib.h"
|
||||
#include "..\lib\lib.obj\libimg_lib.h"
|
||||
#include "..\lib\lib.obj\netcode.h"
|
||||
#include "..\lib\lib.obj\iconv.h"
|
||||
#include "../lib/lib.obj/box_lib.h"
|
||||
#include "../lib/lib.obj/network.h"
|
||||
#include "../lib/lib.obj/libio_lib.h"
|
||||
#include "../lib/lib.obj/libimg_lib.h"
|
||||
#include "../lib/lib.obj/netcode.h"
|
||||
#include "../lib/lib.obj/iconv.h"
|
||||
//images
|
||||
byte in_out_mail[18*36] = FROM "in_out_mail.raw";
|
||||
byte letter_icons[sizeof(file "img/letter_icons.raw")] = FROM "img/letter_icons.raw";
|
||||
#include "img/letter_icons.h"
|
||||
|
||||
//connection algorithm
|
||||
enum {
|
||||
@ -45,9 +46,9 @@ enum {
|
||||
#define WIN_H 440
|
||||
#define WIN_MIN_W 500
|
||||
#define WIN_MIN_H 380
|
||||
#define LOGIN_HEADER "Login - Email client Liza 0.9a"
|
||||
#define OPTIONS_HEADER "Options - Email client Liza 0.9a"
|
||||
#define MAILBOX_HEADER "Mail Box - Email client Liza 0.9a"
|
||||
#define LOGIN_HEADER "Login - Email client Liza 0.9b"
|
||||
#define OPTIONS_HEADER "Options - Email client Liza 0.9b"
|
||||
#define MAILBOX_HEADER "Mail Box - Email client Liza 0.9b"
|
||||
#define BUFFERSIZE 512
|
||||
proc_info Form;
|
||||
system_colors sc;
|
||||
@ -113,7 +114,9 @@ void OpenMailDat()
|
||||
ReadFile(0, 512, #read_data, "/sys/network/mail.dat");
|
||||
if (!read_data)
|
||||
{
|
||||
strcpy(#email_text, "example@mail.com");
|
||||
//strcpy(#email_text, "example@mail.com");
|
||||
strcpy(#email_text, "eiroglif@yandex.ru"); //temporarily, for testing
|
||||
strcpy(#pass_text, "rostov");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -163,32 +163,8 @@ void MailBoxLoop()
|
||||
case evKey:
|
||||
key = GetKey();
|
||||
|
||||
if (key == 177){ //down
|
||||
if (aim) break;
|
||||
if (mail_list.current >= mail_list.count-1) break;
|
||||
mail_list.current++ ;
|
||||
if (mail_list.current >= mail_list.first + mail_list.visible) mail_list.first++ ;
|
||||
DrawMailList();
|
||||
aim = SEND_RETR;
|
||||
}
|
||||
if (key == 178){ //up
|
||||
if (aim) break;
|
||||
if (mail_list.current<=0) break;
|
||||
mail_list.current-- ;
|
||||
if (mail_list.current < mail_list.first) mail_list.first-- ;
|
||||
DrawMailList();
|
||||
aim = SEND_RETR;
|
||||
}
|
||||
if (key == 180){ //home
|
||||
if (aim) break;
|
||||
mail_list.first = mail_list.current = 0;
|
||||
DrawMailList();
|
||||
aim = SEND_RETR;
|
||||
}
|
||||
if (key == 181){ //end
|
||||
if (aim) break;
|
||||
mail_list.first = mail_list.count - mail_list.visible;
|
||||
mail_list.current = mail_list.count - 1;
|
||||
if (!aim) && (mail_list.ProcessKey(key))
|
||||
{
|
||||
DrawMailList();
|
||||
aim = SEND_RETR;
|
||||
}
|
||||
@ -285,11 +261,13 @@ void MailBoxLoop()
|
||||
if (!mailbuffer) {debug("alloc error!"); aim=NULL; break;}
|
||||
mailpointer = mailbuffer;
|
||||
aim = GET_ANSWER_RETR;
|
||||
debugi(letter_size);
|
||||
}
|
||||
|
||||
if (aim == GET_ANSWER_RETR)
|
||||
{
|
||||
ticks = Receive(socketnum, mailpointer, letter_size + mailbuffer - mailpointer , MSG_DONTWAIT);
|
||||
debugi(ticks);
|
||||
if (ticks == 0xffffffff) break;
|
||||
//debugi(EAX);
|
||||
|
||||
@ -352,27 +330,23 @@ void DrawToolbar()
|
||||
DrawBar(0, mail_list.y-1, mail_list.w,1, 0xf0f0f0);
|
||||
}
|
||||
|
||||
|
||||
void DrawMailList()
|
||||
{
|
||||
int i, on_y, on_x, direction;
|
||||
dword sel_col;
|
||||
mail_list.visible = mail_list.h / mail_list.line_h;
|
||||
|
||||
for (i=30; i<150; i++) DeleteButton(i);
|
||||
for (i=0; (i<mail_list.visible) && (i+mail_list.first<mail_list.count); i++)
|
||||
{
|
||||
on_y = i*mail_list.line_h + mail_list.y;
|
||||
if (mail_list.current==mail_list.first+i)
|
||||
{
|
||||
DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xEEEeee);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, 0xFFFfff);
|
||||
}
|
||||
if (mail_list.current==mail_list.first+i) sel_col=0xEEEeee; else sel_col=0xFFFfff;
|
||||
DrawBar(0, on_y, mail_list.w, mail_list.line_h-1, sel_col);
|
||||
direction = atr.GetDirection(i+mail_list.first+1);
|
||||
on_x = strlen(itoa(i+mail_list.first+1))*6;
|
||||
_PutImage(on_x + 18, mail_list.line_h-12/2+ on_y, 18,12, sizeof(in_out_mail)/3*direction + #in_out_mail);
|
||||
letter_icons_pal[0]=sel_col;
|
||||
PutPaletteImage(sizeof(letter_icons)/3*direction + #letter_icons, 18,12, on_x+18,
|
||||
mail_list.line_h-12/2+ on_y, 8, #letter_icons_pal);
|
||||
WriteText(on_x + 42, on_y+5, 0x80, 0, atr.GetSubject(i+mail_list.first+1));
|
||||
DefineButton(0, on_y, mail_list.w-1, mail_list.line_h, 30+i+BT_HIDE+BT_NOFRAME);
|
||||
DrawBar(0, on_y + mail_list.line_h-1, mail_list.w, 1, 0xCCCccc);
|
||||
|
Loading…
Reference in New Issue
Block a user