This commit is contained in:
bubnikv 2019-06-20 16:15:26 +02:00
commit 27459a9072
1145 changed files with 2435 additions and 1497 deletions

View file

@ -1785,6 +1785,7 @@ DoubleSlider::DoubleSlider( wxWindow *parent,
// slider events
Bind(wxEVT_PAINT, &DoubleSlider::OnPaint, this);
Bind(wxEVT_CHAR, &DoubleSlider::OnChar, this);
Bind(wxEVT_LEFT_DOWN, &DoubleSlider::OnLeftDown, this);
Bind(wxEVT_MOTION, &DoubleSlider::OnMotion, this);
Bind(wxEVT_LEFT_UP, &DoubleSlider::OnLeftUp, this);
@ -2564,9 +2565,9 @@ void DoubleSlider::OnWheel(wxMouseEvent& event)
void DoubleSlider::OnKeyDown(wxKeyEvent &event)
{
const int key = event.GetKeyCode();
if (key == '+' || key == WXK_NUMPAD_ADD)
if (key == WXK_NUMPAD_ADD)
action_tick(taAdd);
else if (key == '-' || key == 390 || key == WXK_DELETE || key == WXK_BACK)
else if (key == 390 || key == WXK_DELETE || key == WXK_BACK)
action_tick(taDel);
else if (is_horizontal())
{
@ -2585,6 +2586,8 @@ void DoubleSlider::OnKeyDown(wxKeyEvent &event)
else if (key == WXK_UP || key == WXK_DOWN)
move_current_thumb(key == WXK_UP);
}
event.Skip(); // !Needed to have EVT_CHAR generated as well
}
void DoubleSlider::OnKeyUp(wxKeyEvent &event)
@ -2596,6 +2599,15 @@ void DoubleSlider::OnKeyUp(wxKeyEvent &event)
event.Skip();
}
void DoubleSlider::OnChar(wxKeyEvent& event)
{
const int key = event.GetKeyCode();
if (key == '+')
action_tick(taAdd);
else if (key == '-')
action_tick(taDel);
}
void DoubleSlider::OnRightDown(wxMouseEvent& event)
{
this->CaptureMouse();
@ -2658,6 +2670,9 @@ LockButton::LockButton( wxWindow *parent,
void LockButton::OnButton(wxCommandEvent& event)
{
if (m_disabled)
return;
m_is_pushed = !m_is_pushed;
enter_button(true);