Index: ChangeLog
===================================================================
--- ChangeLog	(Revision 1103)
+++ ChangeLog	(Arbeitskopie)
@@ -1,3 +1,19 @@
+2007-04-30  Johannes Schmid <johannes.schmid@openismus.com>
+
+	* glom/frame_glom.cc:
+	* glom/utility_widgets/Makefile.am:
+	* glom/utility_widgets/dragbutton.cc:
+	* glom/utility_widgets/dragbutton.h:
+	* glom/utility_widgets/dragwindow.cc:
+	* glom/utility_widgets/dragwindow.h:
+	* glom/utility_widgets/flowtable.cc:
+	* glom/utility_widgets/flowtable.h:
+	* glom/utility_widgets/flowtablewithfields.cc:
+	* glom/utility_widgets/flowtablewithfields.h:
+	* glom/utility_widgets/test_flowtable.cc:
+	
+	Dnd test code
+
 2007-05-09  Murray Cumming  <murrayc@murrayc.com>
 
 	* glom/application.cc:
@@ -17,6 +33,7 @@
 	* glom/application.cc: Do not leak the file chooser dialog in
 	ui_file_select_save().
 
Index: glom/utility_widgets/flowtablewithfields.h
===================================================================
--- glom/utility_widgets/flowtablewithfields.h	(Revision 1103)
+++ glom/utility_widgets/flowtablewithfields.h	(Arbeitskopie)
@@ -188,8 +188,11 @@
   void add_layout_notebook_at_position(const sharedptr<LayoutItem_Notebook>& notebook, const type_list_layoutwidgets::iterator& add_before);
   void add_layout_related_at_position(const sharedptr<LayoutItem_Portal>& portal, const type_list_layoutwidgets::iterator& add_before);
 
+  virtual void on_dnd_add_layout_item(DataWidget* widget);
+  
   Box_Data_List_Related* create_related(const sharedptr<LayoutItem_Portal>& portal, bool show_title = true);
 
+  
   Glib::ustring m_table_name;
 
   type_signal_field_edited m_signal_field_edited;
Index: glom/utility_widgets/dragbutton.cc
===================================================================
--- glom/utility_widgets/dragbutton.cc	(Revision 0)
+++ glom/utility_widgets/dragbutton.cc	(Revision 0)
@@ -0,0 +1,46 @@
+/* Glom
+ *
+ * Copyright (C) 2007 Johannes Schmid <johannes.schmid@openismus.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+ 
+#include "dragbutton.h"
+
+namespace Glom
+{
+  
+DragButton::DragButton(Glib::ustring label)
+{
+  m_label = label;
+  set_label(label);
+  std::list<Gtk::TargetEntry> targetentries;
+  targetentries.push_back(Gtk::TargetEntry(get_target()));
+  drag_source_set(targetentries);
+}
+
+DragButton::~DragButton()
+{
+
+}
+
+void DragButton::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, 
+                                  Gtk::SelectionData& selection_data, guint, guint)
+{
+  selection_data.set(selection_data.get_target(), m_label);
+}
+
+} // namespace Glom
Index: glom/utility_widgets/dragbutton.h
===================================================================
--- glom/utility_widgets/dragbutton.h	(Revision 0)
+++ glom/utility_widgets/dragbutton.h	(Revision 0)
@@ -0,0 +1,47 @@
+/* Glom
+ *
+ * Copyright (C) 2007 Johannes Schmid <johannes.schmid@openismus.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+ 
+#include <gtkmm/button.h>
+#include <string>
+
+#ifndef DRAGBUTTON_H
+#define DRAGBUTTON_H
+
+namespace Glom
+{
+  
+class DragButton : public Gtk::Button
+{
+  public:
+    DragButton(Glib::ustring label);  
+    ~DragButton();
+
+  
+    static gchar* get_target() {return "flowtable";};
+  protected:
+    virtual void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, 
+                                  Gtk::SelectionData& selection_data, guint, guint);
+  
+  private:
+    Glib::ustring m_label;
+};
+
+}
+#endif // DRAGBUTTON_H
Index: glom/utility_widgets/test_flowtable.cc
===================================================================
--- glom/utility_widgets/test_flowtable.cc	(Revision 1103)
+++ glom/utility_widgets/test_flowtable.cc	(Arbeitskopie)
@@ -22,6 +22,8 @@
 #include "flowtable.h"
 
 
+#include "dragwindow.h"
+
 int
 main(int argc, char* argv[])
 {
@@ -31,38 +33,8 @@
   //Gtk::VBox flowtable;
   Glom::FlowTable flowtable;
   flowtable.set_columns_count(2);
+  flowtable.set_padding(5);
 
-  Gtk::Entry button1; //"one");
-  button1.show();
-  button1.set_text("debug");
-
-  Glom::FlowTable inner_table;
-  inner_table.set_padding(20);
-  inner_table.set_design_mode();
-  inner_table.set_columns_count(1);
-  inner_table.show();
-  flowtable.add(inner_table);
-
-  Gtk::Entry button2; button2.set_text("two");
-  inner_table.add(button1, button2);
-  button2.show();
-  button2.set_size_request(40, 40);
-
-  Gtk::Entry button3; button3.set_text("three");
-  button3.show();
-
-  Gtk::Entry button4; button4.set_text("four");
-  inner_table.add(button3, button4);
-  button4.show();
-  button4.set_size_request(20, 30);
-
-  Gtk::Entry button5; button5.set_text("five");
-  button5.show();
-
-  Gtk::Entry button6; button6.set_text("six");
-  inner_table.add(button5, button6);
-  button6.show();
-
   Gtk::Entry button7; button7.set_text("seven");;
   button7.show();
   //button7.set_size_request(100, 100);
@@ -70,7 +42,7 @@
   Gtk::Entry button8; button8.set_text("eight");
   flowtable.add(button7, button8);
   button8.show();
-  button8.set_size_request(100, 300);
+  //button8.set_size_request(100, 100);
 
   Gtk::Entry button9; button9.set_text("nine");;
   button9.show();
@@ -80,6 +52,11 @@
   flowtable.add(button9, button10);
   button10.show();
 
+  Gtk::Entry button11; button11.set_text("eleven");
+  Gtk::Entry button12; button11.set_text("eleven");
+  flowtable.add(button11, button12);
+  button11.show(); button12.show();
+  
   window.add(flowtable);
   flowtable.set_design_mode();
   flowtable.show();
@@ -87,6 +64,9 @@
 
   flowtable.set_padding(20);
 
+  Glom::DragWindow drag_window;
+  drag_window.show();
+  
   Gtk::Main::run(window);
 
 
Index: glom/utility_widgets/flowtable.cc
===================================================================
--- glom/utility_widgets/flowtable.cc	(Revision 1103)
+++ glom/utility_widgets/flowtable.cc	(Arbeitskopie)
@@ -19,25 +19,40 @@
  */
  
 #include "flowtable.h"
+#include "dragbutton.h"
+#include "entryglom.h"
+#include "labelglom.h"
+#include "buttonglom.h"
+#include "imageglom.h"
+#include "layoutwidgetbase.h"
 #include "gtk/gtkwidget.h"
 #include "gdk/gdktypes.h"
+#include <iostream>
+#include <gdkmm/window.h>
 
 namespace Glom
 {
 
 FlowTable::FlowTableItem::FlowTableItem()
-: m_expand_first_full(false),
+: m_first(NULL),
+  m_second(NULL),
+  m_expand_first_full(false),
   m_expand_second(false)
 {
 }
 
 FlowTable::FlowTable()
-: m_columns_count(1),
+: m_dnd_in_progress(false),
+  m_columns_count(1),
   m_padding(0),
   m_design_mode(false)
 {
   set_flags(Gtk::NO_WINDOW);
   set_redraw_on_allocate(false);
+  std::list<Gtk::TargetEntry> drag_targets;
+  Gtk::TargetEntry drag_target(DragButton::get_target());
+  drag_targets.push_back(drag_target);
+  drag_dest_set(drag_targets);
 }
 
 FlowTable::~FlowTable()
@@ -58,11 +73,67 @@
   item.m_second = &second;
   item.m_expand_second = expand_second; //Expand to fill the width for all of the second item.
   m_children.push_back(item);
-
   gtk_widget_set_parent(first.gobj(), GTK_WIDGET(gobj()));
   gtk_widget_set_parent(second.gobj(), GTK_WIDGET(gobj()));
 }
 
+void FlowTable::insert_above(Gtk::Widget& widget, Gtk::Widget& before, bool expand_second)
+{
+  bool found = false;
+  std::vector<FlowTableItem>::iterator pos;
+  for (pos = m_children.begin(); pos != m_children.end(); pos++)
+  {
+      if (((*pos).m_first && (*pos).m_first->gobj() == before.gobj()) || ((*pos).m_second && (*pos).m_second->gobj() == before.gobj()))
+      {
+        std::cout << "found!" << std::endl;
+        found = true;
+	break;
+      }
+  }
+  if (!found)
+    return;
+  FlowTableItem item;
+  item.m_first = &widget;
+  item.m_second = 0;
+  item.m_expand_second = expand_second;
+  gtk_widget_set_parent(widget.gobj(), GTK_WIDGET(gobj()));
+  if (pos == m_children.end())
+  {
+    m_children.push_back(item);
+  } else {
+    m_children.insert(pos, item);
+  }
+}
+
+
+
+void FlowTable::insert_below(Gtk::Widget& widget, Gtk::Widget& after, bool expand_second)
+{
+  bool found = false;
+  std::vector<FlowTableItem>::iterator pos;
+  for (pos = m_children.begin(); pos != m_children.end(); pos++)
+  {
+      if (((*pos).m_first && (*pos).m_first->gobj() == after.gobj()) || ((*pos).m_second && (*pos).m_second->gobj() == after.gobj()))
+      {
+        found = true;
+	    break;
+      }
+  }
+  if (!found)
+    return;
+  FlowTableItem item;
+  item.m_first = &widget;
+  item.m_second = 0;
+  item.m_expand_second = expand_second;
+  gtk_widget_set_parent(widget.gobj(), GTK_WIDGET(gobj()));
+  if (pos == m_children.end())
+  {
+    m_children.push_back(item);
+  } else {
+    m_children.insert(++pos, item);
+  }
+}
+
 void FlowTable::add(Gtk::Widget& first, bool expand)
 {
   FlowTableItem item;
@@ -74,6 +145,10 @@
   gtk_widget_set_parent(first.gobj(), GTK_WIDGET(gobj()));
 }
 
+/*
+ * {{{ Unrelevant for DND
+ */
+
 void FlowTable::set_columns_count(guint value)
 {
   //Silently correct an invalid value:
@@ -707,22 +782,13 @@
 {
   if(m_design_mode)
   {
+    std::cout << "Expose Event!" << std::endl;
     m_refGdkWindow = get_window();
     if(m_refGdkWindow)
     {
       m_refGC = Gdk::GC::create(m_refGdkWindow);
       m_refGC->set_line_attributes(1 /* width */, Gdk::LINE_ON_OFF_DASH, Gdk::CAP_NOT_LAST, Gdk::JOIN_MITER);
 
-      //Glib::RefPtr<Gdk::Colormap> colormap = get_default_colormap();
-      //Gdk::Color color_blue("blue");
-      //Gdk::Color color_red("red");
-      //colormap->alloc_color(color_blue);
-      //colormap->alloc_color(color_red);
-
-      //m_refGdkWindow->set_background( color_red );
-      //m_refGdkWindow->clear();
-      //m_refGC->set_foreground( color_blue );
-
       for(type_vecLines::iterator iter = m_lines_horizontal.begin(); iter != m_lines_horizontal.end(); ++iter)
       {
         //TODO: Add draw_line(point, point) to gdkmm:
@@ -733,12 +799,124 @@
       {
         m_refGdkWindow->draw_line(m_refGC, iter->first.get_x(), iter->first.get_y(), iter->second.get_x(), iter->second.get_y());
       }
+      // Draw preview
+      if (m_dnd_in_progress)
+      {
+        m_refGdkWindow->draw_rectangle(m_refGC, false, 
+                                       m_preview_rect.get_x(),
+                                       m_preview_rect.get_y(),
+                                       m_preview_rect.get_width(),
+                                       m_preview_rect.get_height());
+      }
     }
   }
-
   return Gtk::Container::on_expose_event(event);
 }
 
+/*
+ * }}}
+ */
+
+bool FlowTable::on_drag_motion(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, guint time)
+{
+  m_dnd_in_progress = true;
+  std::cout << "Drag motion" << std::endl;
+  DragPosition pos;
+  dnd_get_item(x, y, pos);
+  return true;
+}
+
+void FlowTable::on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int drag_x, int drag_y, const Gtk::SelectionData& selection_data, guint, guint time)
+{
+  if (m_dnd_in_progress)
+  {
+    DragPosition pos;
+    FlowTableItem* item = dnd_get_item(drag_x, drag_y, pos);
+#ifndef TEST
+    DataWidget* mywidget = dynamic_cast<DataWidget*>(item->m_second);
+    if (mywidget)
+      on_dnd_add_layout_item(mywidget);
+#endif
+    m_dnd_in_progress = false;
+  }
+}
+
+void FlowTable::on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& drag_context, guint time)
+{
+  if (m_dnd_in_progress)
+  {
+    // Expose event to clear preview rectangle!
+    std::cout << "Drag leave!" << std::endl;
+    queue_draw();
+  }
+}
+
+FlowTable::FlowTableItem*
+FlowTable::dnd_get_item(int drag_x, int drag_y, DragPosition& position)
+{
+  std::vector<FlowTableItem>::iterator pos;
+  int min = -1;
+  FlowTableItem* item = 0;
+  // Calculate the nearest FlowTableItem from the current drag position
+  for (pos = m_children.begin(); pos != m_children.end(); pos++)
+  {
+    bool above;
+    FlowTableItem* current_item = &(*pos);
+    int min1 = dnd_get_distance(current_item, drag_x, drag_y, above);
+    if (min1 == -1)
+      continue;
+    if (min == -1 || min > min1)
+    {
+      min = min1;
+      if (above)
+        position = ABOVE;
+      else
+        position = BELOW;
+      item = current_item;
+    }
+  }
+  if (item)
+  {
+      m_preview_rect.set_x(drag_x);
+      m_preview_rect.set_y(drag_y);
+	  m_preview_rect.set_width(100);
+	  m_preview_rect.set_height(20);
+	  queue_draw();
+  }
+  return item;
+}
+
+int FlowTable::dnd_get_distance(FlowTableItem* item, int drag_x, int drag_y, bool& above)
+{
+  int x1;
+  int y1;
+  int x2;
+  int y2;
+  int width;
+  int height;
+  item->m_first->get_window()->get_position(x1, y1);
+  if (item->m_second)
+  {
+    item->m_second->get_window()->get_position(x2, y2);
+    item->m_second->get_window()->get_size(width, height);
+    x2 = x2 + width;
+    y2 = y2 + height;
+  }
+  else
+  {
+    item->m_first->get_window()->get_size(width, height);
+    x2 = x1 + width;
+    y2 = y1 + height;
+  }
+  if (drag_x > x1 && drag_x < x2)
+  {
+	above = ((drag_y - MIN(y1, y2)) < 0);
+    return MIN(abs(drag_y - y1), abs(drag_y - y2));
+  }
+  else
+    return -1;
+}
+
 } //namespace Glom
 
 
Index: glom/utility_widgets/flowtable.h
===================================================================
--- glom/utility_widgets/flowtable.h	(Revision 1103)
+++ glom/utility_widgets/flowtable.h	(Arbeitskopie)
@@ -22,6 +22,7 @@
 #define GLOM_UTILITYWIDGETS_FLOWTABLE_H
 
 #include <gtkmm.h>
+#include "datawidget.h"
 
 namespace Glom
 {
@@ -36,7 +37,10 @@
 
   virtual void add(Gtk::Widget& first, Gtk::Widget& second, bool expand_second = false);
   virtual void add(Gtk::Widget& first, bool expand = false); //override
+  virtual void insert_above(Gtk::Widget& widget, Gtk::Widget& before, bool expand_second = false);
+  virtual void insert_below(Gtk::Widget& widget, Gtk::Widget& after, bool expand_second = false);
 
+  
   virtual void remove(Gtk::Widget& first); //override
 
   void set_columns_count(guint value);
@@ -69,6 +73,16 @@
   virtual void on_unrealize();
   virtual bool on_expose_event(GdkEventExpose* event);
 
+  //DND stuff:
+  virtual bool on_drag_motion(const Glib::RefPtr<Gdk::DragContext>& drag_context, int x, int y, guint time);
+  virtual void on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& drag_context, guint time);
+  virtual void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& drag_context, int, int, const Gtk::SelectionData& selection_data, guint, guint time);
+#ifndef TEST 
+  virtual void on_dnd_add_layout_item(DataWidget* widget) = 0;
+#endif
+  
+  bool m_dnd_in_progress;
+
   int get_column_height(guint start_widget, guint widget_count, int& total_width) const;
 
   /** 
@@ -97,6 +111,15 @@
   void get_item_requested_width(const FlowTableItem& item, int& first, int& second) const;
   void get_item_max_width_requested(guint start, guint height, guint& first_max_width, guint& second_max_width, guint& singles_max_width, bool& is_last_column) const; //TODO: maybe combine this with code in get_minimum_column_height().
 
+  enum DragPosition
+  {
+    ABOVE,
+    BELOW
+  };
+  
+  FlowTableItem* dnd_get_item(int x, int y, DragPosition& position);
+  int dnd_get_distance(FlowTableItem* item, int x, int y, bool& above);
+  
   bool child_is_visible(const Gtk::Widget* widget) const;
 
   Gtk::Allocation assign_child(Gtk::Widget* widget, int x, int y);
@@ -116,6 +139,9 @@
   //For drawing:
   Glib::RefPtr<Gdk::Window> m_refGdkWindow;
   Glib::RefPtr<Gdk::GC> m_refGC;
+  
+  // For preview rectacle
+  Gdk::Rectangle m_preview_rect;
 };
 
 } //namespace Glom
Index: glom/utility_widgets/flowtablewithfields.cc
===================================================================
--- glom/utility_widgets/flowtablewithfields.cc	(Revision 1103)
+++ glom/utility_widgets/flowtablewithfields.cc	(Arbeitskopie)
@@ -1058,4 +1058,9 @@
   signal_requested_related_details().emit(table_name, primary_key_value);
 }
 
+void FlowTableWithFields::on_dnd_add_layout_item(DataWidget* widget)
+{
+  on_datawidget_layout_item_added(TYPE_FIELD, widget);
+}
+
 } //namespace Glom
Index: glom/utility_widgets/dragwindow.cc
===================================================================
--- glom/utility_widgets/dragwindow.cc	(Revision 0)
+++ glom/utility_widgets/dragwindow.cc	(Revision 0)
@@ -0,0 +1,46 @@
+/* Glom
+ *
+ * Copyright (C) 2007 Johannes Schmid <johannes.schmid@openismus.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "dragwindow.h"
+#include "dragbutton.h"
+#include <glibmm/i18n.h>
+
+namespace Glom
+{
+
+DragWindow::DragWindow()
+{
+  set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
+  set_title(_("Drag window"));  
+  
+  DragButton* drag_button = Gtk::manage(new DragButton(_("Drag Widget")));
+  
+  m_box.pack_start(*drag_button);
+  
+  add (m_box);
+  show_all_children();
+}
+
+DragWindow::~DragWindow()
+{
+  
+}
+
+} // namespace Glom
Index: glom/utility_widgets/dragwindow.h
===================================================================
--- glom/utility_widgets/dragwindow.h	(Revision 0)
+++ glom/utility_widgets/dragwindow.h	(Revision 0)
@@ -0,0 +1,42 @@
+/* Glom
+ *
+ * Copyright (C) 2007 Johannes Schmid <johannes.schmid@openismus.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _DRAGWINDOW_H_
+#define _DRAGWINDOW_H_
+
+#include <gtkmm/window.h>
+#include <gtkmm/box.h>
+
+namespace Glom
+{
+
+class DragWindow: public Gtk::Window 
+{
+  public:
+    DragWindow();
+    ~DragWindow();
+  
+  private:
+    Gtk::HBox m_box;
+};
+
+}
+
+#endif // _DRAGWINDOW_H_
Index: glom/utility_widgets/Makefile.am
===================================================================
--- glom/utility_widgets/Makefile.am	(Revision 1103)
+++ glom/utility_widgets/Makefile.am	(Arbeitskopie)
@@ -33,15 +33,29 @@
                                labelglom.h labelglom.cc \
                                dialog_choose_id.cc dialog_choose_id.h \
                                dialog_choose_date.cc dialog_choose_date.h \
-                               filechooserdialog.cc filechooserdialog.h
+                               filechooserdialog.cc filechooserdialog.h \
+                               dragbutton.cc dragbutton.h \
+                               dragwindow.cc dragwindow.h 
 
 libutility_widgets_a_LIBADD = adddel/libutility_widgets_adddel.a \
                               db_adddel/libutility_widgets_db_adddel.a
 
 
+
 noinst_PROGRAMS = test
+test_SOURCES = test_flowtable.cc \
+  flowtable.cc \
+  dragbutton.cc \
+  dragwindow.cc
+test_LDADD = $(GLOM_LIBS)
+test_CXXFLAGS = -DTEST
 
-test_SOURCES = test_flowtable.cc flowtable.cc flowtable.h
 
-test_LDADD =  $(GLOM_LIBS)
 
+
+
+
+
+
+
+
Index: glom/frame_glom.cc
===================================================================
--- glom/frame_glom.cc	(Revision 1103)
+++ glom/frame_glom.cc	(Arbeitskopie)
@@ -32,6 +32,7 @@
 #include <glom/mode_design/dialog_add_related_table.h>
 #include <glom/mode_design/script_library/dialog_script_library.h>
 #include <glom/dialog_new_self_hosted_connection.h>
+#include <glom/utility_widgets/dragwindow.h>
 
 #define ENABLE_RELATIONSHIPS_OVERVIEW
 #ifdef ENABLE_RELATIONSHIPS_OVERVIEW
@@ -1217,6 +1218,12 @@
 
 }
 
+void Frame_Glom::on_menu_developer_fields_interactive()
+{
+  DragWindow* dragwin = new DragWindow;
+  dragwin->show();
+}
+
 void Frame_Glom::do_menu_developer_fields(Gtk::Window& parent)
 {
   //Check that there is a table to show:
Index: glom/application.cc
===================================================================
--- glom/application.cc	(Revision 1103)
+++ glom/application.cc	(Arbeitskopie)
@@ -310,6 +310,11 @@
   m_listDeveloperActions.push_back(action);  
   m_refActionGroup_Others->add(action, sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_developer_fields) );
 
+  action = Gtk::Action::create("GlomAction_Menu_Developer_Fields_Interactive", _("_Fields Interactive"));
+  m_listDeveloperActions.push_back(action);  
+  m_refActionGroup_Others->add(action, sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_developer_fields_interactive) );
+	
+	
   action = Gtk::Action::create("GlomAction_Menu_Developer_RelationshipsOverview", _("_Relationships Overview"));
   m_listDeveloperActions.push_back(action);
   m_refActionGroup_Others->add(action, sigc::mem_fun(*m_pFrame, &Frame_Glom::on_menu_developer_relationships_overview) );
@@ -372,6 +377,7 @@
     "      <menu action='Glom_Menu_Developer'>"
     "        <menuitem action='GlomAction_Menu_Developer_Database_Preferences' />"
     "        <menuitem action='GlomAction_Menu_Developer_Fields' />"
+    "        <menuitem action='GlomAction_Menu_Developer_Fields_Interactive' />"		
     "        <menuitem action='GlomAction_Menu_Developer_Relationships' />"
     "        <menuitem action='GlomAction_Menu_Developer_RelationshipsOverview' />"
     "        <menuitem action='GlomAction_Menu_Developer_Layout' />"
Index: glom/frame_glom.h
===================================================================
--- glom/frame_glom.h	(Revision 1103)
+++ glom/frame_glom.h	(Arbeitskopie)
@@ -82,6 +82,7 @@
   void on_menu_developer_database_preferences();
 
   void on_menu_developer_fields();
+  void on_menu_developer_fields_interactive();
   void do_menu_developer_fields(Gtk::Window& parent);
 
   void on_menu_developer_relationships_overview();
