BBL Port Color Mix Base

This commit is contained in:
Ian Bassi
2026-08-23 22:11:48 +08:00
committed by SoftFever
parent 550e234a37
commit 8fea099d99
75 changed files with 34174 additions and 51 deletions
+16
View File
@@ -9,6 +9,8 @@
#include "../GUI_Utils.hpp"
#endif
wxDEFINE_EVENT(EVT_SPINCTRL_TEXT, wxCommandEvent);
BEGIN_EVENT_TABLE(SpinInput, StaticBox)
EVT_KEY_DOWN(SpinInput::keyPressed)
@@ -74,6 +76,7 @@ void SpinInput::Create(wxWindow *parent,
state_handler.attach_child(text_ctrl);
text_ctrl->Bind(wxEVT_KILL_FOCUS, &SpinInput::onTextLostFocus, this);
text_ctrl->Bind(wxEVT_TEXT_ENTER, &SpinInput::onTextEnter, this);
text_ctrl->Bind(wxEVT_TEXT, &SpinInput::onTextChanged, this);
text_ctrl->Bind(wxEVT_KEY_DOWN, &SpinInput::keyPressed, this);
text_ctrl->Bind(wxEVT_RIGHT_DOWN, [this](auto &e) {}); // disable context menu
button_inc = createButton(true);
@@ -300,6 +303,19 @@ void SpinInput::onTextEnter(wxCommandEvent &event)
ProcessEventLocally(event);
}
void SpinInput::onTextChanged(wxCommandEvent &event)
{
long value;
if (text_ctrl->GetValue().ToLong(&value)) {
wxCommandEvent e(EVT_SPINCTRL_TEXT, GetId());
e.SetEventObject(this);
e.SetInt((int) value);
e.SetString(text_ctrl->GetValue());
GetEventHandler()->ProcessEvent(e);
}
event.Skip();
}
void SpinInput::mouseWheelMoved(wxMouseEvent &event)
{
auto delta = event.GetWheelRotation() < 0 ? 1 : -1;