From bcb4411082ff6d76b2ecadf1f16936e25d3d8d09 Mon Sep 17 00:00:00 2001
From: Andrea Zagli <azagli@libero.it>
Date: Sat, 23 Jun 2007 07:50:56 +0000
Subject: [PATCH] Continued selection. Managed page header/footer properties.

git-svn-id: svn+ssh://saetta.homelinux.org/svn/greptool/trunk@7 76169498-11ee-428b-941f-28d7a79d5cb2
---
 data/greptool/glade/greptool.glade | 534 +++++++++++++++++++++--------
 src/canvas.c                       | 275 +++++++++++----
 src/canvas.h                       |   4 +
 src/canvasitem.c                   | 119 ++++++-
 src/canvasitem.h                   |   8 +-
 src/canvasline.c                   |  35 +-
 src/canvasrect.c                   |  19 +-
 src/canvasrect.h                   |  12 +-
 src/main.c                         |  29 ++
 src/page_properties.c              |  99 +++++-
 10 files changed, 878 insertions(+), 256 deletions(-)

diff --git a/data/greptool/glade/greptool.glade b/data/greptool/glade/greptool.glade
index 953d95c..375f442 100644
--- a/data/greptool/glade/greptool.glade
+++ b/data/greptool/glade/greptool.glade
@@ -98,7 +98,6 @@
                         <property name="label">gtk-cut</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_mnu_edit_cut_activate"/>
                       </widget>
                     </child>
                     <child>
@@ -107,7 +106,6 @@
                         <property name="label">gtk-copy</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_mnu_edit_copy_activate"/>
                       </widget>
                     </child>
                     <child>
@@ -116,7 +114,6 @@
                         <property name="label">gtk-paste</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_mnu_edit_paste_activate"/>
                       </widget>
                     </child>
                     <child>
@@ -125,7 +122,6 @@
                         <property name="label">gtk-delete</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
-                        <signal name="activate" handler="on_mnu_edit_delete_activate"/>
                       </widget>
                     </child>
                     <child>
@@ -149,6 +145,7 @@
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">_All</property>
                                 <property name="use_underline">True</property>
+                                <signal name="activate" handler="on_mnu_edit_select_all_activate"/>
                               </widget>
                             </child>
                             <child>
@@ -157,6 +154,7 @@
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="label" translatable="yes">_None</property>
                                 <property name="use_underline">True</property>
+                                <signal name="activate" handler="on_mnu_edit_select_none_activate"/>
                               </widget>
                             </child>
                           </widget>
@@ -167,7 +165,7 @@
                       <widget class="GtkMenuItem" id="mnu_edit_properties">
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="label" translatable="yes">_Properties</property>
+                        <property name="label" translatable="yes">P_roperties</property>
                         <property name="use_underline">True</property>
                         <child>
                           <widget class="GtkMenu" id="menu1">
@@ -176,7 +174,7 @@
                             <child>
                               <widget class="GtkMenuItem" id="mnu_edit_page_properties">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes">_Page</property>
+                                <property name="label" translatable="yes">_Page...</property>
                                 <property name="use_underline">True</property>
                                 <signal name="activate" handler="on_mnu_edit_page_properties_activate"/>
                               </widget>
@@ -184,7 +182,7 @@
                             <child>
                               <widget class="GtkMenuItem" id="mnu_edit_report_properties">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes">_Report</property>
+                                <property name="label" translatable="yes">_Report...</property>
                                 <property name="use_underline">True</property>
                                 <signal name="activate" handler="on_mnu_edit_report_properties_activate"/>
                               </widget>
@@ -192,7 +190,7 @@
                             <child>
                               <widget class="GtkMenuItem" id="mnu_edit_object_properties">
                                 <property name="visible">True</property>
-                                <property name="label" translatable="yes">_Object</property>
+                                <property name="label" translatable="yes">_Object...</property>
                                 <property name="use_underline">True</property>
                                 <signal name="activate" handler="on_mnu_edit_object_properties_activate"/>
                               </widget>
@@ -201,6 +199,20 @@
                         </child>
                       </widget>
                     </child>
+                    <child>
+                      <widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkMenuItem" id="mnu_edit_preferences">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="label" translatable="yes">_Preferences...</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                    </child>
                   </widget>
                 </child>
               </widget>
@@ -212,6 +224,14 @@
                 <property name="use_underline">True</property>
                 <child>
                   <widget class="GtkMenu" id="mnu_view_menu">
+                    <child>
+                      <widget class="GtkCheckMenuItem" id="mnu_view_grid">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="label" translatable="yes">_Grid</property>
+                        <property name="use_underline">True</property>
+                      </widget>
+                    </child>
                     <child>
                       <widget class="GtkCheckMenuItem" id="mnu_view_objects_tree">
                         <property name="visible">True</property>
@@ -228,9 +248,8 @@
                     <child>
                       <widget class="GtkMenuItem" id="mnu_view_xml">
                         <property name="visible">True</property>
-                        <property name="label" translatable="yes">_XML</property>
+                        <property name="label" translatable="yes">_XML...</property>
                         <property name="use_underline">True</property>
-                        <signal name="activate" handler="on_mnu_view_xml_activate"/>
                       </widget>
                     </child>
                   </widget>
@@ -463,9 +482,15 @@
     <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
     <property name="transient_for">w_main</property>
     <property name="name">GRepTool</property>
+    <property name="version">0.0.1</property>
     <property name="copyright" translatable="yes">Copyright (C) 2007 Andrea Zagli</property>
     <property name="comments" translatable="yes">Creates and manages RepTool report's definition files</property>
     <property name="website">http://reptool.sourceforge.net</property>
+    <property name="license" translatable="yes">GRepTool 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.
+
+GRepTool 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 Nautilus; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA</property>
     <property name="authors">Andrea Zagli &lt;azagli@inwind.it&gt;</property>
     <property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property>
     <property name="wrap_license">True</property>
@@ -510,40 +535,27 @@
                     <property name="column_spacing">4</property>
                     <property name="row_spacing">3</property>
                     <child>
-                      <widget class="GtkLabel" id="label7">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Provider</property>
-                      </widget>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkLabel" id="label8">
+                      <widget class="GtkEntry" id="txt_cnc_string">
                         <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Connection String</property>
+                        <property name="can_focus">True</property>
                       </widget>
                       <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="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label9">
+                      <widget class="GtkComboBox" id="cb_providers">
                         <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">SQL</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
                         <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
+                        <property name="y_options">GTK_FILL</property>
                       </packing>
                     </child>
                     <child>
@@ -566,26 +578,39 @@
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkComboBox" id="cb_providers">
+                      <widget class="GtkLabel" id="label9">
                         <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">SQL</property>
                       </widget>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                         <property name="x_options">GTK_FILL</property>
-                        <property name="y_options">GTK_FILL</property>
+                        <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkEntry" id="txt_cnc_string">
+                      <widget class="GtkLabel" id="label8">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Connection String</property>
                       </widget>
                       <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="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label7">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Provider</property>
+                      </widget>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
@@ -623,27 +648,19 @@
                     <property name="column_spacing">3</property>
                     <property name="row_spacing">3</property>
                     <child>
-                      <widget class="GtkLabel" id="label10">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Height</property>
-                      </widget>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkSpinButton" id="spn_header_height">
+                      <widget class="GtkCheckButton" id="chk_header_new_page_after">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="adjustment">1 1 10000 1 10 10</property>
-                        <property name="climb_rate">1</property>
-                        <property name="digits">2</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
                       </widget>
                       <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="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
@@ -661,18 +678,26 @@
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkCheckButton" id="chk_header_new_page_after">
+                      <widget class="GtkSpinButton" id="spn_header_height">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="response_id">0</property>
-                        <property name="draw_indicator">True</property>
+                        <property name="adjustment">1 1 10000 1 10 10</property>
+                        <property name="climb_rate">1</property>
+                        <property name="digits">2</property>
                       </widget>
                       <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>
+                    <child>
+                      <widget class="GtkLabel" id="label10">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Height</property>
+                      </widget>
+                      <packing>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
@@ -719,27 +744,19 @@
                     <property name="column_spacing">3</property>
                     <property name="row_spacing">3</property>
                     <child>
-                      <widget class="GtkLabel" id="label12">
-                        <property name="visible">True</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Height</property>
-                      </widget>
-                      <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
-                      </packing>
-                    </child>
-                    <child>
-                      <widget class="GtkSpinButton" id="spn_footer_height">
+                      <widget class="GtkCheckButton" id="chk_footer_new_page_before">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="adjustment">1 1 10000 1 10 10</property>
-                        <property name="climb_rate">1</property>
-                        <property name="digits">2</property>
+                        <property name="use_underline">True</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
                       </widget>
                       <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="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
@@ -757,18 +774,26 @@
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkCheckButton" id="chk_footer_new_page_before">
+                      <widget class="GtkSpinButton" id="spn_footer_height">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="response_id">0</property>
-                        <property name="draw_indicator">True</property>
+                        <property name="adjustment">1 1 10000 1 10 10</property>
+                        <property name="climb_rate">1</property>
+                        <property name="digits">2</property>
                       </widget>
                       <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>
+                    <child>
+                      <widget class="GtkLabel" id="label12">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Height</property>
+                      </widget>
+                      <packing>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
@@ -842,6 +867,7 @@
   <widget class="GtkWindow" id="w_page_properties">
     <property name="visible">True</property>
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+    <property name="border_width">3</property>
     <property name="title" translatable="yes">GRepTool - Page Properties</property>
     <property name="modal">True</property>
     <property name="default_width">300</property>
@@ -872,35 +898,32 @@
                     <property name="column_spacing">3</property>
                     <property name="row_spacing">3</property>
                     <child>
-                      <widget class="GtkLabel" id="label3">
+                      <widget class="GtkComboBox" id="cb_size_type">
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Width</property>
+                        <property name="items" translatable="yes">A4
+Custom</property>
+                        <signal name="changed" handler="page_properties_on_cb_size_type_changed"/>
                       </widget>
                       <packing>
-                        <property name="top_attach">1</property>
-                        <property name="bottom_attach">2</property>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label5">
+                      <widget class="GtkLabel" id="label17">
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Height</property>
+                        <property name="label" translatable="yes">Type</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkSpinButton" id="spn_width">
+                      <widget class="GtkSpinButton" id="spn_height">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -910,11 +933,12 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">1</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkSpinButton" id="spn_height">
+                      <widget class="GtkSpinButton" id="spn_width">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -924,33 +948,35 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="top_attach">1</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label17">
+                      <widget class="GtkLabel" id="label5">
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Type</property>
+                        <property name="label" translatable="yes">Height</property>
                       </widget>
                       <packing>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkComboBox" id="cb_size_type">
+                      <widget class="GtkLabel" id="label3">
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="items" translatable="yes">A4
-Custom</property>
-                        <signal name="changed" handler="page_properties_on_cb_size_type_changed"/>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Width</property>
                       </widget>
                       <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="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
                       </packing>
                     </child>
                   </widget>
@@ -993,27 +1019,73 @@ Custom</property>
                     <property name="column_spacing">3</property>
                     <property name="row_spacing">3</property>
                     <child>
-                      <widget class="GtkLabel" id="label6">
+                      <widget class="GtkSpinButton" id="spn_margin_left">
                         <property name="visible">True</property>
+                        <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Top</property>
+                        <property name="adjustment">0 0 10000 1 10 10</property>
+                        <property name="digits">2</property>
                       </widget>
                       <packing>
-                        <property name="x_options">GTK_FILL</property>
-                        <property name="y_options"></property>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label14">
+                      <widget class="GtkSpinButton" id="spn_margin_bottom">
                         <property name="visible">True</property>
+                        <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Right</property>
+                        <property name="adjustment">0 0 10000 1 10 10</property>
+                        <property name="digits">2</property>
                       </widget>
                       <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkSpinButton" id="spn_margin_right">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="adjustment">0 0 10000 1 10 10</property>
+                        <property name="digits">2</property>
+                      </widget>
+                      <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>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkSpinButton" id="spn_margin_top">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="adjustment">0 0 10000 1 10 10</property>
+                        <property name="digits">2</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label16">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Left</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">3</property>
+                        <property name="bottom_attach">4</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
@@ -1033,21 +1105,79 @@ Custom</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkLabel" id="label16">
+                      <widget class="GtkLabel" id="label14">
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="xalign">0</property>
-                        <property name="label" translatable="yes">Left</property>
+                        <property name="label" translatable="yes">Right</property>
                       </widget>
                       <packing>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
                         <property name="x_options">GTK_FILL</property>
                         <property name="y_options"></property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkSpinButton" id="spn_margin_top">
+                      <widget class="GtkLabel" id="label6">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Top</property>
+                      </widget>
+                      <packing>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options"></property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label" translatable="yes">Margins</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkFrame" id="frame6">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">GTK_SHADOW_NONE</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment6">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <widget class="GtkTable" id="table6">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="n_rows">2</property>
+                    <property name="n_columns">4</property>
+                    <child>
+                      <widget class="GtkLabel" id="label18">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Height</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkSpinButton" id="spn_header_height">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -1056,16 +1186,42 @@ Custom</property>
                       </widget>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
+                        <property name="right_attach">4</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkSpinButton" id="spn_margin_right">
+                      <widget class="GtkLabel" id="label19">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">On First Page</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label20">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">On Last Page</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="chk_header_first_page">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="adjustment">0 0 10000 1 10 10</property>
-                        <property name="digits">2</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
                       </widget>
                       <packing>
                         <property name="left_attach">1</property>
@@ -1075,7 +1231,70 @@ Custom</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkSpinButton" id="spn_margin_bottom">
+                      <widget class="GtkCheckButton" id="chk_header_last_page">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">3</property>
+                        <property name="right_attach">4</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkCheckButton" id="chk_header">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label" translatable="yes">Header</property>
+                <property name="response_id">0</property>
+                <property name="draw_indicator">True</property>
+                <signal name="toggled" handler="page_properties_on_chk_header_toggled"/>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkFrame" id="frame7">
+            <property name="visible">True</property>
+            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">GTK_SHADOW_NONE</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment7">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <widget class="GtkTable" id="table8">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="n_rows">2</property>
+                    <property name="n_columns">4</property>
+                    <child>
+                      <widget class="GtkLabel" id="label24">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Height</property>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkSpinButton" id="spn_footer_height">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -1084,24 +1303,63 @@ Custom</property>
                       </widget>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
-                        <property name="top_attach">2</property>
-                        <property name="bottom_attach">3</property>
+                        <property name="right_attach">4</property>
                       </packing>
                     </child>
                     <child>
-                      <widget class="GtkSpinButton" id="spn_margin_left">
+                      <widget class="GtkLabel" id="label25">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">On First Page</property>
+                      </widget>
+                      <packing>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label26">
+                        <property name="visible">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">On Last Page</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="chk_footer_first_page">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                        <property name="adjustment">0 0 10000 1 10 10</property>
-                        <property name="digits">2</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
                       </widget>
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="right_attach">2</property>
-                        <property name="top_attach">3</property>
-                        <property name="bottom_attach">4</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="chk_footer_last_page">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="left_attach">3</property>
+                        <property name="right_attach">4</property>
+                        <property name="top_attach">1</property>
+                        <property name="bottom_attach">2</property>
                       </packing>
                     </child>
                   </widget>
@@ -1109,11 +1367,14 @@ Custom</property>
               </widget>
             </child>
             <child>
-              <widget class="GtkLabel" id="label2">
+              <widget class="GtkCheckButton" id="chk_footer">
                 <property name="visible">True</property>
+                <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label" translatable="yes">Margins</property>
-                <property name="use_markup">True</property>
+                <property name="label" translatable="yes">Footer</property>
+                <property name="response_id">0</property>
+                <property name="draw_indicator">True</property>
+                <signal name="toggled" handler="page_properties_on_chk_footer_toggled"/>
               </widget>
               <packing>
                 <property name="type">label_item</property>
@@ -1121,8 +1382,7 @@ Custom</property>
             </child>
           </widget>
           <packing>
-            <property name="expand">False</property>
-            <property name="position">1</property>
+            <property name="position">3</property>
           </packing>
         </child>
         <child>
@@ -1162,7 +1422,7 @@ Custom</property>
           </widget>
           <packing>
             <property name="expand">False</property>
-            <property name="position">2</property>
+            <property name="position">4</property>
           </packing>
         </child>
       </widget>
diff --git a/src/canvas.c b/src/canvas.c
index 0923ce4..070e07b 100644
--- a/src/canvas.c
+++ b/src/canvas.c
@@ -50,6 +50,7 @@ struct _GRptCanvasPrivate
 		GList *report_footer_objects;
 		GList *page_footer_objects;
 
+		gboolean in_selection;
 		gdouble sel_x_start;
 		gdouble sel_y_start;
 
@@ -116,6 +117,9 @@ grpt_canvas_class_init (GRptCanvasClass *klass)
 static void
 grpt_canvas_init (GRptCanvas *grpt_canvas)
 {
+	GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE (grpt_canvas);
+
+	priv->in_selection = FALSE;
 }
 
 static void
@@ -129,14 +133,10 @@ grpt_canvas_add_object (GRptCanvas *grpt_canvas, RptReportSection section, Tool
 	GRptCanvasItem *item;
 
 	RptPoint position;
-	RptSize size;
 
 	position.x = x;
 	position.y = y;
 
-	size.width = width;
-	size.height = height;
-
 	switch (tool)
 		{
 			case TOOL_LINE:
@@ -144,15 +144,11 @@ grpt_canvas_add_object (GRptCanvas *grpt_canvas, RptReportSection section, Tool
 					rpt_object = rpt_obj_line_new (get_new_object_name (priv->tool), position);
 					rpt_report_add_object_to_section (priv->rpt_report, rpt_object, RPTREPORT_SECTION_BODY);
 
-					g_object_set (G_OBJECT (rpt_object),
-					              "size", &size,
-					              NULL);
-
 					item = grpt_canvas_line_new (priv->root,
-							                x, y,
-									        width, height,
-					                        RPT_OBJ_LINE (rpt_object),
-					                        NULL);
+							                     x, y,
+									             width, height,
+					                             RPT_OBJ_LINE (rpt_object),
+					                             NULL);
 					
 				}
 				break;
@@ -162,15 +158,11 @@ grpt_canvas_add_object (GRptCanvas *grpt_canvas, RptReportSection section, Tool
 					rpt_object = rpt_obj_rect_new (get_new_object_name (priv->tool), position);
 					rpt_report_add_object_to_section (priv->rpt_report, rpt_object, RPTREPORT_SECTION_BODY);
 
-					g_object_set (G_OBJECT (rpt_object),
-					              "size", &size,
-					              NULL);
-
 					item = grpt_canvas_rect_new (priv->root,
-							                x, y,
-									        width, height,
-					                        RPT_OBJ_RECT (rpt_object),
-					                        NULL);
+							                     x, y,
+									             width, height,
+					                             RPT_OBJ_RECT (rpt_object),
+					                             NULL);
 				}
 				break;
 
@@ -198,16 +190,49 @@ grpt_canvas_on_button_press_event (GtkWidget *widget,
 		{
 			priv->tool = get_current_tool ();
 
-			priv->sel_x_start = event->x;
-			priv->sel_y_start = event->y;
-
-			g_object_set (G_OBJECT (priv->selection),
-			              "x", priv->sel_x_start,
-			              "y", priv->sel_y_start,
-			              "width", 0.0,
-			              "height", 0.0,
-			              "visibility", GOO_CANVAS_ITEM_VISIBLE,
-						  NULL);
+			if (priv->tool == TOOL_SELECT)
+				{
+					/* moving selected items */
+					GooCanvasItem *item = goo_canvas_get_item_at (GOO_CANVAS (priv->goo_canvas),
+					                                              event->x, event->y,
+					                                              FALSE);
+					if (item != NULL && item != priv->selection)
+						{
+							if (!grpt_canvas_item_is_selected (GRPT_CANVAS_ITEM (item)))
+								{
+									grpt_canvas_item_set_selected (GRPT_CANVAS_ITEM (item), TRUE);
+								}
+						}
+					else
+						{
+							priv->in_selection = TRUE;
+							priv->sel_x_start = event->x;
+							priv->sel_y_start = event->y;
+
+							g_object_set (G_OBJECT (priv->selection),
+										  "x", priv->sel_x_start,
+										  "y", priv->sel_y_start,
+										  "width", 0.0,
+										  "height", 0.0,
+										  "visibility", GOO_CANVAS_ITEM_VISIBLE,
+										  NULL);
+						}
+				}
+			else
+				{
+					/* TO DO */
+							priv->in_selection = TRUE;
+							priv->sel_x_start = event->x;
+							priv->sel_y_start = event->y;
+
+							g_object_set (G_OBJECT (priv->selection),
+										  "x", priv->sel_x_start,
+										  "y", priv->sel_y_start,
+										  "width", 0.0,
+										  "height", 0.0,
+										  "visibility", GOO_CANVAS_ITEM_VISIBLE,
+										  NULL);
+				}
 		}
 
 	return FALSE;
@@ -254,13 +279,16 @@ grpt_canvas_on_button_release_event (GtkWidget *widget,
 
 			if (priv->tool != TOOL_SELECT)
 				{
-					grpt_canvas_add_object ((GRptCanvas *)user_data, RPTREPORT_SECTION_BODY, priv->tool, x, y, width, height);
+					if (width != 0 || height != 0)
+						{
+							grpt_canvas_add_object ((GRptCanvas *)user_data, RPTREPORT_SECTION_BODY, priv->tool, x, y, width, height);
+						}
 				}
 			else
 				{
 					GooCanvasBounds bound;
 					GList *objects;
-					GooCanvasItemSimple *item;
+					GooCanvasItem *item;
 
 					bound.x1 = x;
 					bound.y1 = y;
@@ -276,14 +304,19 @@ grpt_canvas_on_button_release_event (GtkWidget *widget,
 						}
 					while (objects != NULL)
 						{
-							item = (GooCanvasItemSimple *)objects->data;
+							item = (GooCanvasItem *)objects->data;
 
-							grpt_canvas_item_set_selected (GRPT_CANVAS_ITEM (item), TRUE);
+							if (item != priv->selection)
+								{
+									grpt_canvas_item_set_selected (GRPT_CANVAS_ITEM (item), TRUE);
+								}
 
 							objects = g_list_next (objects);
 						}
 					g_list_free (objects);
 				}
+
+			priv->in_selection = FALSE;
 		}
 
 	return FALSE;
@@ -291,8 +324,8 @@ grpt_canvas_on_button_release_event (GtkWidget *widget,
 
 static gboolean
 grpt_canvas_on_motion_notify_event (GtkWidget *widget,
-                               GdkEventMotion *event,
-                               gpointer user_data)
+                                    GdkEventMotion *event,
+                                    gpointer user_data)
 {
 	gint x;
 	gint y;
@@ -313,42 +346,71 @@ grpt_canvas_on_motion_notify_event (GtkWidget *widget,
 
 	if (state & GDK_BUTTON1_MASK)
 		{
-			gdouble width;
-			gdouble height;
-
-			if (x < priv->sel_x_start)
-				{
-					g_object_set (G_OBJECT (priv->selection),
-								  "x", (gdouble)x,
-								  NULL);
-					width = priv->sel_x_start - x;
-				}
-			else
-				{
-					g_object_set (G_OBJECT (priv->selection),
-								  "x", priv->sel_x_start,
-								  NULL);
-					width = x - priv->sel_x_start;
-				}
-			if (y < priv->sel_y_start)
+			if (priv->in_selection)
 				{
+					gdouble width;
+					gdouble height;
+		
+					if (x < priv->sel_x_start)
+						{
+							g_object_set (G_OBJECT (priv->selection),
+										  "x", (gdouble)x,
+										  NULL);
+							width = priv->sel_x_start - x;
+						}
+					else
+						{
+							g_object_set (G_OBJECT (priv->selection),
+										  "x", priv->sel_x_start,
+										  NULL);
+							width = x - priv->sel_x_start;
+						}
+					if (y < priv->sel_y_start)
+						{
+							g_object_set (G_OBJECT (priv->selection),
+										  "y", (gdouble)y,
+										  NULL);
+							height = priv->sel_y_start - y;
+						}
+					else
+						{
+							g_object_set (G_OBJECT (priv->selection),
+										  "y", priv->sel_y_start,
+										  NULL);
+							height = y - priv->sel_y_start;
+						}
+		
 					g_object_set (G_OBJECT (priv->selection),
-								  "y", (gdouble)y,
+								  "width", width,
+								  "height", height,
 								  NULL);
-					height = priv->sel_y_start - y;
 				}
 			else
 				{
-					g_object_set (G_OBJECT (priv->selection),
-								  "y", priv->sel_y_start,
-								  NULL);
-					height = y - priv->sel_y_start;
-				}
+					/* moving selected items */
+					GList *items;
+					GRptCanvasItem *item;
+					RptPoint *position;
 
-			g_object_set (G_OBJECT (priv->selection),
-			              "width", width,
-			              "height", height,
-			              NULL);
+					items = grpt_canvas_get_selected_items ((GRptCanvas *)user_data);
+					if (items != NULL)
+						{
+							items = g_list_first (items);
+						}
+					while (items != NULL)
+						{
+							item = (GRptCanvasItem *)items->data;
+						
+							position = grpt_canvas_item_get_position (item);
+
+							position->x += (x - position->x);
+							position->y += (y - position->y);
+
+							grpt_canvas_item_set_position (item, *position);
+
+							items = g_list_next (items);
+						}
+				}
 		}
 	
 	return FALSE;
@@ -499,23 +561,23 @@ grpt_canvas_select_section_all (GRptCanvas *grpt_canvas, RptReportSection sectio
 	switch (section)
 		{
 			case RPTREPORT_SECTION_REPORT_HEADER:
-				objects = g_list_copy (priv->report_header_objects);
+				objects = priv->report_header_objects;
 				break;
 
 			case RPTREPORT_SECTION_PAGE_HEADER:
-				objects = g_list_copy (priv->page_header_objects);
+				objects = priv->page_header_objects;
 				break;
 
 			case RPTREPORT_SECTION_BODY:
-				objects = g_list_copy (priv->body_objects);
+				objects = priv->body_objects;
 				break;
 
 			case RPTREPORT_SECTION_REPORT_FOOTER:
-				objects = g_list_copy (priv->report_footer_objects);
+				objects = priv->report_footer_objects;
 				break;
 
 			case RPTREPORT_SECTION_PAGE_FOOTER:
-				objects = g_list_copy (priv->page_footer_objects);
+				objects = priv->page_footer_objects;
 				break;
 		}
 
@@ -540,23 +602,23 @@ grpt_canvas_select_section_none (GRptCanvas *grpt_canvas, RptReportSection secti
 	switch (section)
 		{
 			case RPTREPORT_SECTION_REPORT_HEADER:
-				objects = g_list_copy (priv->report_header_objects);
+				objects = priv->report_header_objects;
 				break;
 
 			case RPTREPORT_SECTION_PAGE_HEADER:
-				objects = g_list_copy (priv->page_header_objects);
+				objects = priv->page_header_objects;
 				break;
 
 			case RPTREPORT_SECTION_BODY:
-				objects = g_list_copy (priv->body_objects);
+				objects = priv->body_objects;
 				break;
 
 			case RPTREPORT_SECTION_REPORT_FOOTER:
-				objects = g_list_copy (priv->report_footer_objects);
+				objects = priv->report_footer_objects;
 				break;
 
 			case RPTREPORT_SECTION_PAGE_FOOTER:
-				objects = g_list_copy (priv->page_footer_objects);
+				objects = priv->page_footer_objects;
 				break;
 		}
 
@@ -571,6 +633,69 @@ grpt_canvas_select_section_none (GRptCanvas *grpt_canvas, RptReportSection secti
 		}
 }
 
+GList
+*grpt_canvas_get_selected_items (GRptCanvas *grpt_canvas)
+{
+	GList *ret = NULL;
+
+	ret = g_list_concat (ret, grpt_canvas_get_section_selected_items (grpt_canvas, RPTREPORT_SECTION_REPORT_HEADER));
+	ret = g_list_concat (ret, grpt_canvas_get_section_selected_items (grpt_canvas, RPTREPORT_SECTION_PAGE_HEADER));
+	ret = g_list_concat (ret, grpt_canvas_get_section_selected_items (grpt_canvas, RPTREPORT_SECTION_BODY));
+	ret = g_list_concat (ret, grpt_canvas_get_section_selected_items (grpt_canvas, RPTREPORT_SECTION_REPORT_FOOTER));
+	ret = g_list_concat (ret, grpt_canvas_get_section_selected_items (grpt_canvas, RPTREPORT_SECTION_PAGE_FOOTER));
+
+	return ret;
+}
+
+GList
+*grpt_canvas_get_section_selected_items (GRptCanvas *grpt_canvas,
+                                         RptReportSection section)
+{
+	GList *objects = NULL;
+	GList *ret = NULL;
+
+	GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE (grpt_canvas);
+
+	switch (section)
+		{
+			case RPTREPORT_SECTION_REPORT_HEADER:
+				objects = priv->report_header_objects;
+				break;
+
+			case RPTREPORT_SECTION_PAGE_HEADER:
+				objects = priv->page_header_objects;
+				break;
+
+			case RPTREPORT_SECTION_BODY:
+				objects = priv->body_objects;
+				break;
+
+			case RPTREPORT_SECTION_REPORT_FOOTER:
+				objects = priv->report_footer_objects;
+				break;
+
+			case RPTREPORT_SECTION_PAGE_FOOTER:
+				objects = priv->page_footer_objects;
+				break;
+		}
+
+	if (objects != NULL)
+		{
+			objects = g_list_first (objects);
+		}
+	while (objects != NULL)
+		{
+			if (grpt_canvas_item_is_selected ((GRptCanvasItem *)objects->data))
+				{
+					ret = g_list_append (ret, objects->data);
+				}
+			
+			objects = g_list_next (objects);
+		}
+
+	return ret;
+}
+
 void
 grpt_canvas_free (GRptCanvas *grpt_canvas)
 {
diff --git a/src/canvas.h b/src/canvas.h
index 2548c53..e138cb2 100644
--- a/src/canvas.h
+++ b/src/canvas.h
@@ -76,6 +76,10 @@ void grpt_canvas_select_section_all (GRptCanvas *grpt_canvas,
 void grpt_canvas_select_section_none (GRptCanvas *grpt_canvas,
                                       RptReportSection section);
 
+GList *grpt_canvas_get_selected_items (GRptCanvas *grpt_canvas);
+GList *grpt_canvas_get_section_selected_items (GRptCanvas *grpt_canvas,
+                                               RptReportSection section);
+
 void grpt_canvas_free (GRptCanvas *grpt_canvas);
 
 
diff --git a/src/canvasitem.c b/src/canvasitem.c
index f43da85..862f143 100644
--- a/src/canvasitem.c
+++ b/src/canvasitem.c
@@ -40,6 +40,11 @@ static gboolean grpt_canvas_item_is_item_at (GooCanvasItemSimple *simple,
 typedef struct _GRptCanvasItemPrivate GRptCanvasItemPrivate;
 struct _GRptCanvasItemPrivate
 	{
+		gdouble x;
+		gdouble y;
+		gdouble width;
+		gdouble height;
+
 		RptReportSection section;
 
 		gboolean selected;
@@ -91,10 +96,10 @@ grpt_canvas_item_init (GRptCanvasItem *grpt_canvas_item)
 {
 	GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
 
-	grpt_canvas_item->x = 0.0;
-	grpt_canvas_item->y = 0.0;
-	grpt_canvas_item->width = 0.0;
-	grpt_canvas_item->height = 0.0;
+	priv->x = 0.0;
+	priv->y = 0.0;
+	priv->width = 0.0;
+	priv->height = 0.0;
 
 	priv->selected = FALSE;
 }
@@ -104,16 +109,17 @@ GooCanvasItem
 {
 	GooCanvasItem *item;
 	GRptCanvasItem *grpt_canvas_item;
+	GRptCanvasItemPrivate *priv;
+	RptPoint position;
+	RptSize size;
+
 	const char *first_property;
 	va_list var_args;
 
 	item = g_object_new (GRPT_TYPE_CANVAS_ITEM, NULL);
 
 	grpt_canvas_item = (GRptCanvasItem *)item;
-	grpt_canvas_item->x = x;
-	grpt_canvas_item->y = y;
-	grpt_canvas_item->width = width;
-	grpt_canvas_item->height = height;
+	priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
 
 	va_start (var_args, height);
 	first_property = va_arg (var_args, char*);
@@ -129,9 +135,89 @@ GooCanvasItem
 			g_object_unref (item);
 		}
 
+	position.x = x;
+	position.y = y;
+	grpt_canvas_item_set_position (grpt_canvas_item, position);
+
+	size.width = width;
+	size.height = height;
+	grpt_canvas_item_set_size (grpt_canvas_item, size);
+
 	return item;
 }
 
+RptPoint
+*grpt_canvas_item_get_position (GRptCanvasItem *grpt_canvas_item)
+{
+	RptPoint *position = NULL;
+	RptObject *rpto;
+
+	rpto = grpt_canvas_item_get_rpt_object (grpt_canvas_item);
+
+	g_object_get (G_OBJECT (rpto),
+	              "position", &position,
+	              NULL);
+
+	return position;
+}
+
+void
+grpt_canvas_item_set_position (GRptCanvasItem *grpt_canvas_item, RptPoint position)
+{
+	GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
+
+	GooCanvasItemSimple *simple = (GooCanvasItemSimple *)grpt_canvas_item;
+
+	RptObject *rpto;
+
+	priv->x = position.x;
+	priv->y = position.y;
+
+	rpto = grpt_canvas_item_get_rpt_object (grpt_canvas_item);
+
+	g_object_set (G_OBJECT (rpto),
+	              "position", &position,
+	              NULL);
+
+	goo_canvas_item_simple_changed (simple, TRUE);
+}
+
+RptSize
+*grpt_canvas_item_get_size (GRptCanvasItem *grpt_canvas_item)
+{
+	RptSize *size = NULL;
+	RptObject *rpto;
+
+	rpto = grpt_canvas_item_get_rpt_object (grpt_canvas_item);
+
+	g_object_get (G_OBJECT (rpto),
+	              "size", &size,
+	              NULL);
+
+	return size;
+}
+
+void
+grpt_canvas_item_set_size (GRptCanvasItem *grpt_canvas_item, RptSize size)
+{
+	GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
+
+	RptObject *rpto;
+
+	GooCanvasItemSimple *simple = (GooCanvasItemSimple *)grpt_canvas_item;
+
+	priv->width = size.width;
+	priv->height = size.height;
+
+	rpto = grpt_canvas_item_get_rpt_object (grpt_canvas_item);
+
+	g_object_set (G_OBJECT (rpto),
+	              "size", &size,
+	              NULL);
+
+	goo_canvas_item_simple_changed (simple, TRUE);
+}
+
 RptObject
 *grpt_canvas_item_get_rpt_object (GRptCanvasItem *grpt_canvas_item)
 {
@@ -174,18 +260,22 @@ grpt_canvas_item_set_selected (GRptCanvasItem *grpt_canvas_item, gboolean select
 {
 	GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
 
+	GooCanvasItemSimple *simple = (GooCanvasItemSimple *)grpt_canvas_item;
+
 	priv->selected = selected;
+	goo_canvas_request_redraw (simple->canvas, &simple->bounds);
 }
 
 static void
 grpt_canvas_item_update (GooCanvasItemSimple *simple, cairo_t *cr)
 {
 	GRptCanvasItem *grpt_canvas_item = (GRptCanvasItem *)simple;
+	GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
 
-	simple->bounds.x1 = grpt_canvas_item->x;
-	simple->bounds.y1 = grpt_canvas_item->y;
-	simple->bounds.x2 = grpt_canvas_item->x + grpt_canvas_item->width;
-	simple->bounds.y2 = grpt_canvas_item->y + grpt_canvas_item->height;
+	simple->bounds.x1 = priv->x;
+	simple->bounds.y1 = priv->y;
+	simple->bounds.x2 = priv->x + priv->width;
+	simple->bounds.y2 = priv->y + priv->height;
 }
 
 static void
@@ -210,9 +300,10 @@ static gboolean
 grpt_canvas_item_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event)
 {
 	GRptCanvasItem *grpt_canvas_item = (GRptCanvasItem *)simple;
+	GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
 
-	if (x < grpt_canvas_item->x || x > grpt_canvas_item->x + grpt_canvas_item->width
-	    || y < grpt_canvas_item->y || y > grpt_canvas_item->y + grpt_canvas_item->height)
+	if (x < priv->x || x > priv->x + priv->width
+	    || y < priv->y || y > priv->y + priv->height)
 		{
 			return FALSE;
 		}
diff --git a/src/canvasitem.h b/src/canvasitem.h
index 7eeeec5..8fb0319 100644
--- a/src/canvasitem.h
+++ b/src/canvasitem.h
@@ -41,8 +41,6 @@ typedef struct _GRptCanvasItemClass GRptCanvasItemClass;
 struct _GRptCanvasItem
 {
 	GooCanvasItemSimple parent;
-
-	gdouble x, y, width, height;
 };
 
 struct _GRptCanvasItemClass
@@ -65,6 +63,12 @@ GooCanvasItem *grpt_canvas_item_new (GooCanvasItem *parent,
                                      gdouble height,
                                      ...);
 
+RptPoint *grpt_canvas_item_get_position (GRptCanvasItem *grpt_canvas_item);
+void grpt_canvas_item_set_position (GRptCanvasItem *grpt_canvas_item, RptPoint position);
+
+RptSize *grpt_canvas_item_get_size (GRptCanvasItem *grpt_canvas_item);
+void grpt_canvas_item_set_size (GRptCanvasItem *grpt_canvas_item, RptSize size);
+
 RptObject *grpt_canvas_item_get_rpt_object (GRptCanvasItem *grpt_canvas_item);
 
 RptReportSection grpt_canvas_item_get_section (GRptCanvasItem *grpt_canvas_item);
diff --git a/src/canvasline.c b/src/canvasline.c
index d8cddb9..e0106a5 100644
--- a/src/canvasline.c
+++ b/src/canvasline.c
@@ -90,15 +90,15 @@ GRptCanvasItem
 {
 	GRptCanvasItem *item;
 	GRptCanvasLine *grpt_canvas_line;
+
+	RptPoint position;
+	RptSize size;
+
 	const char *first_property;
 	va_list var_args;
 	GRptCanvasLinePrivate *priv;
 
 	item = g_object_new (GRPT_TYPE_CANVAS_LINE, NULL);
-	item->x = x;
-	item->y = y;
-	item->width = width;
-	item->height = height;
 
 	grpt_canvas_line = (GRptCanvasLine *)item;
 
@@ -119,14 +119,23 @@ GRptCanvasItem
 			g_object_unref (item);
 		}
 
+	position.x = x;
+	position.y = y;
+	grpt_canvas_item_set_position (item, position);
+
+	size.width = width;
+	size.height = height;
+	grpt_canvas_item_set_size (item, size);
+
 	return item;
 }
 
 static void
 grpt_canvas_line_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds)
 {
-	RptPoint from_p;
-	RptPoint to_p;
+	RptPoint *from_p;
+	RptPoint *to_p = (RptPoint *)g_new (RptPoint, 1);
+	RptSize *size;
 	RptRotation *rotation = NULL;
 	RptStroke *stroke = NULL;
 
@@ -136,16 +145,16 @@ grpt_canvas_line_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanva
 
 	GRptCanvasLinePrivate *priv = GRPT_CANVAS_LINE_GET_PRIVATE (grpt_canvas_line);
 
-	from_p.x = grpt_canvas_item->x;
-	from_p.y = grpt_canvas_item->y;
-	to_p.x = grpt_canvas_item->x + grpt_canvas_item->width;
-	to_p.y = grpt_canvas_item->y + grpt_canvas_item->height;
-
 	g_object_get (G_OBJECT (priv->rpt_object_line),
+	              "position", &from_p,
+	              "size", &size,
 	              "rotation", &rotation,
 	              "stroke", &stroke,
 	              NULL);
 
+	to_p->x = from_p->x + size->width;
+	to_p->y = from_p->y + size->height;
+
 	if (stroke != NULL)
 		{
 			/* TO DO */
@@ -175,8 +184,8 @@ grpt_canvas_line_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanva
 			rpt_print_rotate (rpt_print, from_p, &size, rotation->angle);*/
 		}
 
-	cairo_move_to (cr, from_p.x, from_p.y);
-	cairo_line_to (cr, to_p.x, to_p.y);
+	cairo_move_to (cr, from_p->x, from_p->y);
+	cairo_line_to (cr, to_p->x, to_p->y);
 	cairo_stroke (cr);
 
 	if (stroke != NULL && stroke->style != NULL)
diff --git a/src/canvasrect.c b/src/canvasrect.c
index bc07561..a0e4137 100644
--- a/src/canvasrect.c
+++ b/src/canvasrect.c
@@ -76,8 +76,7 @@ grpt_canvas_rect_class_init (GRptCanvasRectClass *klass)
 
 	g_type_class_add_private (object_class, sizeof (GRptCanvasRectPrivate));
 
-	simple_class->simple_paint = grpt_canvas_rect_paint;
-
+	canvas_item_class->paint = grpt_canvas_rect_paint;
 	canvas_item_class->get_rpt_object = grpt_canvas_rect_get_rpt_object;
 }
 
@@ -91,15 +90,15 @@ GRptCanvasItem
 {
 	GRptCanvasItem *item;
 	GRptCanvasRect *grpt_canvas_rect;
+
+	RptPoint position;
+	RptSize size;
+
 	const char *first_property;
 	va_list var_args;
 	GRptCanvasRectPrivate *priv;
 
 	item = g_object_new (GRPT_TYPE_CANVAS_RECT, NULL);
-	item->x = x;
-	item->y = y;
-	item->width = width;
-	item->height = height;
 
 	grpt_canvas_rect = (GRptCanvasRect *)item;
 
@@ -120,6 +119,14 @@ GRptCanvasItem
 			g_object_unref (item);
 		}
 
+	position.x = x;
+	position.y = y;
+	grpt_canvas_item_set_position (item, position);
+
+	size.width = width;
+	size.height = height;
+	grpt_canvas_item_set_size (item, size);
+
 	return item;
 }
 
diff --git a/src/canvasrect.h b/src/canvasrect.h
index e03063a..9feedfd 100644
--- a/src/canvasrect.h
+++ b/src/canvasrect.h
@@ -52,12 +52,12 @@ struct _GRptCanvasRectClass
 GType grpt_canvas_rect_get_type (void) G_GNUC_CONST;
 
 GRptCanvasItem *grpt_canvas_rect_new (GooCanvasItem *parent,
-                                     gdouble x,
-                                     gdouble y,
-                                     gdouble width,
-                                     gdouble height,
-                                     RptObjRect *rpt_object_rect,
-                                     ...);
+                                      gdouble x,
+                                      gdouble y,
+                                      gdouble width,
+                                      gdouble height,
+                                      RptObjRect *rpt_object_rect,
+                                      ...);
 
 
 G_END_DECLS
diff --git a/src/main.c b/src/main.c
index c1029b8..68e579e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,8 +42,11 @@ void report_on_canvas_object_removed (GRptCanvas *grpt_canvas,
 static gchar *report_filename;
 static RptReport *rpt_report;
 
+static gint text_counter = 0;
 static gint line_counter = 0;
 static gint rect_counter = 0;
+static gint ellipse_counter = 0;
+static gint image_counter = 0;
 
 static GtkWidget *w;
 static GtkWidget *vbox;
@@ -285,6 +288,20 @@ on_mnu_file_close_activate (GtkMenuItem *menuitem,
 	gtk_window_set_title (GTK_WINDOW (w), "GRepTool");
 }
 
+void
+on_mnu_edit_select_all_activate (GtkMenuItem *menuitem,
+                                 gpointer user_data)
+{
+	grpt_canvas_select_section_all (grpt_canvas, RPTREPORT_SECTION_BODY, FALSE);
+}
+
+void
+on_mnu_edit_select_none_activate (GtkMenuItem *menuitem,
+                                  gpointer user_data)
+{
+	grpt_canvas_select_section_none (grpt_canvas, RPTREPORT_SECTION_BODY);
+}
+
 void
 on_mnu_edit_report_properties_activate (GtkMenuItem *menuitem,
                                         gpointer user_data)
@@ -412,6 +429,10 @@ const gchar
 
 	switch (tool)
 		{
+			case TOOL_TEXT:
+				ret = g_strdup_printf ("text%d", ++text_counter);
+				break;
+
 			case TOOL_LINE:
 				ret = g_strdup_printf ("line%d", ++line_counter);
 				break;
@@ -419,6 +440,14 @@ const gchar
 			case TOOL_RECT:
 				ret = g_strdup_printf ("rect%d", ++rect_counter);
 				break;
+
+			case TOOL_ELLIPSE:
+				ret = g_strdup_printf ("ellipse%d", ++ellipse_counter);
+				break;
+
+			case TOOL_IMAGE:
+				ret = g_strdup_printf ("image%d", ++image_counter);
+				break;
 		}
 
 	return ret;
diff --git a/src/page_properties.c b/src/page_properties.c
index 6eb9a59..c227f0f 100644
--- a/src/page_properties.c
+++ b/src/page_properties.c
@@ -30,9 +30,17 @@ static GtkWidget *spn_margin_top;
 static GtkWidget *spn_margin_right;
 static GtkWidget *spn_margin_bottom;
 static GtkWidget *spn_margin_left;
+static GtkWidget *chk_header;
+static GtkWidget *spn_header_height;
+static GtkWidget *chk_header_first_page;
+static GtkWidget *chk_header_last_page;
+static GtkWidget *chk_footer;
+static GtkWidget *spn_footer_height;
+static GtkWidget *chk_footer_first_page;
+static GtkWidget *chk_footer_last_page;
 
 static void
-page_properties_set_size_sesitivity ()
+page_properties_set_size_sensibility ()
 {
 	gchar *text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (cb_size_type));
 	gboolean sens = (text != NULL && strcmp (text, "Custom") == 0);
@@ -41,6 +49,26 @@ page_properties_set_size_sesitivity ()
 	gtk_widget_set_sensitive (spn_width, sens);
 }
 
+static void
+page_properties_set_header_sensibility ()
+{
+	gboolean sens = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_header));
+
+	gtk_widget_set_sensitive (spn_header_height, sens);
+	gtk_widget_set_sensitive (chk_header_first_page, sens);
+	gtk_widget_set_sensitive (chk_header_last_page, sens);
+}
+
+static void
+page_properties_set_footer_sensibility ()
+{
+	gboolean sens = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_footer));
+
+	gtk_widget_set_sensitive (spn_footer_height, sens);
+	gtk_widget_set_sensitive (chk_footer_first_page, sens);
+	gtk_widget_set_sensitive (chk_footer_last_page, sens);
+}
+
 static void
 page_properties_load ()
 {
@@ -48,6 +76,7 @@ page_properties_load ()
 	gdouble right;
 	gdouble bottom;
 	gdouble left;
+	gdouble height;
 
 	RptSize *size = rpt_report_get_page_size (rpt_report_);
 
@@ -64,13 +93,49 @@ page_properties_load ()
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (spn_margin_top), right);
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (spn_margin_top), bottom);
 	gtk_spin_button_set_value (GTK_SPIN_BUTTON (spn_margin_top), left);
+
+	height = rpt_report_get_section_height (rpt_report_, RPTREPORT_SECTION_PAGE_HEADER);
+	if (height >= 0)
+		{
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chk_header), TRUE);
+			gtk_spin_button_set_value (GTK_SPIN_BUTTON (spn_header_height), height);
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chk_header_first_page),
+										  rpt_report_get_page_header_first_page (rpt_report_));
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chk_header_last_page),
+										  rpt_report_get_page_header_last_page (rpt_report_));
+		}
+
+	height = rpt_report_get_section_height (rpt_report_, RPTREPORT_SECTION_PAGE_HEADER);
+	if (height >= 0)
+		{
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chk_footer), TRUE);
+			gtk_spin_button_set_value (GTK_SPIN_BUTTON (spn_footer_height), height);
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chk_footer_first_page),
+										  rpt_report_get_page_footer_first_page (rpt_report_));
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chk_footer_last_page),
+										  rpt_report_get_page_footer_last_page (rpt_report_));
+		}
 }
 
 void
 page_properties_on_cb_size_type_changed (GtkComboBox *widget,
                                          gpointer user_data)
 {
-	page_properties_set_size_sesitivity ();
+	page_properties_set_size_sensibility ();
+}
+
+void
+page_properties_on_chk_header_toggled (GtkToggleButton *togglebutton,
+                                       gpointer user_data)
+{
+	page_properties_set_header_sensibility ();
+}
+
+void
+page_properties_on_chk_footer_toggled (GtkToggleButton *togglebutton,
+                                       gpointer user_data)
+{
+	page_properties_set_footer_sensibility ();
 }
 
 void
@@ -97,6 +162,23 @@ page_properties_on_btn_ok_clicked (GtkButton *button,
 	                             gtk_spin_button_get_value (GTK_SPIN_BUTTON (spn_margin_bottom)),
 	                             gtk_spin_button_get_value (GTK_SPIN_BUTTON (spn_margin_left)));
 
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_header)))
+		{
+			rpt_report_set_section_height (rpt_report_, RPTREPORT_SECTION_PAGE_HEADER,
+			                               gtk_spin_button_get_value (GTK_SPIN_BUTTON (spn_header_height)));
+			rpt_report_set_page_header_first_last_page (rpt_report_,
+			                                            gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_header_first_page)),
+			                                            gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_header_last_page)));
+		}
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_footer)))
+		{
+			rpt_report_set_section_height (rpt_report_, RPTREPORT_SECTION_PAGE_HEADER,
+			                               gtk_spin_button_get_value (GTK_SPIN_BUTTON (spn_footer_height)));
+			rpt_report_set_page_header_first_last_page (rpt_report_,
+			                                            gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_footer_first_page)),
+			                                            gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chk_footer_last_page)));
+		}
+
 	gtk_widget_destroy (w_prop);
 }
 
@@ -117,8 +199,19 @@ page_properties (RptReport *rpt_report)
 	spn_margin_right = glade_xml_get_widget (gla, "spn_margin_right");
 	spn_margin_bottom = glade_xml_get_widget (gla, "spn_margin_bottom");
 	spn_margin_left = glade_xml_get_widget (gla, "spn_margin_left");
+	chk_header = glade_xml_get_widget (gla, "chk_header");
+	spn_header_height = glade_xml_get_widget (gla, "spn_header_height");
+	chk_header_first_page = glade_xml_get_widget (gla, "chk_header_first_page");
+	chk_header_last_page = glade_xml_get_widget (gla, "chk_header_last_page");
+	chk_footer = glade_xml_get_widget (gla, "chk_footer");
+	spn_footer_height = glade_xml_get_widget (gla, "spn_footer_height");
+	chk_footer_first_page = glade_xml_get_widget (gla, "chk_footer_first_page");
+	chk_footer_last_page = glade_xml_get_widget (gla, "chk_footer_last_page");
+
+	page_properties_set_size_sensibility ();
+	page_properties_set_header_sensibility ();
+	page_properties_set_footer_sensibility ();
 
-	page_properties_set_size_sesitivity ();
 	page_properties_load ();
 
 	gtk_widget_show_all (w_prop);
-- 
2.49.0