ImGui keyboard input fields are now locale-sensitive
This commit is contained in:
parent
b8c949ea71
commit
b71d787f69
1 changed files with 3 additions and 1 deletions
|
@ -40,6 +40,8 @@ Index of this file:
|
||||||
#endif
|
#endif
|
||||||
#include "imgui_internal.h"
|
#include "imgui_internal.h"
|
||||||
|
|
||||||
|
#include <locale.h>
|
||||||
|
|
||||||
// System includes
|
// System includes
|
||||||
#include <ctype.h> // toupper
|
#include <ctype.h> // toupper
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
||||||
|
@ -3804,7 +3806,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
|
||||||
// The standard mandate that programs starts in the "C" locale where the decimal point is '.'.
|
// The standard mandate that programs starts in the "C" locale where the decimal point is '.'.
|
||||||
// We don't really intend to provide widespread support for it, but out of empathy for people stuck with using odd API, we support the bare minimum aka overriding the decimal point.
|
// We don't really intend to provide widespread support for it, but out of empathy for people stuck with using odd API, we support the bare minimum aka overriding the decimal point.
|
||||||
// Change the default decimal_point with:
|
// Change the default decimal_point with:
|
||||||
// ImGui::GetCurrentContext()->PlatformLocaleDecimalPoint = *localeconv()->decimal_point;
|
ImGui::GetCurrentContext()->PlatformLocaleDecimalPoint = *localeconv()->decimal_point;
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
const unsigned c_decimal_point = (unsigned int)g.PlatformLocaleDecimalPoint;
|
const unsigned c_decimal_point = (unsigned int)g.PlatformLocaleDecimalPoint;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue