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