- Se dibujan lineas horizontales.
- Se mejora el hot spot del drag&drop.
- 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_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:
m_WorkPlace.set_size_request(600, 600);
//Targets:
void DnDWindow::on_canio_drag_begin(const Glib::RefPtr<Gdk::DragContext> &context)
{
void DnDWindow::on_canio_drag_begin(const Glib::RefPtr<Gdk::DragContext> &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<Gdk::DragContext> &context)
{
}
void DnDWindow::on_y_drag_begin(const Glib::RefPtr<Gdk::DragContext> &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<Gdk::DragContext> &context)
{
}
void DnDWindow::on_codo_drag_begin(const Glib::RefPtr<Gdk::DragContext> &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());
#include <gtkmm/fixed.h>
#include "item.h"
#include "workplace.h"
#include <gtkmm/fixed.h>
#include "item.h"
#include "workplace.h"
+#include <gtkmm/scrolledwindow.h>
class DnDWindow : public Gtk::Window
{
class DnDWindow : public Gtk::Window
{
Gtk::Button m_Button_Codo;
WorkPlace m_WorkPlace;
std::list<CItem *> listaItems;
Gtk::Button m_Button_Codo;
WorkPlace m_WorkPlace;
std::list<CItem *> listaItems;
+ Gtk::ScrolledWindow scroll;
};
#endif // GTKMM_EXAMPLE_DNDWINDOW_H
};
#endif // GTKMM_EXAMPLE_DNDWINDOW_H
for(i=0; i<get_width(); i+=32) {
get_window()->draw_line(get_style()->get_black_gc(), i, 0, i, get_height());
}
for(i=0; i<get_width(); i+=32) {
get_window()->draw_line(get_style()->get_black_gc(), i, 0, i, get_height());
}
+ for(i=0; i<get_height(); i+=32) {
+ get_window()->draw_line(get_style()->get_black_gc(), 0, i, get_width(), i);
+ }