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'};
|
|
|
|
|
|
|
|
unsigned char POP_server1[128]="pop.server.com";
|
2018-10-29 12:39:31 +01:00
|
|
|
unsigned char POP_server_port1[7]="110";
|
2013-03-12 17:19:10 +01:00
|
|
|
unsigned char SMTP_server1[128]="smtp.server.com";
|
2018-10-29 12:39:31 +01:00
|
|
|
unsigned char SMTP_server_port1[7]="25";
|
|
|
|
edit_box POP_server_box = {210,230,125,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server1)-2,#POP_server1,0,0};
|
|
|
|
edit_box POP_server_port_box = {210,230,160,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server_port1)-2,#POP_server_port1,0,0};
|
|
|
|
edit_box SMTP_server_box = {210,230,195,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server1)-2,#SMTP_server1,0,0};
|
|
|
|
edit_box SMTP_server_port_box = {210,230,230,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server_port1)-2,#SMTP_server_port1,0,0};
|
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
|
|
|
|
2018-10-29 12:39:31 +01:00
|
|
|
void UpdateEditboxFlags(dword additional_flag)
|
2013-03-12 17:19:10 +01:00
|
|
|
{
|
2018-10-29 12:39:31 +01:00
|
|
|
EditBox_UpdateText(#POP_server_box, additional_flag + 0);
|
|
|
|
EditBox_UpdateText(#POP_server_port_box, additional_flag + ed_figure_only + 0);
|
|
|
|
EditBox_UpdateText(#SMTP_server_box, additional_flag + 0);
|
|
|
|
EditBox_UpdateText(#SMTP_server_port_box, additional_flag + ed_figure_only + 0);
|
|
|
|
}
|
2013-03-12 17:19:10 +01:00
|
|
|
|
2018-10-29 12:39:31 +01:00
|
|
|
void SettingsDialog()
|
|
|
|
{
|
|
|
|
int id;
|
|
|
|
UpdateEditboxFlags(ed_disabled);
|
2013-03-12 17:19:10 +01:00
|
|
|
goto _OPT_WIN;
|
2018-10-29 12:39:31 +01:00
|
|
|
loop() switch(WaitEvent())
|
2013-03-12 17:19:10 +01:00
|
|
|
{
|
2018-10-29 12:39:31 +01:00
|
|
|
case evMouse:
|
|
|
|
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();
|
|
|
|
if (automatic.click(id))
|
|
|
|
{
|
|
|
|
if (automatic.checked) {
|
|
|
|
UpdateEditboxFlags(ed_disabled);
|
2022-01-15 21:30:04 +01:00
|
|
|
POP_server_box.border_color = POP_server_port_box.border_color =
|
|
|
|
SMTP_server_box.border_color = SMTP_server_port_box.border_color = 0xCACACA;
|
2013-03-12 17:19:10 +01:00
|
|
|
}
|
2018-10-29 12:39:31 +01:00
|
|
|
else {
|
|
|
|
UpdateEditboxFlags(0);
|
|
|
|
POP_server_box.flags = 0b10;
|
2022-01-15 21:30:04 +01:00
|
|
|
POP_server_box.border_color = POP_server_port_box.border_color =
|
|
|
|
SMTP_server_box.border_color = SMTP_server_port_box.border_color = 0xFFFfff;
|
2013-03-12 17:19:10 +01:00
|
|
|
}
|
2018-10-29 12:39:31 +01:00
|
|
|
DrawOptionsWindow();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
GetKeys();;
|
2013-03-12 17:19:10 +01:00
|
|
|
|
2018-10-29 12:39:31 +01:00
|
|
|
if (automatic.checked==true) break;
|
|
|
|
if (key_scancode==SCAN_CODE_TAB)
|
|
|
|
{
|
|
|
|
if (POP_server_box.flags & ed_focus) { UpdateEditboxFlags(0); POP_server_port_box.flags += ed_focus; } else
|
|
|
|
if (POP_server_port_box.flags & ed_focus) { UpdateEditboxFlags(0); SMTP_server_box.flags += ed_focus; } else
|
|
|
|
if (SMTP_server_box.flags & ed_focus) { UpdateEditboxFlags(0); SMTP_server_port_box.flags += ed_focus; } else
|
|
|
|
if (SMTP_server_port_box.flags & ed_focus) { UpdateEditboxFlags(0); POP_server_box.flags += ed_focus; } else
|
|
|
|
{ UpdateEditboxFlags(0); POP_server_box.flags = 0b10; }
|
2018-04-19 22:12:07 +02:00
|
|
|
DrawOptionsWindow();
|
2018-10-29 12:39:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
EAX=key_ascii<<8;
|
|
|
|
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;
|
2020-04-18 01:52:24 +02:00
|
|
|
DrawBar(0,0, Form.cwidth, Form.cheight, sc.work);
|
2018-10-29 12:39:31 +01:00
|
|
|
DrawOptionsWindow();
|
|
|
|
break;
|
2013-03-12 17:19:10 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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;
|
2022-01-09 07:36:16 +01:00
|
|
|
DrawBar(0, Form.cheight - 40, Form.cwidth, 1, sc.line);
|
2013-03-12 17:19:10 +01:00
|
|
|
DrawBar(0, Form.cheight - 40+1, Form.cwidth, 1, LBUMP);
|
2020-04-18 01:52:24 +02:00
|
|
|
DrawCaptButton(Form.cwidth-79, Form.cheight-32, 70, 25, 19, sc.button, sc.button_text,"Apply");
|
2013-03-12 17:19:10 +01:00
|
|
|
|
2020-04-18 01:52:24 +02:00
|
|
|
WriteText(ELEM_X, y.inc(20), 0x81, sc.work_text, "Network settings");
|
2018-04-19 22:12:07 +02:00
|
|
|
automatic.draw(ELEM_X, y.inc(65));
|
2018-09-16 11:42:32 +02:00
|
|
|
for (i=0; i<4; i++) {
|
2020-04-18 01:52:24 +02:00
|
|
|
WriteTextWithBg(ELEM_X+40, i*35+POP_server_box.top + 3, 0xD0, sc.work_text, text1[i], sc.work);
|
2018-09-16 11:42:32 +02:00
|
|
|
}
|
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
|
|
|
}
|