glom r1443 - in trunk: . glom/mode_data glom/utility_widgets
- From: jhs svn gnome org
- To: svn-commits-list gnome org
- Subject: glom r1443 - in trunk: . glom/mode_data glom/utility_widgets
- Date: Fri, 29 Feb 2008 17:20:02 +0000 (GMT)
Author: jhs
Date: Fri Feb 29 17:20:02 2008
New Revision: 1443
URL: http://svn.gnome.org/viewvc/glom?rev=1443&view=rev
Log:
2008-02-29 Johannes Schmid <johannes schmid openismus com>
* glom/utility_widgets/flowtable.cc:
Fixed dragging on LabelGlom
Modified:
trunk/ChangeLog
trunk/glom/mode_data/flowtablewithfields.cc
trunk/glom/utility_widgets/flowtable.cc
Modified: trunk/glom/mode_data/flowtablewithfields.cc
==============================================================================
--- trunk/glom/mode_data/flowtablewithfields.cc (original)
+++ trunk/glom/mode_data/flowtablewithfields.cc Fri Feb 29 17:20:02 2008
@@ -517,7 +517,7 @@
alignment_label->show();
LabelGlom* label = Gtk::manage(new LabelGlom(layoutitem_text->get_text(), 0.0 /* xalign */, 0.5 /* yalign */)); //The alignment here seems to be necessary as well (or instead of) the parent Gtk::Alignment.
- label->set_layout_item (layoutitem_text, table_name);
+ label->set_layout_item (layoutitem_text, table_name);
label->show();
alignment_label->add(*label);
Modified: trunk/glom/utility_widgets/flowtable.cc
==============================================================================
--- trunk/glom/utility_widgets/flowtable.cc (original)
+++ trunk/glom/utility_widgets/flowtable.cc Fri Feb 29 17:20:02 2008
@@ -386,11 +386,35 @@
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()))
+ FlowTableItem* item = &(*pos);
+ if (item->m_first)
+ {
+ if (item->m_first->gobj() == before.gobj())
+ {
+ found = true;
+ break;
+ }
+ Gtk::Alignment* alignment = dynamic_cast<Gtk::Alignment*>(item->m_first);
+ if (alignment && alignment->get_child()->gobj() == before.gobj())
{
found = true;
break;
}
+ }
+ if (item->m_second)
+ {
+ if (item->m_second->gobj() == before.gobj())
+ {
+ found = true;
+ break;
+ }
+ Gtk::Alignment* alignment = dynamic_cast<Gtk::Alignment*>(item->m_second);
+ if (alignment && alignment->get_child()->gobj() == before.gobj())
+ {
+ found = true;
+ break;
+ }
+ }
}
gtk_widget_set_parent(GTK_WIDGET (item.m_first->gobj()), GTK_WIDGET(gobj()));
@@ -426,9 +450,6 @@
return;
}
- //std::cout << "Setup DND: ";
- //std::cout << g_type_name (G_OBJECT_TYPE (child.gobj()));
-
if (!(child.get_flags() & Gtk::NO_WINDOW))
{
std::list<Gtk::TargetEntry> new_targets;
@@ -451,10 +472,7 @@
false);
child.signal_drag_data_received().connect (sigc::bind<Gtk::Widget*>(sigc::mem_fun (*this, &FlowTable::on_child_drag_data_received), &child));
child.signal_drag_leave().connect (sigc::mem_fun (*this, &FlowTable::on_child_drag_leave));
- //std::cout << "...done" << std::endl;
}
- else
- ;//std::cout << "...skipped" << std::endl;
}
void FlowTable::set_columns_count(guint value)
@@ -1254,9 +1272,7 @@
Gtk::Alignment* alignment = dynamic_cast <Gtk::Alignment*>(m_current_dnd_item->m_first);
if (alignment)
{
- above = dynamic_cast<PlaceholderGlom*>(alignment->get_child());
- if (above)
- std::cout << "Above placeholder" << std::endl;
+ above = dynamic_cast<LayoutWidgetBase*>(alignment->get_child());
}
}
if(!above && m_current_dnd_item->m_first)
@@ -1264,7 +1280,15 @@
if(!above && m_current_dnd_item->m_second)
{
above = dynamic_cast<LayoutWidgetBase*>(m_current_dnd_item->m_second);
- //std::cout << g_type_name (G_OBJECT_TYPE (m_current_dnd_item->m_second->gobj())) << std::endl;
+ // Special case for labels
+ if (!above)
+ {
+ Gtk::Alignment* alignment = dynamic_cast <Gtk::Alignment*>(m_current_dnd_item->m_second);
+ if (alignment)
+ {
+ above = dynamic_cast<LayoutWidgetBase*>(alignment->get_child());
+ }
+ }
}
}
return above;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]