glom r1614 - in trunk: . glom/mode_data glom/utility_widgets



Author: jhs
Date: Wed May 21 14:55:32 2008
New Revision: 1614
URL: http://svn.gnome.org/viewvc/glom?rev=1614&view=rev

Log:
2008-05-21  Johannes Schmid  <johannes schmid openismus com>

	* glom/mode_data/flowtablewithfields.cc:
	  (on_dnd_add_layout_item_image)
	* glom/mode_data/flowtablewithfields.h:
	* glom/utility_widgets/dragbar.cc 
	(DragBar):
	* glom/utility_widgets/flowtable_dnd.cc 
	(on_drag_data_received):
	* glom/utility_widgets/flowtable_dnd.h
	(FlowTableDnd):
	* glom/utility_widgets/layoutwidgetbase.h:
  Add images as possible drag items to the sidebar and adjust flowtable
  to accept images.

Modified:
   trunk/ChangeLog
   trunk/glom/mode_data/flowtablewithfields.cc
   trunk/glom/mode_data/flowtablewithfields.h
   trunk/glom/utility_widgets/dragbar.cc
   trunk/glom/utility_widgets/flowtable_dnd.cc
   trunk/glom/utility_widgets/flowtable_dnd.h
   trunk/glom/utility_widgets/layoutwidgetbase.h

Modified: trunk/glom/mode_data/flowtablewithfields.cc
==============================================================================
--- trunk/glom/mode_data/flowtablewithfields.cc	(original)
+++ trunk/glom/mode_data/flowtablewithfields.cc	Wed May 21 14:55:32 2008
@@ -1278,6 +1278,18 @@
   signal_layout_changed().emit();
 }
 
+void FlowTableWithFields::on_dnd_add_layout_item_image(LayoutWidgetBase* above)
+{
+  // create the text label
+  sharedptr<LayoutItem_Image> image_object = sharedptr<LayoutItem_Image>::create();
+  sharedptr<LayoutItem> layout_item = sharedptr<LayoutItem>::cast_dynamic(image_object);
+
+  dnd_add_to_layout_group (layout_item, above);
+  //Tell the parent to tell the document to save the layout
+
+  signal_layout_changed().emit();
+}
+
 void FlowTableWithFields::on_dnd_add_layout_item (LayoutWidgetBase* above,
                                                   sharedptr<LayoutItem>& item)
 {

Modified: trunk/glom/mode_data/flowtablewithfields.h
==============================================================================
--- trunk/glom/mode_data/flowtablewithfields.h	(original)
+++ trunk/glom/mode_data/flowtablewithfields.h	Wed May 21 14:55:32 2008
@@ -215,6 +215,7 @@
   virtual void on_dnd_add_layout_group(LayoutWidgetBase* above);
   virtual void on_dnd_add_layout_item_button (LayoutWidgetBase* above);
   virtual void on_dnd_add_layout_item_text (LayoutWidgetBase* above);
+  virtual void on_dnd_add_layout_item_image (LayoutWidgetBase* above);
   virtual void on_dnd_add_layout_notebook (LayoutWidgetBase* above);
   virtual void on_dnd_add_layout_item (LayoutWidgetBase* above,
                                        sharedptr<LayoutItem>& item);

Modified: trunk/glom/utility_widgets/dragbar.cc
==============================================================================
--- trunk/glom/utility_widgets/dragbar.cc	(original)
+++ trunk/glom/utility_widgets/dragbar.cc	Wed May 21 14:55:32 2008
@@ -41,6 +41,8 @@
     Gtk::manage (new Gtk::Image(GLOM_ICON_DIR "/glom-button.png"));
   Gtk::Image* image_text = 
     Gtk::manage (new Gtk::Image(GLOM_ICON_DIR "/glom-text.png"));
+  Gtk::Image* image_image = 
+    Gtk::manage (new Gtk::Image(GLOM_ICON_DIR "/glom-image.png"));
   
   Gtk::Image* image_group = 
     Gtk::manage (new Gtk::Image(GLOM_ICON_DIR "/glom-group.png"));
@@ -54,6 +56,7 @@
   DragButton* drag_item = Gtk::manage(new DragButton(*image_item, LayoutWidgetBase::TYPE_FIELD));
   DragButton* drag_button = Gtk::manage(new DragButton(*image_button, LayoutWidgetBase::TYPE_BUTTON));
   DragButton* drag_text = Gtk::manage(new DragButton(*image_text, LayoutWidgetBase::TYPE_TEXT));  
+  DragButton* drag_image = Gtk::manage(new DragButton(*image_image, LayoutWidgetBase::TYPE_IMAGE));
   
   GtkContainer* container_group = GTK_CONTAINER(egg_tool_item_group_new(_("Containers")));
   gtk_container_add (container_group, GTK_WIDGET(drag_group->gobj()));
@@ -63,7 +66,8 @@
   gtk_container_add (fields_group, GTK_WIDGET(drag_item->gobj()));
   gtk_container_add (fields_group, GTK_WIDGET(drag_button->gobj()));  
   gtk_container_add (fields_group, GTK_WIDGET(drag_text->gobj()));
-	
+  gtk_container_add (fields_group, GTK_WIDGET(drag_image->gobj()));
+  
   add_group (EGG_TOOL_ITEM_GROUP(container_group));
   add_group (EGG_TOOL_ITEM_GROUP(fields_group));
 	

Modified: trunk/glom/utility_widgets/flowtable_dnd.cc
==============================================================================
--- trunk/glom/utility_widgets/flowtable_dnd.cc	(original)
+++ trunk/glom/utility_widgets/flowtable_dnd.cc	Wed May 21 14:55:32 2008
@@ -166,6 +166,9 @@
       case LayoutWidgetBase::TYPE_TEXT:
         on_dnd_add_layout_item_text(above);
         break;
+      case LayoutWidgetBase::TYPE_IMAGE:
+        on_dnd_add_layout_item_image(above);
+        break;
       case LayoutWidgetBase::TYPE_GROUP:
         on_dnd_add_layout_group(above);
         break;

Modified: trunk/glom/utility_widgets/flowtable_dnd.h
==============================================================================
--- trunk/glom/utility_widgets/flowtable_dnd.h	(original)
+++ trunk/glom/utility_widgets/flowtable_dnd.h	Wed May 21 14:55:32 2008
@@ -65,6 +65,7 @@
   virtual void on_dnd_add_layout_group(LayoutWidgetBase* above) = 0;
   virtual void on_dnd_add_layout_item_button (LayoutWidgetBase* above) = 0;
   virtual void on_dnd_add_layout_item_text (LayoutWidgetBase* above) = 0;
+  virtual void on_dnd_add_layout_item_image (LayoutWidgetBase* above) = 0;
   virtual void on_dnd_add_layout_notebook (LayoutWidgetBase* above) = 0;
   virtual void on_dnd_add_layout_item (LayoutWidgetBase* above,
                                        sharedptr<LayoutItem>& item) = 0;

Modified: trunk/glom/utility_widgets/layoutwidgetbase.h
==============================================================================
--- trunk/glom/utility_widgets/layoutwidgetbase.h	(original)
+++ trunk/glom/utility_widgets/layoutwidgetbase.h	Wed May 21 14:55:32 2008
@@ -52,7 +52,8 @@
     TYPE_NOTEBOOK,
     TYPE_PORTAL,
     TYPE_BUTTON,
-    TYPE_TEXT
+    TYPE_TEXT,
+    TYPE_IMAGE
   };
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]