[glom] Enable the canvas test.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Enable the canvas test.
- Date: Fri, 12 Aug 2011 07:09:38 +0000 (UTC)
commit 541d08cdd5f0c1f46766ea3e0a2a7b2d93f98b00
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Aug 11 20:29:17 2011 +0200
Enable the canvas test.
Makefile_glom.am | 43 ++++++++++---------
Makefile_tests.am | 7 +++
glom/print_layout/canvas_layout_item.cc | 3 +-
.../utility_widgets/canvas/canvas_table_movable.cc | 3 +-
.../utility_widgets/canvas/test_canvas_editable.cc | 6 +-
5 files changed, 36 insertions(+), 26 deletions(-)
---
diff --git a/Makefile_glom.am b/Makefile_glom.am
index 1bc19c0..a21b94c 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -44,6 +44,28 @@ glom_eggspreadtable_files = \
glom/utility_widgets/eggspreadtablemm/private/eggspreadtablemm_p.h \
glom/utility_widgets/eggspreadtablemm/private/eggspreadtabledndmm_p.h
+glom_canvas_files = \
+ glom/utility_widgets/canvas/canvas_editable.cc \
+ glom/utility_widgets/canvas/canvas_editable.h \
+ glom/utility_widgets/canvas/canvas_group_grid.cc \
+ glom/utility_widgets/canvas/canvas_group_grid.h \
+ glom/utility_widgets/canvas/canvas_group_movable.cc \
+ glom/utility_widgets/canvas/canvas_group_movable.h \
+ glom/utility_widgets/canvas/canvas_group_resizable.cc \
+ glom/utility_widgets/canvas/canvas_group_resizable.h \
+ glom/utility_widgets/canvas/canvas_image_movable.cc \
+ glom/utility_widgets/canvas/canvas_image_movable.h \
+ glom/utility_widgets/canvas/canvas_item_movable.cc \
+ glom/utility_widgets/canvas/canvas_item_movable.h \
+ glom/utility_widgets/canvas/canvas_line_movable.cc \
+ glom/utility_widgets/canvas/canvas_line_movable.h \
+ glom/utility_widgets/canvas/canvas_rect_movable.cc \
+ glom/utility_widgets/canvas/canvas_rect_movable.h \
+ glom/utility_widgets/canvas/canvas_table_movable.cc \
+ glom/utility_widgets/canvas/canvas_table_movable.h \
+ glom/utility_widgets/canvas/canvas_text_movable.cc \
+ glom/utility_widgets/canvas/canvas_text_movable.h
+
glom_source_files = \
glom/application.cc \
glom/application.h \
@@ -230,26 +252,7 @@ glom_source_files = \
glom/utility_widgets/adddel/adddel_withbuttons.h \
glom/utility_widgets/adddel/treeviewcolumn_glom.cc \
glom/utility_widgets/adddel/treeviewcolumn_glom.h \
- glom/utility_widgets/canvas/canvas_editable.cc \
- glom/utility_widgets/canvas/canvas_editable.h \
- glom/utility_widgets/canvas/canvas_group_grid.cc \
- glom/utility_widgets/canvas/canvas_group_grid.h \
- glom/utility_widgets/canvas/canvas_group_movable.cc \
- glom/utility_widgets/canvas/canvas_group_movable.h \
- glom/utility_widgets/canvas/canvas_group_resizable.cc \
- glom/utility_widgets/canvas/canvas_group_resizable.h \
- glom/utility_widgets/canvas/canvas_image_movable.cc \
- glom/utility_widgets/canvas/canvas_image_movable.h \
- glom/utility_widgets/canvas/canvas_item_movable.cc \
- glom/utility_widgets/canvas/canvas_item_movable.h \
- glom/utility_widgets/canvas/canvas_line_movable.cc \
- glom/utility_widgets/canvas/canvas_line_movable.h \
- glom/utility_widgets/canvas/canvas_rect_movable.cc \
- glom/utility_widgets/canvas/canvas_rect_movable.h \
- glom/utility_widgets/canvas/canvas_table_movable.cc \
- glom/utility_widgets/canvas/canvas_table_movable.h \
- glom/utility_widgets/canvas/canvas_text_movable.cc \
- glom/utility_widgets/canvas/canvas_text_movable.h \
+ $(glom_canvas_files) \
glom/utility_widgets/cellrendererlist.cc \
glom/utility_widgets/cellrendererlist.h
diff --git a/Makefile_tests.am b/Makefile_tests.am
index 758156a..9df0cb5 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -134,6 +134,7 @@ if GLOM_ENABLE_UI
check_PROGRAMS += \
glom/utility_widgets/test_flowtable \
glom/utility_widgets/eggspreadtablemm/test_spreadtablednd \
+ glom/utility_widgets/canvas/test_canvas_editable \
glom/test_pyembed \
tests/test_glade_derived_instantiation \
tests/glade_toplevels_instantiation \
@@ -169,6 +170,12 @@ glom_utility_widgets_eggspreadtablemm_test_spreadtablednd_SOURCES = \
glom_utility_widgets_eggspreadtablemm_test_spreadtablednd_LDADD = $(GLOM_LIBS)
glom_utility_widgets_eggspreadtablemm_test_spreadtablednd_CPPFLAGS = $(tests_cppflags_ui)
+glom_utility_widgets_canvas_test_canvas_editable_SOURCES = \
+ $(glom_source_files) \
+ glom/utility_widgets/canvas/test_canvas_editable.cc
+glom_utility_widgets_canvas_test_canvas_editable_LDADD = $(glom_all_libs)
+glom_utility_widgets_canvas_test_canvas_editable_CPPFLAGS = $(tests_cppflags_ui)
+
# Disabled because it slows down the build, because it builds all Glom files again, using its own flags:
#glom_mode_data_test_flowtablewithfields_SOURCES = \
# $(glom_source_files) \
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index 2226563..9c66a3d 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -290,6 +290,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
//Show as many rows as can fit in the height.
double row_height = 0;
const int max_rows = get_rows_count_for_portal(portal, row_height);
+ std::cout << "DEBUG: max_rows=" << max_rows << std::endl;
const LayoutGroup::type_list_items child_items = portal->get_items();
@@ -318,7 +319,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
if(cell_as_item)
{
canvas_item->attach(cell_as_item,
- col /* left_attach */, col+1 /* right_attach */,
+ col /* left_attach */, col + 1 /* right_attach */,
row /* top_attach */, row + 1 /* right_attach */,
Gtk::FILL, (Gtk::AttachOptions)Gtk::FILL | Gtk::EXPAND);
}
diff --git a/glom/utility_widgets/canvas/canvas_table_movable.cc b/glom/utility_widgets/canvas/canvas_table_movable.cc
index e0c8f97..aad39d6 100644
--- a/glom/utility_widgets/canvas/canvas_table_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_table_movable.cc
@@ -72,12 +72,11 @@ void CanvasTableMovable::get_width_height(double& width, double& height) const
void CanvasTableMovable::set_width_height(double width, double height)
{
- std::cout << "debug: " << G_STRFUNC << ": height=" << height << std::endl;
-
if(width == -1)
{
std::cout << "debug: " << G_STRFUNC << ": width is -1" << std::endl;
}
+
property_width() = width;
property_height() = height;
}
diff --git a/glom/utility_widgets/canvas/test_canvas_editable.cc b/glom/utility_widgets/canvas/test_canvas_editable.cc
index bc77657..2003331 100644
--- a/glom/utility_widgets/canvas/test_canvas_editable.cc
+++ b/glom/utility_widgets/canvas/test_canvas_editable.cc
@@ -114,7 +114,7 @@ public:
"column", 0,
"x-fill", TRUE,
"x-expand", TRUE,
- 0);
+ (void*)0);
Glib::RefPtr<Glom::CanvasRectMovable> innerrect2 = Glom::CanvasRectMovable::create();
innerrect2->property_fill_color() = "white"; //This makes the whole area clickable, not just the outline stroke.
innerrect2->property_line_width() = 1;
@@ -126,7 +126,7 @@ public:
"column", 0,
"x-fill", TRUE,
"x-expand", TRUE,
- 0);
+ (void*)0);
add_item(table, true);
}
@@ -139,6 +139,7 @@ private:
if(m_context_menu)
m_context_menu->popup(button, activate_time);
}
+ */
void on_context_menu_edit()
{
@@ -147,7 +148,6 @@ private:
void on_context_menu_delete()
{
}
- */
void setup_context_menu()
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]