From 12a41ca6b41a3d98e9ff6d4cc7de31a9ec537472 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 13 Oct 2003 21:37:58 +0000 Subject: [PATCH] - Se arregla problema de dibujo de lineas. - Se dibujan lineas horizontales. - Se mejora el hot spot del drag&drop. --- tests/GUI/dndwindow.cc | 12 +++++++----- tests/GUI/dndwindow.h | 2 ++ tests/GUI/workplace.cc | 3 +++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/GUI/dndwindow.cc b/tests/GUI/dndwindow.cc index f18ee57..8bf40c4 100644 --- a/tests/GUI/dndwindow.cc +++ b/tests/GUI/dndwindow.cc @@ -34,13 +34,15 @@ DnDWindow::DnDWindow() add(m_HBox); - m_HBox.pack_start(m_VBox); + m_HBox.pack_start(m_VBox, false, false, 0); m_VBox.pack_start(m_Button_Canio); m_VBox.pack_start(m_Button_Y); m_VBox.pack_start(m_Button_Codo); - m_HBox.pack_start(m_WorkPlace); + m_HBox.pack_start(scroll); + scroll.add(m_WorkPlace); + scroll.set_size_request(600, 600); m_WorkPlace.set_size_request(600, 600); //Targets: @@ -85,17 +87,17 @@ void DnDWindow::on_item_button_down() 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()); + context->set_icon(ico_canio, 5, 5); //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()); + context->set_icon(ico_y, 5, 5); //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()); + context->set_icon(ico_codo, 5, 5); //ico_canio->get_width(), ico_canio->get_height()); } diff --git a/tests/GUI/dndwindow.h b/tests/GUI/dndwindow.h index eeda3e3..8e6fa6b 100644 --- a/tests/GUI/dndwindow.h +++ b/tests/GUI/dndwindow.h @@ -26,6 +26,7 @@ #include #include "item.h" #include "workplace.h" +#include class DnDWindow : public Gtk::Window { @@ -54,6 +55,7 @@ protected: Gtk::Button m_Button_Codo; WorkPlace m_WorkPlace; std::list listaItems; + Gtk::ScrolledWindow scroll; }; #endif // GTKMM_EXAMPLE_DNDWINDOW_H diff --git a/tests/GUI/workplace.cc b/tests/GUI/workplace.cc index 4c11f6c..b046a68 100644 --- a/tests/GUI/workplace.cc +++ b/tests/GUI/workplace.cc @@ -12,6 +12,9 @@ bool WorkPlace::on_expose_event(GdkEventExpose *e) for(i=0; idraw_line(get_style()->get_black_gc(), i, 0, i, get_height()); } + for(i=0; idraw_line(get_style()->get_black_gc(), 0, i, get_width(), i); + } return true; } -- 2.43.0