mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-07 03:48:25 +00:00
TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to handle UTF-8 regardless of system regional settings. (#7660)
This commit is contained in:
@@ -57,6 +57,8 @@ Other changes:
|
||||
which amusingly made it disappear when using very big font/frame size.
|
||||
- Tables: fixed calling SetNextWindowScroll() on clipped scrolling table
|
||||
to not leak the value into a subsequent window. (#8196)
|
||||
- TextLinkOpenURL(): fixed default Win32 io.PlatformOpenInShellFn handler to
|
||||
handle UTF-8 regardless of system regional settings. (#7660) [@achabense]
|
||||
- Demo: Combos: demonstrate a very simple way to add a filter to a combo,
|
||||
by showing the filter inside the combo contents. (#718)
|
||||
- Backends: Metal: Fixed a crash on application resources. (#8367, #7419) [@anszom]
|
||||
|
@@ -15090,7 +15090,11 @@ static void Platform_SetClipboardTextFn_DefaultImpl(ImGuiContext* ctx, const cha
|
||||
#endif
|
||||
static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
|
||||
{
|
||||
return (INT_PTR)::ShellExecuteA(NULL, "open", path, NULL, NULL, SW_SHOWDEFAULT) > 32;
|
||||
const int path_wsize = ::MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
|
||||
ImVector<wchar_t> path_wbuf;
|
||||
path_wbuf.resize(path_wsize);
|
||||
::MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wbuf.Data, path_wsize);
|
||||
return (INT_PTR)::ShellExecuteW(NULL, L"open", path_wbuf.Data, NULL, NULL, SW_SHOWDEFAULT) > 32;
|
||||
}
|
||||
#else
|
||||
#include <sys/wait.h>
|
||||
|
2
imgui.h
2
imgui.h
@@ -3565,7 +3565,7 @@ struct ImGuiPlatformIO
|
||||
void* Platform_ClipboardUserData;
|
||||
|
||||
// Optional: Open link/folder/file in OS Shell
|
||||
// (default to use ShellExecuteA() on Windows, system() on Linux/Mac)
|
||||
// (default to use ShellExecuteW() on Windows, system() on Linux/Mac)
|
||||
bool (*Platform_OpenInShellFn)(ImGuiContext* ctx, const char* path);
|
||||
void* Platform_OpenInShellUserData;
|
||||
|
||||
|
@@ -7771,6 +7771,9 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
||||
#ifdef IMGUI_DISABLE_WIN32_FUNCTIONS
|
||||
ImGui::Text("define: IMGUI_DISABLE_WIN32_FUNCTIONS");
|
||||
#endif
|
||||
#ifdef IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS
|
||||
ImGui::Text("define: IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS");
|
||||
#endif
|
||||
#ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
|
||||
ImGui::Text("define: IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS");
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user