From ff6a551c5007e872aba992adcc89e3bd61474d1f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 23 May 2016 15:02:08 +0200 Subject: [PATCH] Unicode code in Character Selector is four hexadecimal digits long now --- ZRCola/zrcolachrslct.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ZRCola/zrcolachrslct.cpp b/ZRCola/zrcolachrslct.cpp index 331706e..cdc9338 100644 --- a/ZRCola/zrcolachrslct.cpp +++ b/ZRCola/zrcolachrslct.cpp @@ -36,7 +36,7 @@ wxZRColaCharSelect::wxZRColaCharSelect(wxWindow* parent) : { Connect(wxID_ANY, wxEVT_SEARCH_COMPLETE, wxThreadEventHandler(wxZRColaCharSelect::OnSearchComplete), NULL, this); - m_unicode->SetValidator(wxHexValidator(&m_char)); + m_unicode->SetValidator(wxHexValidator(&m_char, wxNUM_VAL_DEFAULT, 4)); // Fill categories. ZRColaApp *app = (ZRColaApp*)wxTheApp; @@ -169,8 +169,11 @@ void wxZRColaCharSelect::OnSearchComplete(wxThreadEvent& event) void wxZRColaCharSelect::OnResultSelectCell(wxGridEvent& event) { wxString val(m_gridResults->GetCellValue(event.GetRow(), event.GetCol())); - m_char = val.IsEmpty() ? 0 : val[0]; - m_unicode->GetValidator()->TransferToWindow(); + wchar_t c = val.IsEmpty() ? 0 : val[0]; + if (m_char != c) { + m_char = c; + m_unicode->GetValidator()->TransferToWindow(); + } }