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