Rev 140 | Rev 153 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 140 | Rev 147 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | // set window title and control texts |
59 | // set window title and control texts |
60 | SetWindowText (hWnd, LOCALIZE (L"Registration_Title")); |
60 | SetWindowText (hWnd, LOCALIZE (L"Registration_Title")); |
61 | 61 | ||
62 | // set the static texts |
62 | // set the static texts |
63 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_QUESTION), LOCALIZE (L"Registration_Question")); |
63 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_QUESTION), LOCALIZE (L"Registration_Question")); |
64 | SetWindowText (GetDlgItem (hWnd, BUTTON_DONATE), LOCALIZE (L"Registration_Donate")); |
- | |
65 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_NOPAYPAL), LOCALIZE (L"Registration_NoPayPal")); |
- | |
66 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_INSTRUCTIONS), LOCALIZE (L"Registration_Instructions")); |
64 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_INSTRUCTIONS), LOCALIZE (L"Registration_Instructions")); |
67 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_EMAILADDRESS), LOCALIZE (L"Registration_EmailAddress")); |
65 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_EMAILADDRESS), LOCALIZE (L"Registration_EmailAddress")); |
68 | if (options.registration.user_email[0] != 0) |
66 | if (options.registration.user_email[0] != 0) |
69 | SetDlgItemText (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS, options.registration.user_email); |
67 | SetDlgItemText (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS, options.registration.user_email); |
70 | else |
68 | else |
71 | SetDlgItemText (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS, |
69 | SetDlgItemText (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS, LOCALIZE (L"Registration_YourEmailHere")); |
72 | SetWindowText (GetDlgItem (hWnd, BUTTON_VALIDATECODE), LOCALIZE (L"Registration_ValidateCode")); |
70 | SetWindowText (GetDlgItem (hWnd, BUTTON_VALIDATECODE), LOCALIZE (L"Registration_ValidateCode")); |
73 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_STATUSBAR), LOCALIZE (L"Registration_StatusBar")); |
71 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_STATUSBAR), LOCALIZE (L"Registration_StatusBar")); |
74 | 72 | ||
75 | // set focus to the first settable item |
73 | // set focus to the first settable item |
76 | SendMessage (GetDlgItem (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS), EM_SETSEL, 0, -1); // select all text |
74 | SendMessage (GetDlgItem (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS), EM_SETSEL, 0, -1); // select all text |
77 | SetFocus (GetDlgItem (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS)); |
75 | SetFocus (GetDlgItem (hWnd, EDITBOX_REGISTRATION_EMAILADDRESS)); |
78 | 76 | ||
79 | // convert the |
77 | // convert the Paypal bitmap and the status bar message to hyperlinks |
80 | ConvertStaticToHyperlink (GetDlgItem (hWnd, |
78 | ConvertStaticToHyperlink (GetDlgItem (hWnd, BUTTON_DONATE)); |
81 | ConvertStaticToHyperlink (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_STATUSBAR)); |
79 | ConvertStaticToHyperlink (GetDlgItem (hWnd, STATICTEXT_REGISTRATION_STATUSBAR)); |
82 | } |
80 | } |
83 | 81 | ||
84 | // else did we click the close button on the title bar ? |
82 | // else did we click the close button on the title bar ? |
85 | else if (message == WM_CLOSE) |
83 | else if (message == WM_CLOSE) |
Line 107... | Line 105... | ||
107 | candidate_email[write_index] = tolower (candidate_email[read_index]); // force lowercase |
105 | candidate_email[write_index] = tolower (candidate_email[read_index]); // force lowercase |
108 | write_index++; // keep only valid signs and discard spaces |
106 | write_index++; // keep only valid signs and discard spaces |
109 | } |
107 | } |
110 | candidate_email[write_index] = 0; // ensure string is correctly terminated |
108 | candidate_email[write_index] = 0; // ensure string is correctly terminated |
111 | 109 | ||
112 | EnableWindow (GetDlgItem (hWnd, BUTTON_VALIDATECODE), ((candidate_email[0] != 0) && (wcslen (candidate_email) > 5) && ( |
110 | EnableWindow (GetDlgItem (hWnd, BUTTON_VALIDATECODE), ((candidate_email[0] != 0) && (wcslen (candidate_email) > 5) && (wcscmp (candidate_email, LOCALIZE (L"Registration_YourEmailHere")) != 0) |
113 | && (wcschr (candidate_email, L'@') != NULL) && (wcschr (candidate_email, L'.') != NULL))); |
111 | && (wcschr (candidate_email, L'@') != NULL) && (wcschr (candidate_email, L'.') != NULL))); |
114 | } |
112 | } |
115 | 113 | ||
116 | // else was it the validation button ? |
114 | // else was it the validation button ? |
117 | else if (wParam_loword == BUTTON_VALIDATECODE) |
115 | else if (wParam_loword == BUTTON_VALIDATECODE) |
Line 147... | Line 145... | ||
147 | if (wcscmp (languages[language_id].name, L"French") == 0) |
145 | if (wcscmp (languages[language_id].name, L"French") == 0) |
148 | ShellExecute (NULL, L"open", PAYPAL_URL_FR, NULL, NULL, SW_MAXIMIZE); // open PayPal in French in the default browser, maximized |
146 | ShellExecute (NULL, L"open", PAYPAL_URL_FR, NULL, NULL, SW_MAXIMIZE); // open PayPal in French in the default browser, maximized |
149 | else |
147 | else |
150 | ShellExecute (NULL, L"open", PAYPAL_URL_XX, NULL, NULL, SW_MAXIMIZE); // open PayPal in English (default) the default browser, maximized |
148 | ShellExecute (NULL, L"open", PAYPAL_URL_XX, NULL, NULL, SW_MAXIMIZE); // open PayPal in English (default) the default browser, maximized |
151 | } |
149 | } |
152 | - | ||
153 | // else was it the "no PayPal" hyperlink ? |
- | |
154 | else if (wParam_loword == STATICTEXT_REGISTRATION_NOPAYPAL) |
- | |
155 | ShellExecute (NULL, L"open", NOPAYPAL_URL, NULL, NULL, SW_MAXIMIZE); // open the bank account page in the default browser, maximized |
- | |
156 | 150 | ||
157 | // else was it the status bar hyperlink ? |
151 | // else was it the status bar hyperlink ? |
158 | else if (wParam_loword == STATICTEXT_REGISTRATION_STATUSBAR) |
152 | else if (wParam_loword == STATICTEXT_REGISTRATION_STATUSBAR) |
159 | ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the main page in the default browser, maximized |
153 | ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the main page in the default browser, maximized |
160 | } |
154 | } |