[wxMSW] wxPropertyrGrid button text (drop down arrow) is corrupted (small patch included) (Issue #23095)

28 views
Skip to first unread message

Eran Ifrah

unread,
Dec 28, 2022, 5:33:51 PM12/28/22
to wx-...@googlegroups.com, Subscribed

The button looks corrupted, this is caused because the text used for the button is Unicode (the unicode symbol for ...)
Such symbols should not be translated, so wrapping them with wxT(...) fixes the issue

pg-bad

this one-liner patch fixes this:

diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp
index 8e2205a3af..b06e530174 100644
--- a/src/propgrid/editors.cpp
+++ b/src/propgrid/editors.cpp
@@ -1979,7 +1979,7 @@ wxWindow* wxPropertyGrid::GenerateEditorButton( const wxPoint& pos, const wxSize
     wxPGProperty* selected = GetSelection();
     wxASSERT(selected);

-    const wxString label("\u2026"); // "Horizontal ellipsis" character
+    const wxString label(wxT("\u2026")); // "Horizontal ellipsis" character

     int dim = sz.y + 2*wxPG_BUTTON_BORDER_WIDTH;

pg-good


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23095@github.com>

VZ

unread,
Dec 28, 2022, 5:36:50 PM12/28/22
to wx-...@googlegroups.com, Subscribed

Thanks, this should indeed be either L"\u2026" or FromUTF8("\xE2\x80\xA6") if you prefer. I'll let @a-wi choose...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23095/1366962882@github.com>

Eran Ifrah

unread,
Dec 28, 2022, 5:39:59 PM12/28/22
to wx-...@googlegroups.com, Subscribed

IMO, the former is more human readable, but - its not up to me ...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23095/1366963785@github.com>

VZ

unread,
Dec 28, 2022, 7:01:51 PM12/28/22
to wx-...@googlegroups.com, Subscribed

The advantage of using FromUTF8() is that we could actually use the real character too in the sources if we could guarantee that they always use UTF-8 encoding. Unfortunately I don't know if we can do it for wx -- for my own code I do it like this but I have more control on how it's compiled.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23095/1366988880@github.com>

AW

unread,
Dec 29, 2022, 7:29:54 AM12/29/22
to wx-...@googlegroups.com, Subscribed

@eranif It looks you see the issue in wxMSW port. What compiler/custom settings do you use? With VS 2022 (wxUSE_STL=1, wxUSE_STD_CONTAINERS=1) ellipsis character looks fine without L (wxT) prefix in the string representation. It also looks fine without any prefix under wxGTK with g++ 10.2.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23095/1367286924@github.com>

VZ

unread,
Dec 29, 2022, 9:44:28 AM12/29/22
to wx-...@googlegroups.com, Subscribed

Using \u inside a narrow string encodes the character in the compiler character set (almost invariably, but not necessarily, UTF-8 nowadays). Constructing wxString from narrow string uses the current locale encoding which will again typically, but not always, be UTF-8. So it's not surprising that it works sometimes. It is, however, perfectly possible that it doesn't work in other cases and we should really use either L or UTF-8 for it explicitly.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/23095/1367379170@github.com>

AW

unread,
Dec 30, 2022, 8:23:59 AM12/30/22
to wx-...@googlegroups.com, Subscribed

Closed #23095 as completed via 7cd5826.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issue/23095/issue_event/8130431218@github.com>

Reply all
Reply to author
Forward
0 new messages