Rev 5436 | 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"; |
||
5436 | leency | 15 | edit_box POP_server_box = {210,190,90 ,0xffffff,0x94AECE,0xffc90E,0xffffff,0,sizeof(POP_server1),#POP_server1,#mouse_opt,0}; |
3368 | leency | 16 | edit_box POP_server_port_box = {210,190,115,0xffffff,0x94AECE,0xffc90E,0xffffff,0,5,#POP_server_port1,#mouse_opt,0b1000000000000000}; |
17 | edit_box SMTP_server_box = {210,190,140,0xffffff,0x94AECE,0xffc90E,0xffffff,0,sizeof(SMTP_server1),#SMTP_server1,#mouse_opt,0}; |
||
18 | edit_box SMTP_server_port_box = {210,190,165,0xffffff,0x94AECE,0xffc90E,0xffffff,0,5,#SMTP_server_port1,#mouse_opt,0b1000000000000000}; |
||
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 | if (checked[1]==0) break; |
||
39 | edit_box_mouse stdcall(#POP_server_box); |
||
40 | edit_box_mouse stdcall(#POP_server_port_box); |
||
41 | edit_box_mouse stdcall(#SMTP_server_box); |
||
42 | edit_box_mouse stdcall(#SMTP_server_port_box); |
||
43 | break; |
||
44 | |||
45 | case evButton: |
||
46 | id = GetButtonID(); |
||
47 | if (id==1) SaveAndExit(); |
||
48 | if (id==19) LoginBoxLoop(); |
||
49 | if (id==17) || (id==18) |
||
50 | { |
||
51 | if (checked[id-17]==1) break; |
||
52 | checked[0]> |
||
53 | if (checked[1]) POP_server_box.flags = 0b10; |
||
54 | OptionsWindow(); |
||
55 | } |
||
56 | if (id==20) |
||
57 | { |
||
58 | if (use_iconv==2) break; |
||
59 | if (use_iconv==1) use_iconv=0; else use_iconv=1; |
||
60 | OptionsWindow(); |
||
61 | } |
||
62 | break; |
||
63 | |||
64 | case evKey: |
||
65 | key = GetKey(); |
||
66 | |||
67 | if (checked[1]==0) break; |
||
68 | if (key==9) |
||
69 | { |
||
70 | 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 |
||
72 | 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 |
||
74 | POP_server_box.flags = 0b10; |
||
75 | OptionsWindow(); |
||
76 | } |
||
77 | |||
78 | EAX=key<<8; |
||
79 | edit_box_key stdcall(#POP_server_box); |
||
80 | edit_box_key stdcall(#POP_server_port_box); |
||
81 | edit_box_key stdcall(#SMTP_server_box); |
||
82 | edit_box_key stdcall(#SMTP_server_port_box); |
||
83 | break; |
||
84 | |||
85 | case evReDraw: _OPT_WIN: |
||
86 | if !(DefineWindow(OPTIONS_HEADER)) break; |
||
5674 | pavelyakov | 87 | DrawBar(0,0, Form.cwidth, Form.cheight, system.color.work); |
3368 | leency | 88 | OptionsWindow(); |
89 | break; |
||
90 | } |
||
91 | } |
||
92 | } |
||
93 | |||
94 | void OptionsWindow() |
||
95 | { |
||
96 | #define ELEM_X 25 |
||
97 | int i; |
||
5674 | pavelyakov | 98 | DrawBar(0, Form.cheight - 40, Form.cwidth, 1, system.color.work_graph); |
3368 | leency | 99 | DrawBar(0, Form.cheight - 40+1, Form.cwidth, 1, LBUMP); |
5674 | pavelyakov | 100 | DrawCaptButton(Form.cwidth-79, Form.cheight-32, 70, 25, 19, system.color.work_button, system.color.work_button_text,"Apply"); |
3368 | leency | 101 | |
5674 | pavelyakov | 102 | 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]); |
||
104 | CheckBox(ELEM_X, 65, 12, 12, 18, "Manual configuration", system.color.work_graph, system.color.work_text, checked[1]); |
||
3368 | leency | 105 | for (i=0; i<4; i++) |
106 | { |
||
5674 | pavelyakov | 107 | 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); |
||
3368 | leency | 109 | } |
110 | edit_box_draw stdcall(#POP_server_box); |
||
111 | edit_box_draw stdcall(#POP_server_port_box); |
||
112 | edit_box_draw stdcall(#SMTP_server_box); |
||
113 | edit_box_draw stdcall(#SMTP_server_port_box); |
||
114 | |||
5674 | pavelyakov | 115 | 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); |
||
3368 | leency | 117 | }4;>8; |