TileEditor::TileEditor(int x, int y, int w, int h, CL_Component* parent)
  : CL_Component(CL_Rect(CL_Rect(CL_Point(x, y), 
                                 CL_Size(w, h))), // FIXME: make this editable via script
                 parent)
{
  tile = 0;
  slots.connect(sig_paint(),      this, &TileEditor::draw);
  slots.connect(sig_mouse_move(), this, &TileEditor::mouse_move);
  slots.connect(sig_mouse_down(), this, &TileEditor::mouse_down);
  slots.connect(sig_mouse_up  (), this, &TileEditor::mouse_up);
}
Esempio n. 2
0
Titlebar::Titlebar(const CL_Rect& rect, const std::string& title, CL_Component* parent)
  : CL_Component(rect, parent),
    impl(new TitlebarImpl(this))
{
  impl->title = title;
  impl->pressed = false;
  impl->window = parent;

  impl->slots.push_back(sig_mouse_down().connect(impl.get(), &TitlebarImpl::on_mouse_down));
  impl->slots.push_back(sig_mouse_move().connect(impl.get(), &TitlebarImpl::on_mouse_move));
  impl->slots.push_back(sig_mouse_up().connect(impl.get(), &TitlebarImpl::on_mouse_up));
  impl->slots.push_back(sig_paint().connect(impl.get(), &TitlebarImpl::draw));
}
Esempio n. 3
0
Slider::Slider(const CL_Rect& rect, CL_Component* parent)
  : CL_Component(rect, parent)
{
  start = 0.0f;
  end   = 100.0f;
  value = 50.0f;
  pressed = false;

  slots.push_back(sig_mouse_down().connect(this, &Slider::on_mouse_down));
  slots.push_back(sig_mouse_up().connect(this, &Slider::on_mouse_up));
  slots.push_back(sig_mouse_move().connect(this, &Slider::on_mouse_move));
  slots.push_back(sig_paint().connect(this, &Slider::draw));
}