Rev 5674 | 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 | #define CUSTOM 0 |
||
4 | #define MANUAL 1 |
||
5 | char checked[3] = { 1, 0 }; |
||
6 | int use_iconv = 1; |
||
7 | |||
8 | char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'}; |
||
9 | |||
10 | dword mouse_opt; |
||
11 | unsigned char POP_server1[128]="pop.server.com"; |
||
12 | unsigned char POP_server_port1[5]="110"; |
||
13 | unsigned char SMTP_server1[128]="smtp.server.com"; |
||
14 | unsigned char SMTP_server_port1[5]="25"; |
||
5683 | leency | 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,0xCACACA,0,5,#POP_server_port1,#mouse_opt,100000000000b}; |
||
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,0xCACACA,0,5,#SMTP_server_port1,#mouse_opt,100000000000b}; |
||
3368 | leency | 19 | |
20 | |||
4164 | leency | 21 | void SettingsDialog() |
3368 | leency | 22 | { |
23 | int key, id; |
||
24 | |||
25 | POP_server_box.size = strlen(#POP_server1); |
||
26 | POP_server_port_box.size = strlen(#POP_server_port1); |
||
27 | SMTP_server_box.size = strlen(#SMTP_server1); |
||
28 | SMTP_server_port_box.size = strlen(#SMTP_server_port1); |
||
29 | |||
30 | goto _OPT_WIN; |
||
31 | |||
32 | loop() |
||
33 | { |
||
34 | switch(WaitEvent()) |
||
35 | { |
||
36 | case evMouse: |
||
37 | IF (GetProcessSlot(Form.ID)-GetActiveProcess()!=0) break; |
||
38 | edit_box_mouse stdcall(#POP_server_box); |
||
39 | edit_box_mouse stdcall(#POP_server_port_box); |
||
40 | edit_box_mouse stdcall(#SMTP_server_box); |
||
41 | edit_box_mouse stdcall(#SMTP_server_port_box); |
||
42 | break; |
||
43 | |||
44 | case evButton: |
||
45 | id = GetButtonID(); |
||
46 | if (id==1) SaveAndExit(); |
||
47 | if (id==19) LoginBoxLoop(); |
||
48 | if (id==17) || (id==18) |
||
49 | { |
||
50 | if (checked[id-17]==1) break; |
||
51 | checked[0]> |
||
5683 | leency | 52 | if (checked[1]) { |
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 | } |
||
3368 | leency | 63 | OptionsWindow(); |
64 | } |
||
65 | if (id==20) |
||
66 | { |
||
67 | if (use_iconv==2) break; |
||
68 | if (use_iconv==1) use_iconv=0; else use_iconv=1; |
||
69 | OptionsWindow(); |
||
70 | } |
||
71 | break; |
||
72 | |||
73 | case evKey: |
||
74 | key = GetKey(); |
||
75 | |||
76 | if (checked[1]==0) break; |
||
77 | if (key==9) |
||
78 | { |
||
79 | if (POP_server_box.flags & 0b10) { POP_server_box.flags -= 0b10; POP_server_port_box.flags += 0b10; } else |
||
80 | if (POP_server_port_box.flags & 0b10) { POP_server_port_box.flags -= 0b10; SMTP_server_box.flags += 0b10; } else |
||
81 | if (SMTP_server_box.flags & 0b10) { SMTP_server_box.flags -= 0b10; SMTP_server_port_box.flags += 0b10; } else |
||
82 | if (SMTP_server_port_box.flags & 0b10) { SMTP_server_port_box.flags -= 0b10; POP_server_box.flags += 0b10; } else |
||
83 | POP_server_box.flags = 0b10; |
||
84 | OptionsWindow(); |
||
85 | } |
||
86 | |||
87 | EAX=key<<8; |
||
88 | edit_box_key stdcall(#POP_server_box); |
||
89 | edit_box_key stdcall(#POP_server_port_box); |
||
90 | edit_box_key stdcall(#SMTP_server_box); |
||
91 | edit_box_key stdcall(#SMTP_server_port_box); |
||
92 | break; |
||
93 | |||
94 | case evReDraw: _OPT_WIN: |
||
95 | if !(DefineWindow(OPTIONS_HEADER)) break; |
||
5674 | pavelyakov | 96 | DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work); |
3368 | leency | 97 | OptionsWindow(); |
98 | break; |
||
99 | } |
||
100 | } |
||
101 | } |
||
102 | |||
103 | void OptionsWindow() |
||
104 | { |
||
105 | #define ELEM_X 25 |
||
106 | int i; |
||
5674 | pavelyakov | 107 | DrawBar(0, Form.cheight - 40, Form.cwidth, 1, system.color.work_graph); |
3368 | leency | 108 | DrawBar(0, Form.cheight - 40+1, Form.cwidth, 1, LBUMP); |
5674 | pavelyakov | 109 | DrawCaptButton(Form.cwidth-79, Form.cheight-32, 70, 25, 19, system.color.work_button, system.color.work_button_text,"Apply"); |
3368 | leency | 110 | |
5674 | pavelyakov | 111 | WriteTextB(ELEM_X, 20, 0x90, system.color.work_text, "Network settings"); |
112 | CheckBox(ELEM_X, 45, 12, 12, 17, "Use custom settings", system.color.work_graph, system.color.work_text, checked[0]); |
||
113 | CheckBox(ELEM_X, 65, 12, 12, 18, "Manual configuration", system.color.work_graph, system.color.work_text, checked[1]); |
||
3368 | leency | 114 | for (i=0; i<4; i++) |
115 | { |
||
5674 | pavelyakov | 116 | WriteText(ELEM_X+40, i*25+4+POP_server_box.top, 0x80, system.color.work_text, text1[i]); |
117 | DrawRectangle(POP_server_box.left-1, i*25+POP_server_box.top-1, POP_server_box.width+2, 16, system.color.work_graph); |
||
3368 | leency | 118 | } |
119 | edit_box_draw stdcall(#POP_server_box); |
||
120 | edit_box_draw stdcall(#POP_server_port_box); |
||
121 | edit_box_draw stdcall(#SMTP_server_box); |
||
122 | edit_box_draw stdcall(#SMTP_server_port_box); |
||
123 | |||
5674 | pavelyakov | 124 | WriteTextB(ELEM_X, 205, 0x90, system.color.work_text, "MailBox settings"); |
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); |
||
3368 | leency | 126 | }4;>8; |