mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-11 16:00:17 -07:00
Update TextInput to use bitmap bundles
This commit is contained in:
parent
7cfa854981
commit
510a4a02ab
3 changed files with 7 additions and 7 deletions
|
|
@ -85,7 +85,7 @@ void ComboBox::SetSelection(int n)
|
||||||
drop.SetSelection(n);
|
drop.SetSelection(n);
|
||||||
SetLabel(drop.GetValue());
|
SetLabel(drop.GetValue());
|
||||||
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
||||||
SetIcon(icons[drop.selection].GetBitmapFor(m_parent));//OcraftyoneTODO: dirty conversion
|
SetIcon(icons[drop.selection]);
|
||||||
}
|
}
|
||||||
void ComboBox::SelectAndNotify(int n) {
|
void ComboBox::SelectAndNotify(int n) {
|
||||||
SetSelection(n);
|
SetSelection(n);
|
||||||
|
|
@ -108,7 +108,7 @@ void ComboBox::SetValue(const wxString &value)
|
||||||
drop.SetValue(value);
|
drop.SetValue(value);
|
||||||
SetLabel(value);
|
SetLabel(value);
|
||||||
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
if (drop.selection >= 0 && drop.iconSize.y > 0)
|
||||||
SetIcon(icons[drop.selection].GetBitmapFor(m_parent));//OcraftyoneTODO: dirty conversion
|
SetIcon(icons[drop.selection]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComboBox::SetLabel(const wxString &value)
|
void ComboBox::SetLabel(const wxString &value)
|
||||||
|
|
|
||||||
|
|
@ -94,10 +94,10 @@ void TextInput::SetLabel(const wxString& label)
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextInput::SetIcon(const wxBitmap &icon)
|
void TextInput::SetIcon(const wxBitmapBundle &icon_in)
|
||||||
{
|
{
|
||||||
this->icon = ScalableBitmap();
|
this->icon = ScalableBitmap();
|
||||||
this->icon.bmp() = icon;
|
this->icon.bmp() = icon_in;
|
||||||
Rescale();
|
Rescale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -153,7 +153,7 @@ void TextInput::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||||
wxSize size = GetSize();
|
wxSize size = GetSize();
|
||||||
wxPoint textPos = {5, 0};
|
wxPoint textPos = {5, 0};
|
||||||
if (this->icon.bmp().IsOk()) {
|
if (this->icon.bmp().IsOk()) {
|
||||||
wxSize szIcon = this->icon.GetBmpSize();
|
wxSize szIcon = this->icon.GetSize();
|
||||||
textPos.x += szIcon.x;
|
textPos.x += szIcon.x;
|
||||||
}
|
}
|
||||||
bool align_right = GetWindowStyle() & wxRIGHT;
|
bool align_right = GetWindowStyle() & wxRIGHT;
|
||||||
|
|
@ -194,7 +194,7 @@ void TextInput::render(wxDC& dc)
|
||||||
// start draw
|
// start draw
|
||||||
wxPoint pt = {5, 0};
|
wxPoint pt = {5, 0};
|
||||||
if (icon.bmp().IsOk()) {
|
if (icon.bmp().IsOk()) {
|
||||||
wxSize szIcon = icon.GetBmpSize();
|
wxSize szIcon = icon.GetSize();
|
||||||
pt.y = (size.y - szIcon.y) / 2;
|
pt.y = (size.y - szIcon.y) / 2;
|
||||||
dc.DrawBitmap(icon.get_bitmap(), pt);
|
dc.DrawBitmap(icon.get_bitmap(), pt);
|
||||||
pt.x += szIcon.x + 0;
|
pt.x += szIcon.x + 0;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public:
|
||||||
|
|
||||||
void SetLabel(const wxString& label);
|
void SetLabel(const wxString& label);
|
||||||
|
|
||||||
void SetIcon(const wxBitmap & icon);
|
void SetIcon(const wxBitmapBundle & icon);
|
||||||
|
|
||||||
void SetLabelColor(StateColor const &color);
|
void SetLabelColor(StateColor const &color);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue