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