mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
Revert to WxWidgets 3.1.5 (#3249)
* revert to WxWidgets 3.1.5 * update nanosvg unicode path
This commit is contained in:
parent
cc23ec6626
commit
374f78c768
95 changed files with 6841 additions and 1618 deletions
|
@ -98,13 +98,6 @@ void ComboBox::Rescale()
|
|||
drop.Rescale();
|
||||
}
|
||||
|
||||
bool ComboBox::Enable(bool enable) {
|
||||
bool ret = TextInput::Enable(enable);
|
||||
if (ret && drop.selection >= 0 && drop.iconSize.y > 0)
|
||||
SetIcon(icons[drop.selection]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
wxString ComboBox::GetValue() const
|
||||
{
|
||||
return drop.GetSelection() >= 0 ? drop.GetValue() : GetLabel();
|
||||
|
@ -152,17 +145,13 @@ bool ComboBox::SetFont(wxFont const& font)
|
|||
return TextInput::SetFont(font);
|
||||
}
|
||||
|
||||
void ComboBox::SetIcon(const wxBitmapBundle &icon) {
|
||||
TextInput::SetIcon(m_isEnabled ? icon : icon.GetBitmapFor(this).ConvertToDisabled(128));
|
||||
}
|
||||
|
||||
int ComboBox::Append(const wxString &item, const wxBitmapBundle &bitmap)
|
||||
int ComboBox::Append(const wxString &item, const wxBitmap &bitmap)
|
||||
{
|
||||
return Append(item, bitmap, nullptr);
|
||||
}
|
||||
|
||||
int ComboBox::Append(const wxString &item,
|
||||
const wxBitmapBundle &bitmap,
|
||||
const wxBitmap &bitmap,
|
||||
void * clientData)
|
||||
{
|
||||
texts.push_back(item);
|
||||
|
@ -207,9 +196,9 @@ void ComboBox::SetString(unsigned int n, wxString const &value)
|
|||
if (n == drop.GetSelection()) SetLabel(value);
|
||||
}
|
||||
|
||||
wxBitmap ComboBox::GetItemBitmap(unsigned int n) { return icons[n].GetBitmapFor(m_parent); }
|
||||
wxBitmap ComboBox::GetItemBitmap(unsigned int n) { return icons[n]; }
|
||||
|
||||
void ComboBox::SetItemBitmap(unsigned int n, wxBitmapBundle const &bitmap)
|
||||
void ComboBox::SetItemBitmap(unsigned int n, wxBitmap const &bitmap)
|
||||
{
|
||||
if (n >= texts.size()) return;
|
||||
icons[n] = bitmap;
|
||||
|
@ -241,7 +230,9 @@ void ComboBox::DoSetItemClientData(unsigned int n, void *data)
|
|||
datas[n] = data;
|
||||
}
|
||||
|
||||
void ComboBox::ToggleDropDown(){
|
||||
void ComboBox::mouseDown(wxMouseEvent &event)
|
||||
{
|
||||
SetFocus();
|
||||
if (drop_down) {
|
||||
drop.Hide();
|
||||
} else if (drop.HasDismissLongTime()) {
|
||||
|
@ -253,12 +244,6 @@ void ComboBox::ToggleDropDown(){
|
|||
}
|
||||
}
|
||||
|
||||
void ComboBox::mouseDown(wxMouseEvent &event)
|
||||
{
|
||||
SetFocus();
|
||||
ToggleDropDown();
|
||||
}
|
||||
|
||||
void ComboBox::mouseWheelMoved(wxMouseEvent &event)
|
||||
{
|
||||
event.Skip();
|
||||
|
@ -276,7 +261,15 @@ void ComboBox::keyDown(wxKeyEvent& event)
|
|||
switch (event.GetKeyCode()) {
|
||||
case WXK_RETURN:
|
||||
case WXK_SPACE:
|
||||
ToggleDropDown();
|
||||
if (drop_down) {
|
||||
drop.DismissAndNotify();
|
||||
} else if (drop.HasDismissLongTime()) {
|
||||
drop.autoPosition();
|
||||
drop_down = true;
|
||||
drop.Popup();
|
||||
wxCommandEvent e(wxEVT_COMBOBOX_DROPDOWN);
|
||||
GetEventHandler()->ProcessEvent(e);
|
||||
}
|
||||
break;
|
||||
case WXK_UP:
|
||||
case WXK_DOWN:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue