This commit is contained in:
YuSanka 2019-03-27 13:18:27 +01:00
parent 734d57a714
commit 87febaacc0
2 changed files with 20 additions and 7 deletions

View file

@ -540,13 +540,26 @@ void Choice::BUILD() {
else{
for (auto el : m_opt.enum_labels.empty() ? m_opt.enum_values : m_opt.enum_labels) {
const wxString& str = _(el);//m_opt_id == "support" ? _(el) : el;
//FIXME Vojtech: Why is the single column empty icon necessary? It is a workaround of some kind, but what for?
// Please document such workarounds by comments!
// temp->Append(str, create_scaled_bitmap("empty_icon.png"));
temp->Append(str, wxNullBitmap);
temp->Append(str);
}
set_selection();
}
#ifndef __WXGTK__
/* Workaround for a correct rendering of the control without Bitmap (under MSW and OSX):
*
* 1. We should create small Bitmap to fill Bitmaps RefData,
* ! in this case wxBitmap.IsOK() return true.
* 2. But then set width to 0 value for no using of bitmap left and right spacing
* 3. Set this empty bitmap to the at list one item and BitmapCombobox will be recreated correct
*
* Note: Set bitmap height to the Font size because of OSX rendering.
*/
wxBitmap empty_bmp(1, temp->GetFont().GetPixelSize().y + 2);
empty_bmp.SetWidth(0);
temp->SetItemBitmap(0, empty_bmp);
#endif
// temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent e) { on_change_field(); }), temp->GetId());
temp->Bind(wxEVT_COMBOBOX, ([this](wxCommandEvent e) { on_change_field(); }), temp->GetId());