Rev 7373 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3368 | leency | 1 | //Leency & SoUrcerer, LGPL |
2 | |||
3 | char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'}; |
||
4 | |||
5 | unsigned char POP_server1[128]="pop.server.com"; |
||
7506 | leency | 6 | unsigned char POP_server_port1[7]="110"; |
3368 | leency | 7 | unsigned char SMTP_server1[128]="smtp.server.com"; |
7506 | leency | 8 | unsigned char SMTP_server_port1[7]="25"; |
9 | edit_box POP_server_box = {210,230,125,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server1)-2,#POP_server1,0,0}; |
||
10 | edit_box POP_server_port_box = {210,230,160,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(POP_server_port1)-2,#POP_server_port1,0,0}; |
||
11 | edit_box SMTP_server_box = {210,230,195,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server1)-2,#SMTP_server1,0,0}; |
||
12 | edit_box SMTP_server_port_box = {210,230,230,0xffffff,0x94AECE,0xffc90E,0xCACACA,0x10000000,sizeof(SMTP_server_port1)-2,#SMTP_server_port1,0,0}; |
||
3368 | leency | 13 | |
7244 | leency | 14 | checkbox automatic = { "Automatic configuration", true }; |
3368 | leency | 15 | |
7506 | leency | 16 | void UpdateEditboxFlags(dword additional_flag) |
17 | { |
||
18 | EditBox_UpdateText(#POP_server_box, additional_flag + 0); |
||
19 | EditBox_UpdateText(#POP_server_port_box, additional_flag + ed_figure_only + 0); |
||
20 | EditBox_UpdateText(#SMTP_server_box, additional_flag + 0); |
||
21 | EditBox_UpdateText(#SMTP_server_port_box, additional_flag + ed_figure_only + 0); |
||
22 | } |
||
23 | |||
4164 | leency | 24 | void SettingsDialog() |
3368 | leency | 25 | { |
7506 | leency | 26 | int id; |
27 | UpdateEditboxFlags(ed_disabled); |
||
3368 | leency | 28 | goto _OPT_WIN; |
7506 | leency | 29 | loop() switch(WaitEvent()) |
3368 | leency | 30 | { |
7506 | leency | 31 | case evMouse: |
32 | edit_box_mouse stdcall(#POP_server_box); |
||
33 | edit_box_mouse stdcall(#POP_server_port_box); |
||
34 | edit_box_mouse stdcall(#SMTP_server_box); |
||
35 | edit_box_mouse stdcall(#SMTP_server_port_box); |
||
36 | break; |
||
37 | |||
38 | case evButton: |
||
39 | id = GetButtonID(); |
||
40 | if (id==1) SaveAndExit(); |
||
41 | if (id==19) LoginBoxLoop(); |
||
42 | if (automatic.click(id)) |
||
43 | { |
||
44 | if (automatic.checked) { |
||
45 | UpdateEditboxFlags(ed_disabled); |
||
46 | POP_server_box.blur_border_color = POP_server_port_box.blur_border_color = |
||
47 | SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xCACACA; |
||
3368 | leency | 48 | } |
7506 | leency | 49 | else { |
50 | UpdateEditboxFlags(0); |
||
51 | POP_server_box.flags = 0b10; |
||
52 | POP_server_box.blur_border_color = POP_server_port_box.blur_border_color = |
||
53 | SMTP_server_box.blur_border_color = SMTP_server_port_box.blur_border_color = 0xFFFfff; |
||
3368 | leency | 54 | } |
7506 | leency | 55 | DrawOptionsWindow(); |
56 | } |
||
57 | break; |
||
58 | |||
59 | case evKey: |
||
60 | GetKeys();; |
||
3368 | leency | 61 | |
7506 | leency | 62 | if (automatic.checked==true) break; |
63 | if (key_scancode==SCAN_CODE_TAB) |
||
64 | { |
||
65 | if (POP_server_box.flags & ed_focus) { UpdateEditboxFlags(0); POP_server_port_box.flags += ed_focus; } else |
||
66 | if (POP_server_port_box.flags & ed_focus) { UpdateEditboxFlags(0); SMTP_server_box.flags += ed_focus; } else |
||
67 | if (SMTP_server_box.flags & ed_focus) { UpdateEditboxFlags(0); SMTP_server_port_box.flags += ed_focus; } else |
||
68 | if (SMTP_server_port_box.flags & ed_focus) { UpdateEditboxFlags(0); POP_server_box.flags += ed_focus; } else |
||
69 | { UpdateEditboxFlags(0); POP_server_box.flags = 0b10; } |
||
7244 | leency | 70 | DrawOptionsWindow(); |
7506 | leency | 71 | } |
72 | |||
73 | EAX=key_ascii<<8; |
||
74 | edit_box_key stdcall(#POP_server_box); |
||
75 | edit_box_key stdcall(#POP_server_port_box); |
||
76 | edit_box_key stdcall(#SMTP_server_box); |
||
77 | edit_box_key stdcall(#SMTP_server_port_box); |
||
78 | break; |
||
79 | |||
80 | case evReDraw: _OPT_WIN: |
||
81 | if !(DefineWindow(OPTIONS_HEADER)) break; |
||
82 | DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work); |
||
83 | DrawOptionsWindow(); |
||
84 | break; |
||
3368 | leency | 85 | } |
86 | } |
||
87 | |||
7244 | leency | 88 | void DrawOptionsWindow() |
3368 | leency | 89 | { |
90 | #define ELEM_X 25 |
||
91 | int i; |
||
6278 | leency | 92 | incn y; |
93 | y.n=0; |
||
5674 | pavelyakov | 94 | DrawBar(0, Form.cheight - 40, Form.cwidth, 1, system.color.work_graph); |
3368 | leency | 95 | DrawBar(0, Form.cheight - 40+1, Form.cwidth, 1, LBUMP); |
5674 | pavelyakov | 96 | DrawCaptButton(Form.cwidth-79, Form.cheight-32, 70, 25, 19, system.color.work_button, system.color.work_button_text,"Apply"); |
3368 | leency | 97 | |
6278 | leency | 98 | WriteText(ELEM_X, y.inc(20), 0x81, system.color.work_text, "Network settings"); |
7244 | leency | 99 | automatic.draw(ELEM_X, y.inc(65)); |
7373 | leency | 100 | for (i=0; i<4; i++) { |
101 | WriteTextWithBg(ELEM_X+40, i*35+POP_server_box.top + 3, 0xD0, system.color.work_text, text1[i], system.color.work); |
||
102 | } |
||
6278 | leency | 103 | DrawEditBox(#POP_server_box); |
104 | DrawEditBox(#POP_server_port_box); |
||
105 | DrawEditBox(#SMTP_server_box); |
||
106 | DrawEditBox(#SMTP_server_port_box); |
||
3368 | leency | 107 | }4;>8; |