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