コード例 #1
0
//---------------------------------------------------------------------------
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);
}
コード例 #2
0
ファイル: EventsDemo.C プロジェクト: 913862627/wt
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());
}
コード例 #3
0
//---------------------------------------------------------------------------
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();
}
コード例 #4
0
void ribi::WtDialWidget::OnClicked(const Wt::WMouseEvent& e)
{
  m_widget->Click(e.widget().x,e.widget().y);
}