예제 #1
0
파일: Button.cpp 프로젝트: damianob/xcsoar
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();
 }