mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
Make Compatible with wx 3.1.5
This should be reverted when wxWidgets 3.2.1 is re-implemented
This commit is contained in:
parent
f7ca92e11c
commit
8770c4b7de
5 changed files with 21 additions and 10 deletions
|
@ -362,7 +362,7 @@ void EditGCodeDialog::on_dpi_changed(const wxRect&suggested_rect)
|
||||||
|
|
||||||
void EditGCodeDialog::on_sys_color_changed()
|
void EditGCodeDialog::on_sys_color_changed()
|
||||||
{
|
{
|
||||||
m_add_btn->sys_color_changed();
|
m_add_btn->msw_rescale();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Orca
|
//Orca
|
||||||
|
@ -620,9 +620,11 @@ void ParamsModel::GetValue(wxVariant& variant, const wxDataViewItem& item, unsig
|
||||||
ParamsNode* node = static_cast<ParamsNode*>(item.GetID());
|
ParamsNode* node = static_cast<ParamsNode*>(item.GetID());
|
||||||
if (col == (unsigned int)0)
|
if (col == (unsigned int)0)
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
variant << wxDataViewIconText(node->text, get_bmp_bundle(node->icon_name)->GetIconFor(m_ctrl->GetParent()));
|
// variant << wxDataViewIconText(node->text, get_bmp_bundle(node->icon_name)->GetIconFor(m_ctrl->GetParent())); //TODO: update to bundle with wx update
|
||||||
|
wxDataViewIconText(node->text, create_scaled_bitmap(node->icon_name, m_ctrl->GetParent()));
|
||||||
#else
|
#else
|
||||||
variant << DataViewBitmapText(node->text, get_bmp_bundle(node->icon_name)->GetBitmapFor(m_ctrl->GetParent()));
|
// variant << DataViewBitmapText(node->text, get_bmp_bundle(node->icon_name)->GetBitmapFor(m_ctrl->GetParent())); //TODO: update to bundle with wx update
|
||||||
|
variant << DataViewBitmapText(node->text, create_scaled_bitmap(node->icon_name, m_ctrl->GetParent()));
|
||||||
#endif //__linux__
|
#endif //__linux__
|
||||||
else
|
else
|
||||||
wxLogError("DiffModel::GetValue: wrong column %d", col);
|
wxLogError("DiffModel::GetValue: wrong column %d", col);
|
||||||
|
@ -690,7 +692,14 @@ unsigned int ParamsModel::GetChildren(const wxDataViewItem& parent, wxDataViewIt
|
||||||
|
|
||||||
return array.Count();
|
return array.Count();
|
||||||
}
|
}
|
||||||
|
unsigned int ParamsModel::GetColumnCount() const { return 1; }
|
||||||
|
wxString ParamsModel::GetColumnType(unsigned int col) const {
|
||||||
|
#ifdef __linux__
|
||||||
|
return wxT("wxDataViewIconText");
|
||||||
|
#else
|
||||||
|
return wxT("DataViewBitmapText");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// ParamsViewCtrl
|
// ParamsViewCtrl
|
||||||
|
|
|
@ -178,6 +178,8 @@ public:
|
||||||
|
|
||||||
wxDataViewItem GetParent(const wxDataViewItem& item) const override;
|
wxDataViewItem GetParent(const wxDataViewItem& item) const override;
|
||||||
unsigned int GetChildren(const wxDataViewItem& parent, wxDataViewItemArray& array) const override;
|
unsigned int GetChildren(const wxDataViewItem& parent, wxDataViewItemArray& array) const override;
|
||||||
|
unsigned int GetColumnCount() const override;
|
||||||
|
wxString GetColumnType(unsigned int col) const override;
|
||||||
|
|
||||||
void GetValue(wxVariant& variant, const wxDataViewItem& item, unsigned int col) const override;
|
void GetValue(wxVariant& variant, const wxDataViewItem& item, unsigned int col) const override;
|
||||||
bool SetValue(const wxVariant& variant, const wxDataViewItem& item, unsigned int col) override;
|
bool SetValue(const wxVariant& variant, const wxDataViewItem& item, unsigned int col) override;
|
||||||
|
|
|
@ -150,7 +150,7 @@ public:
|
||||||
|
|
||||||
// Edit field button
|
// Edit field button
|
||||||
bool has_edit_ui() const { return !m_edit_ui.tooltip.IsEmpty(); }
|
bool has_edit_ui() const { return !m_edit_ui.tooltip.IsEmpty(); }
|
||||||
const wxBitmapBundle* edit_bitmap() const { return &m_edit_ui.bitmap->bmp(); }
|
const wxBitmap* edit_bitmap() const { return &m_edit_ui.bitmap->bmp(); }
|
||||||
const wxString* edit_tooltip() const { return &m_edit_ui.tooltip; }
|
const wxString* edit_tooltip() const { return &m_edit_ui.tooltip; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -776,7 +776,7 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos)
|
||||||
const wxPoint pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(),
|
const wxPoint pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(),
|
||||||
field->undo_bitmap()->bmp(), field->blink());
|
field->undo_bitmap()->bmp(), field->blink());
|
||||||
if (field->has_edit_ui())
|
if (field->has_edit_ui())
|
||||||
draw_edit_bmp(dc, pos, field->edit_bitmap());
|
draw_edit_bmp(dc, pos, *field->edit_bitmap());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1011,14 +1011,14 @@ wxPoint OG_CustomCtrl::CtrlLine::draw_act_bmps(wxDC& dc, wxPoint pos, const wxBi
|
||||||
return wxPoint(h_pos, v_pos);
|
return wxPoint(h_pos, v_pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxCoord OG_CustomCtrl::CtrlLine::draw_edit_bmp(wxDC &dc, wxPoint pos, const wxBitmapBundle *bmp_edit)
|
wxCoord OG_CustomCtrl::CtrlLine::draw_edit_bmp(wxDC &dc, wxPoint pos, const wxBitmap& bmp_edit)
|
||||||
{
|
{
|
||||||
const wxCoord h_pos = pos.x + ctrl->m_h_gap;
|
const wxCoord h_pos = pos.x + ctrl->m_h_gap;
|
||||||
const wxCoord v_pos = pos.y;
|
const wxCoord v_pos = pos.y;
|
||||||
const int bmp_w = get_bitmap_size(bmp_edit, ctrl).GetWidth();
|
const int bmp_w = bmp_edit.GetWidth();
|
||||||
rects_edit_icon.emplace_back(wxRect(h_pos, v_pos, bmp_w, bmp_w));
|
rects_edit_icon.emplace_back(wxRect(h_pos, v_pos, bmp_w, bmp_w));
|
||||||
|
|
||||||
dc.DrawBitmap(bmp_edit->GetBitmapFor(ctrl), h_pos, v_pos);
|
dc.DrawBitmap(bmp_edit, h_pos, v_pos);
|
||||||
|
|
||||||
return h_pos + bmp_w + ctrl->m_h_gap;
|
return h_pos + bmp_w + ctrl->m_h_gap;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ class OG_CustomCtrl :public wxPanel
|
||||||
wxCoord draw_text (wxDC& dc, wxPoint pos, const wxString& text, const wxColour* color, int width, bool is_url = false, bool is_main = false);
|
wxCoord draw_text (wxDC& dc, wxPoint pos, const wxString& text, const wxColour* color, int width, bool is_url = false, bool is_main = false);
|
||||||
wxPoint draw_blinking_bmp(wxDC& dc, wxPoint pos, bool is_blinking);
|
wxPoint draw_blinking_bmp(wxDC& dc, wxPoint pos, bool is_blinking);
|
||||||
wxPoint draw_act_bmps(wxDC& dc, wxPoint pos, const wxBitmap& bmp_undo_to_sys, const wxBitmap& bmp_undo, bool is_blinking, size_t rect_id = 0);
|
wxPoint draw_act_bmps(wxDC& dc, wxPoint pos, const wxBitmap& bmp_undo_to_sys, const wxBitmap& bmp_undo, bool is_blinking, size_t rect_id = 0);
|
||||||
wxCoord draw_edit_bmp(wxDC& dc, wxPoint pos, const wxBitmapBundle* bmp_edit);
|
wxCoord draw_edit_bmp(wxDC& dc, wxPoint pos, const wxBitmap& bmp_edit);
|
||||||
bool launch_browser() const;
|
bool launch_browser() const;
|
||||||
bool is_separator() const { return og_line.is_separator(); }
|
bool is_separator() const { return og_line.is_separator(); }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue