[glom] Print Layout: Allow editing of line width and color.



commit 845b9dcdeb1c1cbd6b41f1022a9238a1d7aa19dd
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Aug 29 13:43:56 2011 +0200

    Print Layout: Allow editing of line width and color.
    
    * Makefile.am:
    * Makefile_glom.am:
    * ui/developer/dialog_line.glade:
    * glom/mode_design/layout/layout_item_dialogs/dialog_line.[h|cc]:
    Added a new dialog for editing line details, such as width and color.
    * tests/test_glade_derived_instantiation.cc: Test new new dialog.
    
    * glom/libglom/data_structure/layout/layoutitem_line.[h|cc]: Added
    get/set_line_width() and get/set_line_color().
    * glom/libglom/document/document.cc: load_after(), save_before(): Store
    these new details in the document.
    * glom/print_layout/canvas_layout_item.cc:
    * glom/print_layout/canvas_print_layout.[h|cc]: Allow editing by showing
    this new dialog.

 ChangeLog                                          |   19 +++
 Makefile.am                                        |    1 +
 Makefile_glom.am                                   |    2 +
 .../data_structure/layout/layoutitem_line.cc       |   35 ++++-
 .../data_structure/layout/layoutitem_line.h        |    9 +
 glom/libglom/document/document.cc                  |   13 ++
 .../layout/layout_item_dialogs/dialog_line.cc      |  104 ++++++++++++
 .../layout/layout_item_dialogs/dialog_line.h       |   56 +++++++
 glom/print_layout/canvas_layout_item.cc            |    6 +-
 glom/print_layout/canvas_print_layout.cc           |   37 +++++
 glom/print_layout/canvas_print_layout.h            |    4 +-
 po/ChangeLog                                       |    6 +
 po/POTFILES.in                                     |    2 +
 tests/test_glade_derived_instantiation.cc          |    2 +
 ui/developer/dialog_line.glade                     |  166 ++++++++++++++++++++
 15 files changed, 454 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ff9eaff..69a2529 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,24 @@
 2011-08-29  Murray Cumming  <murrayc murrayc com>
 
+	Print Layout: Allow editing of line width and color.
+
+	* Makefile.am:
+	* Makefile_glom.am:
+	* ui/developer/dialog_line.glade:
+	* glom/mode_design/layout/layout_item_dialogs/dialog_line.[h|cc]:
+	Added a new dialog for editing line details, such as width and color.
+	* tests/test_glade_derived_instantiation.cc: Test new new dialog.
+
+	* glom/libglom/data_structure/layout/layoutitem_line.[h|cc]: Added 
+	get/set_line_width() and get/set_line_color().
+	* glom/libglom/document/document.cc: load_after(), save_before(): Store
+	these new details in the document.
+	* glom/print_layout/canvas_layout_item.cc:
+	* glom/print_layout/canvas_print_layout.[h|cc]: Allow editing by showing 
+	this new dialog.
+
+2011-08-29  Murray Cumming  <murrayc murrayc com>
+
 	Load whole glade files, to get secondary objects without listing them.
 
 	* glom/glade_utils.h: helper_get_glade_widget_derived_with_warning():
diff --git a/Makefile.am b/Makefile.am
index e46e859..4a61889 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -110,6 +110,7 @@ dist_glade_developer_DATA = ui/developer/dialog_add_related_table.glade \
 	ui/developer/dialog_group_by.glade \
 	ui/developer/dialog_groupby_sort_fields.glade \
 	ui/developer/dialog_initial_password.glade \
+	ui/developer/dialog_line.glade \
 	ui/developer/dialog_layout_field_properties.glade \
 	ui/developer/dialog_new_group.glade \
 	ui/developer/dialog_new_library_script.glade \
diff --git a/Makefile_glom.am b/Makefile_glom.am
index a21b94c..8a263a2 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -326,6 +326,8 @@ glom_source_files +=							\
 	glom/mode_design/layout/layout_item_dialogs/dialog_groupby_sortfields.h		\
 	glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.cc		\
 	glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.h		\
+	glom/mode_design/layout/layout_item_dialogs/dialog_line.cc		\
+	glom/mode_design/layout/layout_item_dialogs/dialog_line.h			\
 	glom/mode_design/layout/layout_item_dialogs/dialog_notebook.cc			\
 	glom/mode_design/layout/layout_item_dialogs/dialog_notebook.h			\
 	glom/mode_design/layout/layout_item_dialogs/dialog_textobject.cc		\
diff --git a/glom/libglom/data_structure/layout/layoutitem_line.cc b/glom/libglom/data_structure/layout/layoutitem_line.cc
index 96baa0f..3f818b4 100644
--- a/glom/libglom/data_structure/layout/layoutitem_line.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_line.cc
@@ -29,7 +29,9 @@ LayoutItem_Line::LayoutItem_Line()
 : m_start_x(0),
   m_start_y(0),
   m_end_x(0),
-  m_end_y(0)
+  m_end_y(0),
+  m_line_width(0.5f), //Arbitrary default
+  m_color("black") //Arbitrary default
 {
   m_translatable_item_type = TRANSLATABLE_TYPE_INVALID; //There is no text in this to translate.
 }
@@ -39,7 +41,9 @@ LayoutItem_Line::LayoutItem_Line(const LayoutItem_Line& src)
   m_start_x(src.m_start_x),
   m_start_y(src.m_start_y),
   m_end_x(src.m_end_x),
-  m_end_y(src.m_end_y)
+  m_end_y(src.m_end_y),
+  m_line_width(src.m_line_width),
+  m_color(src.m_color)
 {
 }
 
@@ -58,7 +62,9 @@ bool LayoutItem_Line::operator==(const LayoutItem_Line& src) const
                 (m_start_x == src.m_start_x) && 
                 (m_start_y == src.m_start_y) && 
                 (m_end_x == src.m_end_x) && 
-                (m_end_y == src.m_end_y);
+                (m_end_y == src.m_end_y) &&
+                (m_line_width == src.m_line_width) &&
+                (m_color == src.m_color);
 
   return result;
 }
@@ -72,6 +78,8 @@ LayoutItem_Line& LayoutItem_Line::operator=(const LayoutItem_Line& src)
   m_start_y = src.m_start_y;
   m_end_x = src.m_end_x;
   m_end_y = src.m_end_y;
+  m_line_width = src.m_line_width;
+  m_color = src.m_color;
 
   return *this;
 }
@@ -108,5 +116,26 @@ void LayoutItem_Line::set_coordinates(double start_x, double start_y, double end
   set_print_layout_position(m_start_x, m_start_y, (m_end_x - m_start_x), (m_end_y - m_start_y));
 }
 
+double LayoutItem_Line::get_line_width() const
+{
+  return m_line_width;
+}
+
+void LayoutItem_Line::set_line_width(double line_width)
+{
+  m_line_width = line_width;
+}
+  
+Glib::ustring LayoutItem_Line::get_line_color() const
+{
+  return m_color;
+}
+
+void LayoutItem_Line::set_line_color(const Glib::ustring& color)
+{
+  m_color = color;
+}
+
+
 } //namespace Glom
 
diff --git a/glom/libglom/data_structure/layout/layoutitem_line.h b/glom/libglom/data_structure/layout/layoutitem_line.h
index 2f4005b..f5711eb 100644
--- a/glom/libglom/data_structure/layout/layoutitem_line.h
+++ b/glom/libglom/data_structure/layout/layoutitem_line.h
@@ -51,10 +51,19 @@ public:
   /** Set the coordinates.
    */
   void set_coordinates(double start_x, double start_y, double end_x, double end_y);
+  
+  double get_line_width() const;
+  void set_line_width(double line_width);
+  
+  //TODO: Document the format:
+  Glib::ustring get_line_color() const;
+  void set_line_color(const Glib::ustring& color);
 
 private:
 
   double m_start_x, m_start_y, m_end_x, m_end_y;
+  double m_line_width;
+  Glib::ustring m_color;
 };
 
 } //namespace Glom
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index b07a965..813ea1e 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -97,6 +97,8 @@ static const char GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_START_X[] = "start_x";
 static const char GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_START_Y[] = "start_y";
 static const char GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_END_X[] = "end_x";
 static const char GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_END_Y[] = "end_y";
+static const char GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_WIDTH[] = "line_width";
+static const char GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_COLOR[] = "color";
 static const char GLOM_ATTRIBUTE_DATA_LAYOUT_ITEM_FIELD_USE_DEFAULT_FORMATTING[] = "use_default_formatting";
 static const char GLOM_NODE_DATA_LAYOUT_ITEM_GROUPBY[] = "data_layout_item_groupby";
 static const char GLOM_NODE_DATA_LAYOUT_GROUP_SECONDARYFIELDS[] = "secondary_fields";
@@ -2262,6 +2264,12 @@ void Document::load_after_layout_group(const xmlpp::Element* node, const Glib::u
           get_node_attribute_value_as_decimal_double(element, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_START_Y),
           get_node_attribute_value_as_decimal_double(element, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_END_X),
           get_node_attribute_value_as_decimal_double(element, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_END_Y) );
+          
+        item->set_line_width(
+          get_node_attribute_value_as_decimal_double(element, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_WIDTH) );
+          
+        item->set_line_color(
+          get_node_attribute_value(element, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_COLOR) );
 
         item_added = item;
       }
@@ -3429,6 +3437,11 @@ void Document::save_before_layout_group(xmlpp::Element* node, const sharedptr<co
                   set_node_attribute_value_as_decimal_double(nodeItem, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_START_Y, start_y);
                   set_node_attribute_value_as_decimal_double(nodeItem, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_END_X, end_x);
                   set_node_attribute_value_as_decimal_double(nodeItem, GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_END_Y, end_y);
+                  
+                  set_node_attribute_value_as_decimal_double(nodeItem, 
+                    GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_WIDTH, line->get_line_width());
+                  set_node_attribute_value(nodeItem, 
+                    GLOM_ATTRIBUTE_DATA_LAYOUT_LINE_COLOR, line->get_line_color());
                 }
               }
             }
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_line.cc b/glom/mode_design/layout/layout_item_dialogs/dialog_line.cc
new file mode 100644
index 0000000..de0bc5d
--- /dev/null
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_line.cc
@@ -0,0 +1,104 @@
+/* Glom
+ *
+ * Copyright (C) 2001-2004 Murray Cumming
+ *
+ * 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 "dialog_line.h"
+#include <libglom/data_structure/glomconversions.h>
+#include <iostream>
+
+//#include <libgnome/gnome-i18n.h>
+#include <glibmm/i18n.h>
+
+namespace Glom
+{
+
+const char* Dialog_Line::glade_id("dialog_line");
+const bool Dialog_Line::glade_developer(true);
+
+Dialog_Line::Dialog_Line(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder)
+: Gtk::Dialog(cobject),
+  m_spinbutton_line_width(0),
+  m_colorbutton(0)
+{
+  builder->get_widget("spinbutton_line_width",  m_spinbutton_line_width);
+  builder->get_widget("colorbutton",  m_colorbutton);
+
+  //on_foreach_connect(*this);
+
+  //Dialog_Properties::set_modified(false);
+
+  show_all_children();
+}
+
+Dialog_Line::~Dialog_Line()
+{
+}
+
+void Dialog_Line::set_line(const sharedptr<const LayoutItem_Line>& line)
+{
+  if(!line)
+  {
+    std::cerr << G_STRFUNC << ": line is null" << std::endl;
+  }
+
+  //set_blocked();
+
+  m_line = glom_sharedptr_clone(line); //Remember it so we save any details that are not in our UI.
+
+  m_spinbutton_line_width->set_value(line->get_line_width());
+  
+  //TODO: Use GdkRGBA's color string (CSS) format instead, everywhere:
+  Gdk::Color color( line->get_line_color() );
+  m_colorbutton->set_color(color);
+
+  //set_blocked(false);
+
+  //Dialog_Properties::set_modified(false);
+}
+
+sharedptr<LayoutItem_Line> Dialog_Line::get_line() const
+{
+  if(!m_line)
+  {
+    std::cerr << G_STRFUNC <<  ": m_line is null" << std::endl;
+  }
+  
+  sharedptr<LayoutItem_Line> result = glom_sharedptr_clone(m_line); //Start with the old details, to preserve anything that is not in our UI.
+
+  if(!result)
+  {
+    std::cerr << ": result is null" << std::endl;
+    return result;
+  }
+
+  result->set_line_width( m_spinbutton_line_width->get_value() );
+  
+  //TODO: Use GdkRGBA's color string (CSS) format instead, everywhere:
+  result->set_line_color( m_colorbutton->get_color().to_string() );
+
+  return result;
+}
+
+} //namespace Glom
+
+
+
+
+
diff --git a/glom/mode_design/layout/layout_item_dialogs/dialog_line.h b/glom/mode_design/layout/layout_item_dialogs/dialog_line.h
new file mode 100644
index 0000000..918aaee
--- /dev/null
+++ b/glom/mode_design/layout/layout_item_dialogs/dialog_line.h
@@ -0,0 +1,56 @@
+/* Glom
+ *
+ * Copyright (C) 2001-2004 Murray Cumming
+ *
+ * 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 GLOM_MODE_DESIGN_DIALOG_LINE_H
+#define GLOM_MODE_DESIGN_DIALOG_LINE_H
+
+#include <gtkmm.h>
+#include <gtkmm/builder.h>
+#include <libglom/data_structure/layout/layoutitem_line.h>
+#include <glom/base_db.h>
+
+namespace Glom
+{
+
+class Dialog_Line
+ : public Gtk::Dialog,
+   public Base_DB //Give this class access to the current document, and to some utility methods.
+
+{
+public:
+  static const char* glade_id;
+  static const bool glade_developer;
+  
+  Dialog_Line(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
+  virtual ~Dialog_Line();
+
+  void set_line(const sharedptr<const LayoutItem_Line>& line);
+  sharedptr<LayoutItem_Line> get_line() const;
+
+private:
+  Gtk::SpinButton* m_spinbutton_line_width;
+  Gtk::ColorButton* m_colorbutton;
+
+  sharedptr<LayoutItem_Line> m_line;
+};
+
+} //namespace Glom
+
+#endif // GLOM_MODE_DESIGN_DIALOG_LINE_H
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index a50c189..7c71d3f 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -187,8 +187,6 @@ int CanvasLayoutItem::get_rows_count_for_portal(const sharedptr<const LayoutItem
 
 Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_item(const sharedptr<LayoutItem>& layout_item)
 {
-  sharedptr<LayoutItem_Line> line;
-
   Glib::RefPtr<CanvasItemMovable> child;
   Glib::RefPtr<Goocanvas::Item> child_item;
   sharedptr<LayoutItem_Text> text = sharedptr<LayoutItem_Text>::cast_dynamic(layout_item);
@@ -233,8 +231,8 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
         line->get_coordinates(start_x, start_y, end_x, end_y);
 
         Glib::RefPtr<CanvasLineMovable> canvas_item = CanvasLineMovable::create();
-        canvas_item->property_line_width() = 1;
-        canvas_item->property_stroke_color() = "black";
+        canvas_item->property_line_width() = line->get_line_width();
+        canvas_item->property_stroke_color() = line->get_line_color();
 
         Goocanvas::Points points(2);
         points.set_coordinate(0, start_x, start_y);
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index e8b0847..7c69021 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -24,6 +24,7 @@
 #include <gtkmm/stock.h>
 #include <glom/mode_design/print_layouts/dialog_text_formatting.h>
 #include <glom/mode_design/layout/dialog_layout_list_related.h>
+#include <glom/mode_design/layout/layout_item_dialogs/dialog_line.h>
 
 //TODO: Remove these when we can just use a CanvasLayoutItem in a GooCanvasTable:
 #include <glom/utility_widgets/canvas/canvas_table_movable.h>
@@ -350,6 +351,33 @@ sharedptr<LayoutItem_Portal> Canvas_PrintLayout::offer_related_records(const sha
   return result;
 }
 
+sharedptr<LayoutItem_Line> Canvas_PrintLayout::offer_line(const sharedptr<LayoutItem_Line>& line, Gtk::Window* parent)
+{
+  sharedptr<LayoutItem_Line> result = line;
+
+  Dialog_Line* dialog = 0;
+  Utils::get_glade_widget_derived_with_warning(dialog);
+  if(!dialog) //Unlikely and it already warns on stderr.
+    return result;
+
+  if(parent)
+    dialog->set_transient_for(*parent);
+    
+  dialog->set_line(line);
+
+  const int response = Glom::Utils::dialog_run_with_help(dialog);
+  dialog->hide();
+  if(response == Gtk::RESPONSE_OK)
+  {
+    //Get the chosen relationship:
+    result = dialog->get_line();
+  }
+
+  delete dialog;
+
+  return result;
+}
+
 void Canvas_PrintLayout::on_context_menu_edit()
 {
   Gtk::Window* parent = dynamic_cast<Gtk::Window*>(get_toplevel());
@@ -394,6 +422,15 @@ void Canvas_PrintLayout::on_context_menu_edit()
           portal = offer_related_records(portal, parent);
           m_context_item->set_layout_item(portal);
         }
+        else
+        {
+         sharedptr<LayoutItem_Line> line = sharedptr<LayoutItem_Line>::cast_dynamic(layout_item);
+         if(line)
+         {
+           line = offer_line(line, parent);
+           m_context_item->set_layout_item(line);
+         }
+        }
       }
     }
   }
diff --git a/glom/print_layout/canvas_print_layout.h b/glom/print_layout/canvas_print_layout.h
index b7b6288..bae82dc 100644
--- a/glom/print_layout/canvas_print_layout.h
+++ b/glom/print_layout/canvas_print_layout.h
@@ -25,6 +25,7 @@
 #include <glom/utility_widgets/canvas/canvas_editable.h>
 #include <glom/print_layout/canvas_layout_item.h>
 #include <libglom/data_structure/print_layout.h>
+#include <libglom/data_structure/layout/layoutitem_line.h>
 #include <gtkmm/uimanager.h>
 #include <gtkmm/toggleaction.h>
 #include <gtkmm/pagesetup.h>
@@ -97,7 +98,8 @@ private:
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   sharedptr<LayoutItem_Portal> offer_related_records(const sharedptr<LayoutItem_Portal>& portal, Gtk::Window* parent);
-
+  sharedptr<LayoutItem_Line> offer_line(const sharedptr<LayoutItem_Line>& portal, Gtk::Window* parent);
+  
   //TODO: Make the signal send the item, so we can pass it by const reference:
   void on_item_show_context_menu(guint button, guint32 activate_time, Glib::RefPtr<CanvasLayoutItem> item);
   void on_context_menu_edit();
diff --git a/po/ChangeLog b/po/ChangeLog
index 39acb66..423fcd0 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-29  Murray Cumming  <murrayc murrayc-desktop>
+
+	reviewed by: <delete if not using a buddy>
+
+	* POTFILES.in:
+
 2011-07-11  Murray Cumming  <murrayc murrayc-desktop>
 
 	reviewed by: <delete if not using a buddy>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 64d8b99..553e4b6 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -92,6 +92,7 @@ glom/mode_design/layout/layout_item_dialogs/dialog_group_by.cc
 glom/mode_design/layout/layout_item_dialogs/dialog_fieldslist.cc
 glom/mode_design/layout/layout_item_dialogs/dialog_groupby_sortfields.cc
 glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.cc
+glom/mode_design/layout/layout_item_dialogs/dialog_line.cc
 glom/mode_design/layout/layout_item_dialogs/dialog_notebook.cc
 glom/mode_design/layout/layout_item_dialogs/dialog_textobject.cc
 glom/mode_design/report_layout/dialog_layout_report.cc
@@ -158,6 +159,7 @@ ui/developer/dialog_flowtable.glade
 ui/developer/dialog_group_by.glade
 ui/developer/dialog_groupby_sort_fields.glade
 ui/developer/dialog_initial_password.glade
+ui/developer/dialog_line.glade
 ui/developer/dialog_layout_field_properties.glade
 ui/developer/dialog_new_group.glade
 ui/developer/dialog_new_library_script.glade
diff --git a/tests/test_glade_derived_instantiation.cc b/tests/test_glade_derived_instantiation.cc
index 1bbaeef..d2b065d 100644
--- a/tests/test_glade_derived_instantiation.cc
+++ b/tests/test_glade_derived_instantiation.cc
@@ -20,6 +20,7 @@
 #include <glom/mode_design/dialog_add_related_table.h>
 #include <glom/mode_design/layout/layout_item_dialogs/dialog_buttonscript.h>
 #include <glom/mode_design/layout/layout_item_dialogs/dialog_field_layout.h>
+#include <glom/mode_design/layout/layout_item_dialogs/dialog_line.h>
 #include <glom/mode_design/layout/layout_item_dialogs/dialog_imageobject.h>
 #include <glom/mode_design/layout/layout_item_dialogs/dialog_notebook.h>
 #include <glom/mode_design/layout/layout_item_dialogs/dialog_textobject.h>
@@ -112,6 +113,7 @@ int main(int argc, char *argv[])
   instantiate_widget<Box_Formatting>();
   instantiate_widget<Dialog_FieldsList>();
   instantiate_widget<Dialog_GroupBy_SortFields>();
+  instantiate_widget<Dialog_Line>();
   instantiate_widget<Dialog_ImageObject>();
   instantiate_widget<Dialog_Notebook>();
   instantiate_widget<Dialog_FieldSummary>();
diff --git a/ui/developer/dialog_line.glade b/ui/developer/dialog_line.glade
new file mode 100644
index 0000000..6cdceae
--- /dev/null
+++ b/ui/developer/dialog_line.glade
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">300</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkDialog" id="dialog_line">
+    <property name="can_focus">False</property>
+    <property name="title" translatable="yes">Text Object</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="default_width">300</property>
+    <property name="default_height">400</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox2">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="spacing">6</property>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="helpbutton2">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancelbutton2">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="okbutton2">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkTable" id="table1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="n_rows">2</property>
+            <property name="n_columns">2</property>
+            <property name="column_spacing">6</property>
+            <property name="row_spacing">6</property>
+            <child>
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Line Width:</property>
+              </object>
+              <packing>
+                <property name="x_options"></property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">Color:</property>
+              </object>
+              <packing>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="x_options"></property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkSpinButton" id="spinbutton_line_width">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="invisible_char">â</property>
+                <property name="primary_icon_activatable">False</property>
+                <property name="secondary_icon_activatable">False</property>
+                <property name="primary_icon_sensitive">True</property>
+                <property name="secondary_icon_sensitive">True</property>
+                <property name="adjustment">adjustment1</property>
+                <property name="numeric">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkColorButton" id="colorbutton">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
+                <property name="color">#000000000000</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">True</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-11">helpbutton2</action-widget>
+      <action-widget response="-6">cancelbutton2</action-widget>
+      <action-widget response="-5">okbutton2</action-widget>
+    </action-widgets>
+  </object>
+</interface>



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