Fixed initial size of features type combo popup when building against wxWidgets 3.1.3
This commit is contained in:
parent
6a7efbbf96
commit
d8a81e978a
1 changed files with 11 additions and 15 deletions
|
@ -237,7 +237,7 @@ void show_error_id(int id, const std::string& message)
|
||||||
|
|
||||||
void show_info(wxWindow* parent, const wxString& message, const wxString& title)
|
void show_info(wxWindow* parent, const wxString& message, const wxString& title)
|
||||||
{
|
{
|
||||||
wxMessageDialog msg_wingow(parent, message, wxString(SLIC3R_APP_NAME " - ") + (title.empty() ? _(L("Notice")) : title), wxOK | wxICON_INFORMATION);
|
wxMessageDialog msg_wingow(parent, message, wxString(SLIC3R_APP_NAME " - ") + (title.empty() ? _L("Notice") : title), wxOK | wxICON_INFORMATION);
|
||||||
msg_wingow.ShowModal();
|
msg_wingow.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ void show_info(wxWindow* parent, const char* message, const char* title)
|
||||||
|
|
||||||
void warning_catcher(wxWindow* parent, const wxString& message)
|
void warning_catcher(wxWindow* parent, const wxString& message)
|
||||||
{
|
{
|
||||||
wxMessageDialog msg(parent, message, _(L("Warning")), wxOK | wxICON_WARNING);
|
wxMessageDialog msg(parent, message, _L("Warning"), wxOK | wxICON_WARNING);
|
||||||
msg.ShowModal();
|
msg.ShowModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,14 +259,14 @@ void create_combochecklist(wxComboCtrl* comboCtrl, std::string text, std::string
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxCheckListBoxComboPopup* popup = new wxCheckListBoxComboPopup;
|
wxCheckListBoxComboPopup* popup = new wxCheckListBoxComboPopup;
|
||||||
if (popup != nullptr)
|
if (popup != nullptr) {
|
||||||
{
|
// FIXME If the following line is removed, the combo box popup list will not react to mouse clicks.
|
||||||
// FIXME If the following line is removed, the combo box popup list will not react to mouse clicks.
|
|
||||||
// On the other side, with this line the combo box popup cannot be closed by clicking on the combo button on Windows 10.
|
// On the other side, with this line the combo box popup cannot be closed by clicking on the combo button on Windows 10.
|
||||||
comboCtrl->UseAltPopupWindow();
|
comboCtrl->UseAltPopupWindow();
|
||||||
|
|
||||||
comboCtrl->EnablePopupAnimation(false);
|
// the following line messes up the popup size the first time it is shown on wxWidgets 3.1.3
|
||||||
comboCtrl->SetPopupControl(popup);
|
// comboCtrl->EnablePopupAnimation(false);
|
||||||
|
comboCtrl->SetPopupControl(popup);
|
||||||
popup->SetStringValue(from_u8(text));
|
popup->SetStringValue(from_u8(text));
|
||||||
popup->Bind(wxEVT_CHECKLISTBOX, [popup](wxCommandEvent& evt) { popup->OnCheckListBox(evt); });
|
popup->Bind(wxEVT_CHECKLISTBOX, [popup](wxCommandEvent& evt) { popup->OnCheckListBox(evt); });
|
||||||
popup->Bind(wxEVT_LISTBOX, [popup](wxCommandEvent& evt) { popup->OnListBoxSelection(evt); });
|
popup->Bind(wxEVT_LISTBOX, [popup](wxCommandEvent& evt) { popup->OnListBoxSelection(evt); });
|
||||||
|
@ -276,13 +276,11 @@ void create_combochecklist(wxComboCtrl* comboCtrl, std::string text, std::string
|
||||||
std::vector<std::string> items_str;
|
std::vector<std::string> items_str;
|
||||||
boost::split(items_str, items, boost::is_any_of("|"), boost::token_compress_off);
|
boost::split(items_str, items, boost::is_any_of("|"), boost::token_compress_off);
|
||||||
|
|
||||||
for (const std::string& item : items_str)
|
for (const std::string& item : items_str) {
|
||||||
{
|
|
||||||
popup->Append(from_u8(item));
|
popup->Append(from_u8(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < popup->GetCount(); ++i)
|
for (unsigned int i = 0; i < popup->GetCount(); ++i) {
|
||||||
{
|
|
||||||
popup->Check(i, initial_value);
|
popup->Check(i, initial_value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,10 +291,8 @@ int combochecklist_get_flags(wxComboCtrl* comboCtrl)
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
wxCheckListBoxComboPopup* popup = wxDynamicCast(comboCtrl->GetPopupControl(), wxCheckListBoxComboPopup);
|
wxCheckListBoxComboPopup* popup = wxDynamicCast(comboCtrl->GetPopupControl(), wxCheckListBoxComboPopup);
|
||||||
if (popup != nullptr)
|
if (popup != nullptr) {
|
||||||
{
|
for (unsigned int i = 0; i < popup->GetCount(); ++i) {
|
||||||
for (unsigned int i = 0; i < popup->GetCount(); ++i)
|
|
||||||
{
|
|
||||||
if (popup->IsChecked(i))
|
if (popup->IsChecked(i))
|
||||||
flags |= 1 << i;
|
flags |= 1 << i;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue