X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/3e385dbab78eb0336e82855d829a76a111514a38..a02bffd9a0cca7a49b5bc2c87a3b0293b91aba8b:/tests/GUI/dndwindow.cc?ds=inline diff --git a/tests/GUI/dndwindow.cc b/tests/GUI/dndwindow.cc index e365208..daa5939 100644 --- a/tests/GUI/dndwindow.cc +++ b/tests/GUI/dndwindow.cc @@ -19,6 +19,8 @@ #include "dndwindow.h" #include +Glib::RefPtr ico_canio, ico_y, ico_codo; + DnDWindow::DnDWindow() : m_Button_Canio("Drag Canio\n"), m_Button_Y("Drop Y\n"), @@ -26,6 +28,10 @@ DnDWindow::DnDWindow() { set_title("Editor"); + ico_canio = Gdk::Pixbuf::create_from_file("canio.png"); + ico_y = Gdk::Pixbuf::create_from_file("y.png"); + ico_codo = Gdk::Pixbuf::create_from_file("codo.png"); + add(m_HBox); m_HBox.pack_start(m_VBox); @@ -80,6 +86,23 @@ void DnDWindow::on_item_button_down() std::cout << "boton abajo" << std::endl; } +void DnDWindow::on_canio_drag_begin(const Glib::RefPtr &context) +{ + context->set_icon(ico_canio, 0, 0); //ico_canio->get_width(), ico_canio->get_height()); +} + +void DnDWindow::on_y_drag_begin(const Glib::RefPtr &context) +{ + context->set_icon(ico_y, 0, 0); //ico_canio->get_width(), ico_canio->get_height()); +} + +void DnDWindow::on_codo_drag_begin(const Glib::RefPtr &context) +{ + context->set_icon(ico_codo, 0, 0); //ico_canio->get_width(), ico_canio->get_height()); +} + + + void DnDWindow::on_canio_drag_data_get(const Glib::RefPtr& context, GtkSelectionData* selection_data, guint, guint) { @@ -117,8 +140,10 @@ void DnDWindow::on_label_drop_drag_data_received(const Glib::RefPtrshow(); //listaItems.push_back(a); @@ -127,24 +152,3 @@ void DnDWindow::on_label_drop_drag_data_received(const Glib::RefPtrdrag_finish(false, false, time); } -void DnDWindow::on_canio_drag_begin(const Glib::RefPtr& context) -{ - Glib::RefPtr image; - image = Gdk::Pixbuf::create_from_file("canio.png"); - context->set_icon(image, image->get_width() / 2, image->get_height() / 4); -} - -void DnDWindow::on_y_drag_begin(const Glib::RefPtr& context) -{ - Glib::RefPtr image; - image = Gdk::Pixbuf::create_from_file("y.png"); - context->set_icon(image, image->get_width() / 4, image->get_height() / 4); -} - -void DnDWindow::on_codo_drag_begin(const Glib::RefPtr& context) -{ - Glib::RefPtr image; - image = Gdk::Pixbuf::create_from_file("codo.png"); - context->set_icon(image, 0, 0);//image->get_width() / 2, image->get_height() / 2); -} -