| OLD | NEW |
| 1 #include <sstream> | 1 #include <sstream> |
| 2 #include <string> | 2 #include <string> |
| 3 #include <Windows.h> | 3 #include <Windows.h> |
| 4 | 4 |
| 5 #include "../shared/Dictionary.h" | 5 #include "../shared/Dictionary.h" |
| 6 #include "../shared/Utils.h" | 6 #include "../shared/Utils.h" |
| 7 #include "UpdateInstallDialog.h" | 7 #include "UpdateInstallDialog.h" |
| 8 | 8 |
| 9 namespace | 9 namespace |
| 10 { | 10 { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 int GetAverageCharacterWidth(HDC deviceContext) | 53 int GetAverageCharacterWidth(HDC deviceContext) |
| 54 { | 54 { |
| 55 std::wstring alphabet; | 55 std::wstring alphabet; |
| 56 for (wchar_t letter = L'A'; letter != 'Z'; letter++) | 56 for (wchar_t letter = L'A'; letter != 'Z'; letter++) |
| 57 alphabet += letter; | 57 alphabet += letter; |
| 58 RECT alphabetRect = {}; | 58 RECT alphabetRect = {}; |
| 59 DrawTextW(deviceContext, alphabet.c_str(), -1, &alphabetRect, | 59 DrawTextW(deviceContext, alphabet.c_str(), -1, &alphabetRect, |
| 60 DT_CALCRECT | DT_NOPREFIX); | 60 DT_CALCRECT | DT_NOPREFIX); |
| 61 return alphabetRect.right / alphabet.length(); | 61 return alphabetRect.right / static_cast<int>(alphabet.length()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 HWND CreateStaticText(HWND parent) | 64 HWND CreateStaticText(HWND parent) |
| 65 { | 65 { |
| 66 Dictionary* dictionary = Dictionary::GetInstance(); | 66 Dictionary* dictionary = Dictionary::GetInstance(); |
| 67 std::wstring text = dictionary->Lookup("updater", "install-question-text"); | 67 std::wstring text = dictionary->Lookup("updater", "install-question-text"); |
| 68 | 68 |
| 69 HDC deviceContext = GetDC(parent); | 69 HDC deviceContext = GetDC(parent); |
| 70 const int characterWidth = GetAverageCharacterWidth(deviceContext); | 70 const int characterWidth = GetAverageCharacterWidth(deviceContext); |
| 71 const int lineLength = 40; | 71 const int lineLength = 40; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 ShowWindow(window, SW_SHOW); | 180 ShowWindow(window, SW_SHOW); |
| 181 MSG message; | 181 MSG message; |
| 182 while(GetMessage(&message, 0, 0, 0) > 0) | 182 while(GetMessage(&message, 0, 0, 0) > 0) |
| 183 { | 183 { |
| 184 TranslateMessage(&message); | 184 TranslateMessage(&message); |
| 185 DispatchMessage(&message); | 185 DispatchMessage(&message); |
| 186 } | 186 } |
| 187 ShowWindow(window, SW_HIDE); | 187 ShowWindow(window, SW_HIDE); |
| 188 return message.wParam == 0; | 188 return message.wParam == 0; |
| 189 } | 189 } |
| OLD | NEW |