//---------------------------------------------------------------------------
void WtRubiksClockWidget::OnClicked(const Wt::WMouseEvent& e)
{
  const int x = e.widget().x;
  const int y = e.widget().y;

  const bool is_left_button = e.button() == Wt::WMouseEvent::LeftButton
    || e.wheelDelta() > 0;
  m_widget->Click(x,y,is_left_button);
}
Exemple #2
0
void EventsDemo::describe(const Wt::WMouseEvent &e)
{
  std::stringstream ss;
  ss << "Button: " << e.button() << "<br/>"
     << "Modifiers: " << modifiersToString(e.modifiers()) << "<br/>"
     << "Document coordinates: " << e.document() << "<br/>"
     << "Window coordinates: " << e.window() << "<br/>"
     << "Screen coordinates: " << e.screen() << "<br/>"
     << "Widget coordinates: " << e.widget() << "<br/>"
     << "DragDelta coordinates: " << e.dragDelta() << "<br/>"
     << "Wheel delta: " << e.wheelDelta() << "<br/>";
  mouseEventDescription_->setText(ss.str());
}
//---------------------------------------------------------------------------
void WtSelectPlayerWidget::OnClick(const Wt::WMouseEvent& e)
{
  const int sprite_width  = m_computer_grey->width();
  const int sprite_height = m_computer_grey->height();

  const int mouse_x = e.widget().x;
  const int mouse_y = e.widget().y;
  const int index = mouse_y / sprite_height;
  const bool is_human = ( mouse_x / sprite_width == 0);
  m_is_player_human[index] = is_human;
  m_signal_on_clicked();
  this->update();
}
void ribi::WtDialWidget::OnClicked(const Wt::WMouseEvent& e)
{
  m_widget->Click(e.widget().x,e.widget().y);
}