Fix compatibility with STL builds of wxWidgets (#2218)

This removes the dependency on legacy wxWidgets configurations,
and makes OrcaSlicer compile on STL builds.

Also, the wxStringList class has been obsolete for at least 20
years, and disappeared from the documentation.
Replace with wxArrayString.
This commit is contained in:
mia 2023-09-25 17:35:30 +02:00 committed by GitHub
parent ff992aa650
commit ca534b5b96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 47 deletions

View file

@ -9240,49 +9240,49 @@ wxBoxSizer *ProjectDropDialog::create_item_checkbox(wxString title, wxWindow *pa
void ProjectDropDialog::select_radio(int index)
{
m_action = index;
RadioSelectorList::Node *node = m_radio_group.GetFirst();
RadioSelectorList::compatibility_iterator it = m_radio_group.GetFirst();
auto groupid = 0;
while (node) {
RadioSelector *rs = node->GetData();
while (it) {
RadioSelector *rs = it->GetData();
if (rs->m_select_id == index) groupid = rs->m_groupid;
node = node->GetNext();
it = it->GetNext();
}
node = m_radio_group.GetFirst();
while (node) {
RadioSelector *rs = node->GetData();
it = m_radio_group.GetFirst();
while (it) {
RadioSelector *rs = it->GetData();
if (rs->m_groupid == groupid && rs->m_select_id == index) rs->m_radiobox->SetValue(true);
if (rs->m_groupid == groupid && rs->m_select_id != index) rs->m_radiobox->SetValue(false);
node = node->GetNext();
it = it->GetNext();
}
}
int ProjectDropDialog::get_select_radio(int groupid)
{
RadioSelectorList::Node *node = m_radio_group.GetFirst();
while (node) {
RadioSelector *rs = node->GetData();
RadioSelectorList::compatibility_iterator it = m_radio_group.GetFirst();
while (it) {
RadioSelector *rs = it->GetData();
if (rs->m_groupid == groupid && rs->m_radiobox->GetValue()) { return rs->m_select_id; }
node = node->GetNext();
it = it->GetNext();
}
return 0;
}
void ProjectDropDialog::on_select_radio(wxMouseEvent &event)
{
RadioSelectorList::Node *node = m_radio_group.GetFirst();
RadioSelectorList::compatibility_iterator it = m_radio_group.GetFirst();
auto groupid = 0;
while (node) {
RadioSelector *rs = node->GetData();
while (it) {
RadioSelector *rs = it->GetData();
if (rs->m_radiobox->GetId() == event.GetId()) groupid = rs->m_groupid;
node = node->GetNext();
it = it->GetNext();
}
node = m_radio_group.GetFirst();
while (node) {
RadioSelector *rs = node->GetData();
it = m_radio_group.GetFirst();
while (it) {
RadioSelector *rs = it->GetData();
if (rs->m_groupid == groupid && rs->m_radiobox->GetId() == event.GetId()) {
set_action(rs->m_select_id);
rs->m_radiobox->SetValue(true);
@ -9290,7 +9290,7 @@ void ProjectDropDialog::on_select_radio(wxMouseEvent &event)
if (rs->m_groupid == groupid && rs->m_radiobox->GetId() != event.GetId()) rs->m_radiobox->SetValue(false);
node = node->GetNext();
it = it->GetNext();
}
}