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); }
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)); }
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)); }
Icon::Icon(const CL_Rect& rect, const CL_Sprite& sprite, const std::string& tooltip, CL_Component* parent) : CL_Component(rect, parent), impl(new IconImpl(this)) { impl->sprite = sprite; impl->tooltip = tooltip; impl->draw_tooltip = true; impl->down = false; impl->is_down = false; impl->is_enabled = true; impl->slots.push_back(sig_paint().connect(impl.get(), &IconImpl::draw)); impl->slots.push_back(sig_mouse_down().connect(impl.get(), &IconImpl::mouse_down)); impl->slots.push_back(sig_mouse_up().connect(impl.get(), &IconImpl::mouse_up)); }