示例#1
0
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();
}
示例#2
0
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;
}
示例#3
0
 bool onKeyDown(const GuiEvent &)
 {
    click_callback();
    return true;
 }
示例#4
0
 void onMouseDown(const GuiEvent &)
 {
    click_callback();
 }