1 //$Id: dndwindow.h 5 2003-10-10 04:31:35Z luca $ -*- c++ -*-
3 /* gtkmm example Copyright (C) 2002 gtkmm development team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef GTKMM_EXAMPLE_DNDWINDOW_H
20 #define GTKMM_EXAMPLE_DNDWINDOW_H
22 #include <gtkmm/label.h>
23 #include <gtkmm/window.h>
24 #include <gtkmm/box.h>
25 #include <gtkmm/button.h>
26 #include <gtkmm/fixed.h>
28 #include "workplace.h"
29 #include <gtkmm/scrolledwindow.h>
31 class DnDWindow : public Gtk::Window
40 virtual void on_canio_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
41 virtual void on_y_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
42 virtual void on_codo_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
43 virtual void on_label_drop_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, GtkSelectionData* selection_data, guint info, guint time);
44 // Señales para cambiar el icono cuando empieza el drag.
45 virtual void on_canio_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
46 virtual void on_y_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
47 virtual void on_codo_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context);
49 virtual void on_item_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context, CItem *);
50 virtual void on_item_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, GtkSelectionData* selection_data, guint info, guint time);
52 /* Lista de tipos de datos para el drag&drop */
53 std::list<Gtk::TargetEntry> listTargets;
55 // Iconos para Drag&Drop desde la barra
56 Glib::RefPtr<Gdk::Pixbuf> ico_canio, ico_y, ico_codo;
57 // Icono para Drag&Drop de items
58 Glib::RefPtr<Gdk::Pixbuf> ico_last;
60 void on_item_button_down();
64 Gtk::Button m_Button_Canio;
65 Gtk::Button m_Button_Y;
66 Gtk::Button m_Button_Codo;
67 WorkPlace m_WorkPlace;
68 std::list<CItem *> listaItems;
69 Gtk::ScrolledWindow scroll;
72 #endif // GTKMM_EXAMPLE_DNDWINDOW_H