bool WndButton::OnClicked() { if (listener != NULL) { #ifndef USE_GDI unsigned id = GetID(); #endif listener->OnAction(id); return true; } // Call the OnClick function if (click_callback != NULL) { click_callback(*this); return true; } return ButtonWindow::OnClicked(); }
Aw::Widget *TaskbarButton::eventHandle(const Aw::Point& point, const Aw::Event& ev) { anvil_syslog(0, "Button::eventHandle()\n"); switch (ev.getType()) { case Aw::Event::Type::ButtonPress: //m_pressed = true; // todo: send draw event break; case Aw::Event::Type::ButtonRelease: m_pressed = !m_pressed;//false; // todo: send draw event click_callback(this, ev); // We handled the event return this; break; } return nullptr; }
bool onKeyDown(const GuiEvent &) { click_callback(); return true; }
void onMouseDown(const GuiEvent &) { click_callback(); }