Skip to content

Commit

Permalink
Fix LanguageCtrl hints on wxMSW.
Browse files Browse the repository at this point in the history
The change in 30d1adb broke wxMSW for a change.
  • Loading branch information
vslavik committed Dec 3, 2013
1 parent 691eede commit f0f13d1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/languagectrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ void LanguageCtrl::Init(Language lang)
{
SetHint(_("Language Code or Name (e.g. en_GB)"));

// wxGTK must have the value set before autocompletion to avoid annoying
// popups in some (hard to determine) cases.
#ifdef __WXGTK__
if (lang.IsValid())
SetValue(lang.FormatForRoundtrip());
#endif

#ifdef __WXOSX__
for (auto x: Language::AllFormattedNames())
Expand All @@ -61,6 +65,12 @@ void LanguageCtrl::Init(Language lang)
#endif

m_inited = true;

// ...but wxMSW requires the opposite, otherwise the text wouldn't appear.
#ifndef __WXGTK__
if (lang.IsValid())
SetValue(lang.FormatForRoundtrip());
#endif
}

void LanguageCtrl::SetLang(const Language& lang)
Expand Down

0 comments on commit f0f13d1

Please sign in to comment.