2013-03-12 17:19:10 +01:00
|
|
|
//Leency & SoUrcerer, LGPL
|
|
|
|
|
|
|
|
char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'};
|
|
|
|
|
|
|
|
dword mouse_opt;
|
|
|
|
unsigned char POP_server1[128]="pop.server.com";
|
|
|
|
unsigned char POP_server_port1[5]="110";
|
|
|
|
unsigned char SMTP_server1[128]="smtp.server.com";
|
|
|
|
unsigned char SMTP_server_port1[5]="25";
|
2016-11-05 11:13:29 +01:00
|
|
|
edit_box POP_server_box = {210,230,125 ,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server1),#POP_server1,#mouse_opt,100000000000b};
|
|
|
|
edit_box POP_server_port_box = {210,230,160,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#POP_server_port1,#mouse_opt,100000000000b};
|
|
|
|
edit_box SMTP_server_box = {210,230,195,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server1),#SMTP_server1,#mouse_opt,100000000000b};
|
|
|
|
edit_box SMTP_server_port_box = {210,230,230,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,5,#SMTP_server_port1,#mouse_opt,100000000000b};
|
2013-03-12 17:19:10 +01:00
|
|
|
|
2018-04-19 22:12:07 +02:00
|
|
|
checkbox automatic = { "Automatic configuration", true };
|
2013-03-12 17:19:10 +01:00
|
|
|
|
2013-11-04 22:40:13 +01:00
|
|
|
void SettingsDialog()
|
2013-03-12 17:19:10 +01:00
|
|
|
{
|
|
|
|
int key, id;
|
|
|
|
|
|
|
|
POP_server_box.size = strlen(#POP_server1);
|
|
|
|
POP_server_port_box.size = strlen(#POP_server_port1);
|
|
|
|
SMTP_server_box.size = strlen(#SMTP_server1);
|
|
|
|
SMTP_server_port_box.size = strlen(#SMTP_server_port1);
|
|
|
|
|
|
|
|
goto _OPT_WIN;
|
|
|
|
|
|
|
|
loop()
|
|
|
|
{
|
|
|
|
switch(WaitEvent())
|
|
|
|
{
|
|
|
|
case evMouse:
|
|
|
|
IF (GetProcessSlot(Form.ID)-GetActiveProcess()!=0) break;
|
|
|
|
edit_box_mouse stdcall(#POP_server_box);
|
|
|
|
edit_box_mouse stdcall(#POP_server_port_box);
|
|
|
|
edit_box_mouse stdcall(#SMTP_server_box);
|
|
|
|
edit_box_mouse stdcall(#SMTP_server_port_box);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case evButton:
|
|
|
|
id = GetButtonID();
|
|
|
|
if (id==1) SaveAndExit();
|
|
|
|
if (id==19) LoginBoxLoop();
|
2018-04-19 22:12:07 +02:00
|
|
|
if (automatic.click(id))
|
2013-03-12 17:19:10 +01:00
|
|
|
{
|
2018-04-19 22:12:07 +02:00
|
|
|
if (automatic.checked) {
|
|
|
|
POP_server_box.flags = POP_server_box.flags = POP_server_port_box.flags = SMTP_server_box.flags = SMTP_server_port_box.flags = 100000000000b;
|
2015-08-05 13:00:04 +02:00
|
|
|
POP_server_box.blur_border_color = POP_server_box.blur_border_color = POP_server_port_box.blur_border_color =
|
2018-04-19 22:12:07 +02:00
|
|
|
SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xCACACA;
|
2015-08-05 13:00:04 +02:00
|
|
|
}
|
|
|
|
else {
|
2018-04-19 22:12:07 +02:00
|
|
|
POP_server_box.flags = 0b10;
|
|
|
|
POP_server_port_box.flags = SMTP_server_box.flags = SMTP_server_port_box.flags = 0b;
|
2015-08-05 13:00:04 +02:00
|
|
|
POP_server_box.blur_border_color = POP_server_box.blur_border_color = POP_server_port_box.blur_border_color =
|
2018-04-19 22:12:07 +02:00
|
|
|
SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xFFFfff;
|
2015-08-05 13:00:04 +02:00
|
|
|
}
|
2018-04-19 22:12:07 +02:00
|
|
|
DrawOptionsWindow();
|
2013-03-12 17:19:10 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case evKey:
|
2015-08-11 13:29:31 +02:00
|
|
|
GetKeys();;
|
2013-03-12 17:19:10 +01:00
|
|
|
|
2018-04-19 22:12:07 +02:00
|
|
|
if (automatic.checked==true) break;
|
2015-08-11 13:29:31 +02:00
|
|
|
if (key_scancode==SCAN_CODE_TAB)
|
2013-03-12 17:19:10 +01:00
|
|
|
{
|
|
|
|
if (POP_server_box.flags & 0b10) { POP_server_box.flags -= 0b10; POP_server_port_box.flags += 0b10; } else
|
|
|
|
if (POP_server_port_box.flags & 0b10) { POP_server_port_box.flags -= 0b10; SMTP_server_box.flags += 0b10; } else
|
|
|
|
if (SMTP_server_box.flags & 0b10) { SMTP_server_box.flags -= 0b10; SMTP_server_port_box.flags += 0b10; } else
|
|
|
|
if (SMTP_server_port_box.flags & 0b10) { SMTP_server_port_box.flags -= 0b10; POP_server_box.flags += 0b10; } else
|
|
|
|
POP_server_box.flags = 0b10;
|
2018-04-19 22:12:07 +02:00
|
|
|
DrawOptionsWindow();
|
2013-03-12 17:19:10 +01:00
|
|
|
}
|
|
|
|
|
2015-08-11 13:29:31 +02:00
|
|
|
EAX=key_ascii<<8;
|
2013-03-12 17:19:10 +01:00
|
|
|
edit_box_key stdcall(#POP_server_box);
|
|
|
|
edit_box_key stdcall(#POP_server_port_box);
|
|
|
|
edit_box_key stdcall(#SMTP_server_box);
|
|
|
|
edit_box_key stdcall(#SMTP_server_port_box);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case evReDraw: _OPT_WIN:
|
|
|
|
if !(DefineWindow(OPTIONS_HEADER)) break;
|
2015-08-04 16:36:07 +02:00
|
|
|
DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work);
|
2018-04-19 22:12:07 +02:00
|
|
|
DrawOptionsWindow();
|
2013-03-12 17:19:10 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-19 22:12:07 +02:00
|
|
|
void DrawOptionsWindow()
|
2013-03-12 17:19:10 +01:00
|
|
|
{
|
|
|
|
#define ELEM_X 25
|
|
|
|
int i;
|
2016-02-21 22:57:22 +01:00
|
|
|
incn y;
|
|
|
|
y.n=0;
|
2015-08-04 16:36:07 +02:00
|
|
|
DrawBar(0, Form.cheight - 40, Form.cwidth, 1, system.color.work_graph);
|
2013-03-12 17:19:10 +01:00
|
|
|
DrawBar(0, Form.cheight - 40+1, Form.cwidth, 1, LBUMP);
|
2015-08-04 16:36:07 +02:00
|
|
|
DrawCaptButton(Form.cwidth-79, Form.cheight-32, 70, 25, 19, system.color.work_button, system.color.work_button_text,"Apply");
|
2013-03-12 17:19:10 +01:00
|
|
|
|
2016-02-21 22:57:22 +01:00
|
|
|
WriteText(ELEM_X, y.inc(20), 0x81, system.color.work_text, "Network settings");
|
2018-04-19 22:12:07 +02:00
|
|
|
automatic.draw(ELEM_X, y.inc(65));
|
2016-02-21 22:57:22 +01:00
|
|
|
EDI = system.color.work;
|
2016-11-05 11:13:29 +01:00
|
|
|
for (i=0; i<4; i++) WriteText(ELEM_X+40, i*35+POP_server_box.top + 3, 0xD0, system.color.work_text, text1[i]);
|
2016-02-21 22:57:22 +01:00
|
|
|
DrawEditBox(#POP_server_box);
|
|
|
|
DrawEditBox(#POP_server_port_box);
|
|
|
|
DrawEditBox(#SMTP_server_box);
|
|
|
|
DrawEditBox(#SMTP_server_port_box);
|
2013-03-12 17:19:10 +01:00
|
|
|
}
|