[glom] Field Definitions: Show default value widget for date fields.



commit 1f59c217aade9e05a9cd0841e6158d6ca8f98fe5
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Dec 4 09:19:54 2009 +0100

    Field Definitions: Show default value widget for date fields.
    
    * glom/utility_widgets/datawidget.cc: Constructor: show the
    hbox_parent widget, so the widgets always show up for the default value
    in the field definitio dialog for date fields. The details view must
    be doing this via a show_all() somewhere.

 ChangeLog                                         |    9 +++++++++
 glom/mode_design/fields/dialog_fielddefinition.cc |    2 +-
 glom/utility_widgets/datawidget.cc                |    3 ++-
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f9609bf..7fd7c2c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-04  Murray Cumming  <murrayc murrayc com>
+
+	Field Definitions: Show default value widget for date fields.
+
+	* glom/utility_widgets/datawidget.cc: Constructor: show the 
+	hbox_parent widget, so the widgets always show up for the default value 
+	in the field definitio dialog for date fields. The details view must 
+	be doing this via a show_all() somewhere. 	
+
 2009-12-03  Murray Cumming  <murrayc murrayc com>
 
 	Related Records layout: Field formatting: Choices: Fix related choices.
diff --git a/glom/mode_design/fields/dialog_fielddefinition.cc b/glom/mode_design/fields/dialog_fielddefinition.cc
index 964ce82..8ad13e3 100644
--- a/glom/mode_design/fields/dialog_fielddefinition.cc
+++ b/glom/mode_design/fields/dialog_fielddefinition.cc
@@ -165,7 +165,7 @@ void Dialog_FieldDefinition::set_field(const sharedptr<const Field>& field, cons
   field_default_value->set_title(_("Default Value"));
   layout_item->set_full_field_details(field_default_value);
   m_pDataWidget_DefaultValueSimple = Gtk::manage( new DataWidget(layout_item, "", get_document()) );
-  if(!(m_pDataWidget_DefaultValueSimple->get_data_child_widget()))
+  if(!m_pDataWidget_DefaultValueSimple->get_data_child_widget())
     std::cerr << "Dialog_FieldDefinition::set_field(): The DataWidget did not create a child widget." << std::endl;
 
   on_foreach_connect(*m_pDataWidget_DefaultValueSimple);
diff --git a/glom/utility_widgets/datawidget.cc b/glom/utility_widgets/datawidget.cc
index f7706d9..df7497d 100644
--- a/glom/utility_widgets/datawidget.cc
+++ b/glom/utility_widgets/datawidget.cc
@@ -169,7 +169,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
         TextViewGlom* textview = Gtk::manage(new TextViewGlom(glom_type));
         pFieldWidget = textview;
       }
-      else
+      else  //TYPE_DATE, TYPE_NUMBER, etc.
       {
         EntryGlom* entry = Gtk::manage(new EntryGlom(glom_type));
         pFieldWidget = entry;
@@ -230,6 +230,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
       hbox_parent->set_spacing(Utils::DEFAULT_SPACING_SMALL);
 
       hbox_parent->pack_start(*m_child);
+      hbox_parent->show();
       add(*hbox_parent);
 
       child_added = true;



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