From fe0f6838b87c8a43219931c2f7700e9d80f6c6ae Mon Sep 17 00:00:00 2001 From: twanvl Date: Sat, 21 Apr 2007 21:09:17 +0000 Subject: [PATCH] fixes to non-unicode build git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@280 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/drop_down_list.cpp | 4 ++++ src/gui/util.cpp | 2 +- src/gui/value/text.cpp | 6 +++++- src/mse.vcproj | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gui/drop_down_list.cpp b/src/gui/drop_down_list.cpp index bb355003..468552f5 100644 --- a/src/gui/drop_down_list.cpp +++ b/src/gui/drop_down_list.cpp @@ -352,7 +352,11 @@ bool DropDownList::onCharInParent(wxKeyEvent& ev) { for (size_t i = 0 ; i < count ; ++i) { size_t index = (si + i) % count; String c = itemText(index); +#ifdef UNICODE if (!c.empty() && toUpper(c.GetChar(0)) == toUpper(ev.GetUnicodeKey())) { +#else + if (!c.empty() && toUpper(c.GetChar(0)) == toUpper(ev.GetKeyCode())) { +#endif // first character matches selected_item = index; showSubMenu(); diff --git a/src/gui/util.cpp b/src/gui/util.cpp index 27d57603..9add1708 100644 --- a/src/gui/util.cpp +++ b/src/gui/util.cpp @@ -152,7 +152,7 @@ void draw_control_border(Window* win, DC& dc, const wxRect& rect) { RECT r; wxUxThemeEngine *themeEngine = wxUxThemeEngine::Get(); if (themeEngine && themeEngine->IsAppThemed()) { - wxUxThemeHandle hTheme(win, _("EDIT")); + wxUxThemeHandle hTheme(win, L"EDIT"); r.left = rect.x -1; r.top = rect.y -1; r.right = rect.x + rect.width + 1; diff --git a/src/gui/value/text.cpp b/src/gui/value/text.cpp index 6fb5f8a6..1e68739c 100644 --- a/src/gui/value/text.cpp +++ b/src/gui/value/text.cpp @@ -199,7 +199,11 @@ bool TextValueEditor::onChar(wxKeyEvent& ev) { // TODO: Find a more correct way to determine normal characters, // this might not work for internationalized input. // It might also not be portable! - replaceSelection(escape(String(ev.GetUnicodeKey(), 1)), _("Typing")); + #ifdef UNICODE + replaceSelection(escape(String(ev.GetUnicodeKey(), 1)), _("Typing")); + #else + replaceSelection(escape(String((Char)ev.GetKeyCode(), 1)), _("Typing")); + #endif } else { return false; } diff --git a/src/mse.vcproj b/src/mse.vcproj index ae055211..0a34df9e 100644 --- a/src/mse.vcproj +++ b/src/mse.vcproj @@ -110,7 +110,7 @@ Name="VCCustomBuildTool"/>