*/
#include <gtkmm/box.h>
+
+#include "gtkmm2ext/visibility.h"
#include "gtkmm2ext/widget_state.h"
namespace Gtkmm2ext {
/** Parent class for children of a DnDVBox */
-class DnDVBoxChild
+class LIBGTKMM2EXT_API DnDVBoxChild
{
public:
virtual ~DnDVBoxChild () {}
/** A VBox whose contents can be dragged and dropped */
template <class T>
-class DnDVBox : public Gtk::EventBox
+class LIBGTKMM2EXT_API DnDVBox : public Gtk::EventBox
{
public:
DnDVBox () : _active (0), _drag_icon (0), _expecting_unwanted_button_event (false), _placeholder (0)
Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK
);
- signal_button_press_event().connect (bind (mem_fun (*this, &DnDVBox::button_press), (T *) 0));
- signal_button_release_event().connect (bind (mem_fun (*this, &DnDVBox::button_release), (T *) 0));
+ signal_button_press_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_press), (T *) 0));
+ signal_button_release_event().connect (sigc::bind (mem_fun (*this, &DnDVBox::button_release), (T *) 0));
signal_drag_motion().connect (mem_fun (*this, &DnDVBox::drag_motion));
signal_drag_leave().connect (mem_fun (*this, &DnDVBox::drag_leave));
/* make up an icon for the drag */
_drag_icon = new Gtk::Window (Gtk::WINDOW_POPUP);
- Gtk::Allocation a = child->widget().get_allocation ();
+ Gtk::Allocation a = child->action_widget().get_allocation ();
_drag_icon->set_size_request (a.get_width(), a.get_height());
_drag_icon->signal_expose_event().connect (sigc::mem_fun (*this, &DnDVBox::icon_expose));
cairo_t* cr = gdk_cairo_create (_drag_icon->get_window()->gobj ());
- Glib::RefPtr<Gdk::Pixmap> p = _drag_child->widget().get_snapshot();
+ Glib::RefPtr<Gdk::Pixmap> p = _drag_child->action_widget().get_snapshot();
gdk_cairo_set_source_pixmap (cr, p->gobj(), 0, 0);
cairo_rectangle (cr, 0, 0, w, h);
cairo_fill (cr);
/* dropped from ourselves onto ourselves */
- T* child = *((T **) selection_data.get_data());
+ T* child = *((T * const *) selection_data.get_data());
if (drop.first == 0) {
_internal_vbox.reorder_child (child->widget(), -1);
{
typename std::list<T*>::iterator x = find (_selection.begin(), _selection.end(), child);
if (x != _selection.end()) {
+ T* c = *x;
_selection.erase (x);
- setup_child_state (*x);
+ setup_child_state (c);
}
}