Merge with develop

This commit is contained in:
kervala 2016-10-25 11:50:27 +02:00
parent c02ab44327
commit df676ede7e
5 changed files with 32 additions and 7 deletions

View file

@ -2267,7 +2267,10 @@ bool CDriverD3D::getCurrentScreenMode(GfxMode &gfxMode)
// ***************************************************************************
void CDriverD3D::setWindowTitle(const ucstring &title)
{
SetWindowTextW(_HWnd,(WCHAR*)title.c_str());
if (!SetWindowTextW(_HWnd, (WCHAR*)title.c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
}
// ***************************************************************************

View file

@ -2314,7 +2314,10 @@ void CDriverGL::setWindowTitle(const ucstring &title)
#ifdef NL_OS_WINDOWS
SetWindowTextW(_win, (WCHAR*)title.c_str());
if (!SetWindowTextW(_win, (WCHAR*)title.c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
#elif defined(NL_OS_MAC)

View file

@ -40,7 +40,10 @@ void CWin32Util::localizeWindow(HWND wnd)
std::string winText = wideToUtf8(str);
if (CI18N::hasTranslation(winText))
{
SetWindowTextW(wnd, (const WCHAR *) CI18N::get(winText).c_str());
if (!SetWindowTextW(wnd, (const WCHAR *) CI18N::get(winText).c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
}
}
HWND currSon = GetWindow(wnd, GW_CHILD);

View file

@ -217,8 +217,13 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
ucstring ucs;
// convert the text from UTF-8 to unicode
ucs.fromUtf8(cwd->_History[cwd->_PosInHistory]);
// set the text as unicode string
SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str());
if (!SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
SendMessageA (cwd->_HInputEdit, EM_SETSEL, (WPARAM)ucs.size(), (LPARAM)ucs.size());
}
}
@ -234,8 +239,13 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
ucstring ucs;
// convert the text from UTF-8 to unicode
ucs.fromUtf8(cwd->_History[cwd->_PosInHistory]);
// set the text as unicode string
SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str());
if (!SetWindowTextW(cwd->_HInputEdit, (LPCWSTR)ucs.c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
SendMessageA (cwd->_HInputEdit, EM_SETSEL, (WPARAM)ucs.size(), (LPARAM)ucs.size());
}
}
@ -352,7 +362,10 @@ void CWinDisplayer::setTitleBar (const string &titleBar)
nldebug("SERVICE: Set title bar to '%s'", wn.c_str());
SetWindowTextW (_HWnd, (LPWSTR)ucstring::makeFromUtf8(wn).c_str());
if (!SetWindowTextW(_HWnd, (LPWSTR)ucstring::makeFromUtf8(wn).c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
}
void CWinDisplayer::open (string titleBar, bool iconified, sint x, sint y, sint w, sint h, sint hs, sint fs, const std::string &fn, bool ww, CLog *log)

View file

@ -257,7 +257,10 @@ static INT_PTR CALLBACK ExitClientErrorDialogProc(HWND hwndDlg, UINT uMsg, WPARA
{
if (CI18N::hasTranslation("TheSagaOfRyzom"))
{
SetWindowTextW(hwndDlg, (WCHAR*)CI18N::get ("TheSagaOfRyzom").c_str ());
if (!SetWindowTextW(hwndDlg, (WCHAR*)CI18N::get ("TheSagaOfRyzom").c_str ()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
}
SetDlgItemTextW(hwndDlg, IDC_ERROR_MSG_TEXT, (WCHAR*) CurrentErrorMessage.c_str ());
if (CI18N::hasTranslation("uiRyzomErrorMsgBoxExit"))