</widget>
</child>
<child>
- <widget class="GtkMenuItem" id="mnu_edit_report_properties">
+ <widget class="GtkMenuItem" id="mnu_edit_select">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Report Properties</property>
- <property name="use_underline">True</property>
- <signal name="activate" handler="on_mnu_edit_report_properties_activate"/>
- </widget>
- </child>
- <child>
- <widget class="GtkMenuItem" id="mnu_edit_page_properties">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Page Properties</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">_Select</property>
<property name="use_underline">True</property>
- <signal name="activate" handler="on_mnu_edit_page_properties_activate"/>
+ <child>
+ <widget class="GtkMenu" id="menu2">
+ <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>
+ <child>
+ <widget class="GtkMenuItem" id="mnu_edit_select_all">
+ <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">_All</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="mnu_edit_select_none">
+ <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">_None</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
<child>
- <widget class="GtkMenuItem" id="mnu_edit_object_properties">
+ <widget class="GtkMenuItem" id="mnu_edit_properties">
<property name="visible">True</property>
- <property name="label" translatable="yes">_Object Properties</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="use_underline">True</property>
- <signal name="activate" handler="on_mnu_edit_object_properties_activate"/>
+ <child>
+ <widget class="GtkMenu" id="menu1">
+ <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>
+ <child>
+ <widget class="GtkMenuItem" id="mnu_edit_page_properties">
+ <property name="visible">True</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>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="mnu_edit_report_properties">
+ <property name="visible">True</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>
+ </child>
+ <child>
+ <widget class="GtkMenuItem" id="mnu_edit_object_properties">
+ <property name="visible">True</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>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
</widget>
<property name="column_spacing">4</property>
<property name="row_spacing">3</property>
<child>
- <widget class="GtkEntry" id="txt_cnc_string">
+ <widget class="GtkLabel" id="label7">
<property name="visible">True</property>
- <property name="can_focus">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">
+ <property name="visible">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="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>
</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>
- <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="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>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
- <widget class="GtkCheckButton" id="chk_header_new_page_after">
+ <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">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="use_underline">True</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="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
</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="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="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Header</property>
<property name="use_underline">True</property>
+ <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="report_properties_on_chk_header_toggled"/>
</widget>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
- <widget class="GtkCheckButton" id="chk_footer_new_page_before">
+ <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">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="use_underline">True</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="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
</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="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="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Footer</property>
<property name="use_underline">True</property>
+ <property name="response_id">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="report_properties_on_chk_footer_toggled"/>
</widget>
<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">gtk-cancel</property>
<property name="use_stock">True</property>
+ <property name="response_id">0</property>
<signal name="clicked" handler="report_properties_on_btn_cancel_clicked"/>
</widget>
</child>
<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">gtk-ok</property>
<property name="use_stock">True</property>
+ <property name="response_id">0</property>
<signal name="clicked" handler="report_properties_on_btn_ok_clicked"/>
</widget>
<packing>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<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>
<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="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>
<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="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>
<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="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="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>
</widget>
<property name="column_spacing">3</property>
<property name="row_spacing">3</property>
<child>
- <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="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">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="spn_margin_bottom">
+ <widget class="GtkLabel" id="label6">
<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="xalign">0</property>
+ <property name="label" translatable="yes">Top</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"></property>
</packing>
</child>
<child>
- <widget class="GtkSpinButton" id="spn_margin_right">
+ <widget class="GtkLabel" id="label14">
<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="xalign">0</property>
+ <property name="label" translatable="yes">Right</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="GtkSpinButton" id="spn_margin_top">
+ <widget class="GtkLabel" id="label15">
<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="xalign">0</property>
+ <property name="label" translatable="yes">Bottom</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"></property>
</packing>
</child>
<child>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label15">
+ <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="xalign">0</property>
- <property name="label" translatable="yes">Bottom</property>
+ <property name="adjustment">0 0 10000 1 10 10</property>
+ <property name="digits">2</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>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label14">
+ <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="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">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="label6">
+ <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">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">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <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="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">3</property>
+ <property name="bottom_attach">4</property>
</packing>
</child>
</widget>
<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">gtk-cancel</property>
<property name="use_stock">True</property>
+ <property name="response_id">0</property>
<signal name="clicked" handler="page_properties_on_btn_cancel_clicked"/>
</widget>
</child>
<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">gtk-ok</property>
<property name="use_stock">True</property>
+ <property name="response_id">0</property>
<signal name="clicked" handler="page_properties_on_btn_ok_clicked"/>
</widget>
<packing>
objects_tree.c \
canvas.c \
canvasitem.c \
- canvasline.c
+ canvasline.c \
+ canvasrect.c
#include <gtk/gtk.h>
#include <goocanvas.h>
+#include <libreptool.h>
#include "main.h"
#include "canvas.h"
+#include "canvasitem.h"
#include "canvasline.h"
+#include "canvasrect.h"
static void grpt_canvas_class_init (GRptCanvasClass *klass);
static void grpt_canvas_init (GRptCanvas *canvas);
RptReport *rpt_report;
GtkWidget *scrolledw;
- GtkWidget *grpt_canvas;
+ GtkWidget *goo_canvas;
GooCanvasItem *root;
GooCanvasItem *selection;
+ GList *report_header_objects;
+ GList *page_header_objects;
GList *body_objects;
+ GList *report_footer_objects;
+ GList *page_footer_objects;
gdouble sel_x_start;
gdouble sel_y_start;
}
static void
-grpt_canvas_add_object (GRptCanvas *grpt_canvas, RptReportSection section,
- gdouble x, gdouble y, gdouble width, gdouble height)
+grpt_canvas_add_object (GRptCanvas *grpt_canvas, RptReportSection section, Tool tool,
+ gdouble x, gdouble y, gdouble width, gdouble height)
{
GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE (grpt_canvas);
GRptCanvasClass *klass = GRPT_CANVAS_GET_CLASS (grpt_canvas);
+ RptObject *rpt_object;
GRptCanvasItem *item;
- switch (priv->tool)
+ RptPoint position;
+ RptSize size;
+
+ position.x = x;
+ position.y = y;
+
+ size.width = width;
+ size.height = height;
+
+ switch (tool)
{
case TOOL_LINE:
{
- RptObject *rpt_object_line;
- RptPoint position;
- RptSize size;
+ 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);
- position.x = x;
- position.y = y;
- rpt_object_line = rpt_obj_line_new (get_new_object_name (priv->tool), position);
-
- size.width = width;
- size.height = height;
- g_object_set (G_OBJECT (rpt_object_line),
+ 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_line),
+ RPT_OBJ_LINE (rpt_object),
NULL);
- grpt_canvas_item_set_section (item, RPTREPORT_SECTION_BODY);
+
}
break;
+
+ case TOOL_RECT:
+ {
+ 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);
+ }
+ break;
+
+ default:
+ return;
}
+ grpt_canvas_item_set_section (item, RPTREPORT_SECTION_BODY);
+
priv->body_objects = g_list_append (priv->body_objects, item);
g_signal_emit (grpt_canvas, klass->object_added_signal_id, 0,
/* SIGNALS */
static gboolean
grpt_canvas_on_button_press_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
+ GdkEventButton *event,
+ gpointer user_data)
{
GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE ((GRptCanvas *)user_data);
static gboolean
grpt_canvas_on_button_release_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
+ GdkEventButton *event,
+ gpointer user_data)
{
gdouble x;
gdouble y;
GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE ((GRptCanvas *)user_data);
- g_object_set (G_OBJECT (priv->selection),
- "visibility", GOO_CANVAS_ITEM_HIDDEN,
- NULL);
-
- if (event->x < priv->sel_x_start)
- {
- x = event->x;
- width = priv->sel_x_start - x;
- }
- else
- {
- x = priv->sel_x_start;
- width = event->x - x;
- }
- if (event->y < priv->sel_y_start)
- {
- y = event->y;
- height = priv->sel_y_start - y;
- }
- else
+ if (event->button == 1)
{
- y = priv->sel_y_start;
- height = event->y - y;
- }
+ g_object_set (G_OBJECT (priv->selection),
+ "visibility", GOO_CANVAS_ITEM_HIDDEN,
+ NULL);
- grpt_canvas_add_object ((GRptCanvas *)user_data, RPTREPORT_SECTION_BODY, x, y, width, height);
+ if (event->x < priv->sel_x_start)
+ {
+ x = event->x;
+ width = priv->sel_x_start - x;
+ }
+ else
+ {
+ x = priv->sel_x_start;
+ width = event->x - x;
+ }
+ if (event->y < priv->sel_y_start)
+ {
+ y = event->y;
+ height = priv->sel_y_start - y;
+ }
+ else
+ {
+ y = priv->sel_y_start;
+ height = event->y - y;
+ }
+
+ if (priv->tool != TOOL_SELECT)
+ {
+ grpt_canvas_add_object ((GRptCanvas *)user_data, RPTREPORT_SECTION_BODY, priv->tool, x, y, width, height);
+ }
+ else
+ {
+ GooCanvasBounds bound;
+ GList *objects;
+ GooCanvasItemSimple *item;
+
+ bound.x1 = x;
+ bound.y1 = y;
+ bound.x2 = x + width;
+ bound.y2 = y + height;
+ objects = goo_canvas_get_items_in_area (GOO_CANVAS (priv->goo_canvas),
+ &bound,
+ TRUE, TRUE, FALSE);
+
+ if (objects != NULL)
+ {
+ objects = g_list_first (objects);
+ }
+ while (objects != NULL)
+ {
+ item = (GooCanvasItemSimple *)objects->data;
+
+ grpt_canvas_item_set_selected (GRPT_CANVAS_ITEM (item), TRUE);
+
+ objects = g_list_next (objects);
+ }
+ g_list_free (objects);
+ }
+ }
return FALSE;
}
fixed = gtk_fixed_new ();
gtk_container_add (GTK_CONTAINER (viewport), fixed);
- priv->grpt_canvas = goo_canvas_new ();
- gtk_fixed_put (GTK_FIXED (fixed), priv->grpt_canvas, 0, 0);
+ priv->goo_canvas = goo_canvas_new ();
+ gtk_fixed_put (GTK_FIXED (fixed), priv->goo_canvas, 0, 0);
- g_signal_connect (G_OBJECT (priv->grpt_canvas), "button-press-event",
+ g_signal_connect (G_OBJECT (priv->goo_canvas), "button-press-event",
G_CALLBACK (grpt_canvas_on_button_press_event), (gpointer)grpt_canvas);
- g_signal_connect (G_OBJECT (priv->grpt_canvas), "button-release-event",
+ g_signal_connect (G_OBJECT (priv->goo_canvas), "button-release-event",
G_CALLBACK (grpt_canvas_on_button_release_event), (gpointer)grpt_canvas);
- g_signal_connect (G_OBJECT (priv->grpt_canvas), "motion-notify-event",
+ g_signal_connect (G_OBJECT (priv->goo_canvas), "motion-notify-event",
G_CALLBACK (grpt_canvas_on_motion_notify_event), (gpointer)grpt_canvas);
- priv->root = goo_canvas_get_root_item (GOO_CANVAS (priv->grpt_canvas));
+ priv->root = goo_canvas_get_root_item (GOO_CANVAS (priv->goo_canvas));
/* setting size */
size = rpt_report_get_page_size (priv->rpt_report);
{
GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE (grpt_canvas);
- gtk_widget_set_size_request (priv->grpt_canvas, size.width, size.height);
- goo_canvas_set_bounds (GOO_CANVAS (priv->grpt_canvas), 0, 0, size.width, size.height);
+ gtk_widget_set_size_request (priv->goo_canvas, size.width, size.height);
+ goo_canvas_set_bounds (GOO_CANVAS (priv->goo_canvas), 0, 0, size.width, size.height);
}
GList
switch (section)
{
+ case RPTREPORT_SECTION_REPORT_HEADER:
+ objects = g_list_copy (priv->report_header_objects);
+ break;
+
+ case RPTREPORT_SECTION_PAGE_HEADER:
+ objects = g_list_copy (priv->page_header_objects);
+ break;
+
case RPTREPORT_SECTION_BODY:
objects = g_list_copy (priv->body_objects);
break;
+
+ case RPTREPORT_SECTION_REPORT_FOOTER:
+ objects = g_list_copy (priv->report_footer_objects);
+ break;
+
+ case RPTREPORT_SECTION_PAGE_FOOTER:
+ objects = g_list_copy (priv->page_footer_objects);
+ break;
}
return objects;
}
+void
+grpt_canvas_set_object_selected (GRptCanvas *grpt_canvas, GRptCanvasItem *grpt_canvas_item, gboolean selected, gboolean add_to_selection)
+{
+ if (selected && !add_to_selection)
+ {
+ grpt_canvas_select_none (grpt_canvas);
+ }
+ grpt_canvas_item_set_selected (grpt_canvas_item, selected);
+}
+
+void
+grpt_canvas_select_all (GRptCanvas *grpt_canvas)
+{
+ grpt_canvas_select_section_all (grpt_canvas, RPTREPORT_SECTION_REPORT_HEADER, FALSE);
+ grpt_canvas_select_section_all (grpt_canvas, RPTREPORT_SECTION_PAGE_HEADER, TRUE);
+ grpt_canvas_select_section_all (grpt_canvas, RPTREPORT_SECTION_BODY, TRUE);
+ grpt_canvas_select_section_all (grpt_canvas, RPTREPORT_SECTION_REPORT_FOOTER, TRUE);
+ grpt_canvas_select_section_all (grpt_canvas, RPTREPORT_SECTION_REPORT_HEADER, TRUE);
+}
+
+void
+grpt_canvas_select_none (GRptCanvas *grpt_canvas)
+{
+ grpt_canvas_select_section_none (grpt_canvas, RPTREPORT_SECTION_REPORT_HEADER);
+ grpt_canvas_select_section_none (grpt_canvas, RPTREPORT_SECTION_PAGE_HEADER);
+ grpt_canvas_select_section_none (grpt_canvas, RPTREPORT_SECTION_BODY);
+ grpt_canvas_select_section_none (grpt_canvas, RPTREPORT_SECTION_REPORT_FOOTER);
+ grpt_canvas_select_section_none (grpt_canvas, RPTREPORT_SECTION_REPORT_HEADER);
+}
+
+void
+grpt_canvas_select_section_all (GRptCanvas *grpt_canvas, RptReportSection section, gboolean add_to_selection)
+{
+ GList *objects = NULL;
+
+ GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE (grpt_canvas);
+
+ if (!add_to_selection)
+ {
+ grpt_canvas_select_section_none (grpt_canvas, section);
+ }
+
+ switch (section)
+ {
+ case RPTREPORT_SECTION_REPORT_HEADER:
+ objects = g_list_copy (priv->report_header_objects);
+ break;
+
+ case RPTREPORT_SECTION_PAGE_HEADER:
+ objects = g_list_copy (priv->page_header_objects);
+ break;
+
+ case RPTREPORT_SECTION_BODY:
+ objects = g_list_copy (priv->body_objects);
+ break;
+
+ case RPTREPORT_SECTION_REPORT_FOOTER:
+ objects = g_list_copy (priv->report_footer_objects);
+ break;
+
+ case RPTREPORT_SECTION_PAGE_FOOTER:
+ objects = g_list_copy (priv->page_footer_objects);
+ break;
+ }
+
+ if (objects != NULL)
+ {
+ objects = g_list_first (objects);
+ }
+ while (objects != NULL)
+ {
+ grpt_canvas_item_set_selected ((GRptCanvasItem *)objects->data, TRUE);
+ objects = g_list_next (objects);
+ }
+}
+
+void
+grpt_canvas_select_section_none (GRptCanvas *grpt_canvas, RptReportSection section)
+{
+ GList *objects = NULL;
+
+ GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE (grpt_canvas);
+
+ switch (section)
+ {
+ case RPTREPORT_SECTION_REPORT_HEADER:
+ objects = g_list_copy (priv->report_header_objects);
+ break;
+
+ case RPTREPORT_SECTION_PAGE_HEADER:
+ objects = g_list_copy (priv->page_header_objects);
+ break;
+
+ case RPTREPORT_SECTION_BODY:
+ objects = g_list_copy (priv->body_objects);
+ break;
+
+ case RPTREPORT_SECTION_REPORT_FOOTER:
+ objects = g_list_copy (priv->report_footer_objects);
+ break;
+
+ case RPTREPORT_SECTION_PAGE_FOOTER:
+ objects = g_list_copy (priv->page_footer_objects);
+ break;
+ }
+
+ if (objects != NULL)
+ {
+ objects = g_list_first (objects);
+ }
+ while (objects != NULL)
+ {
+ grpt_canvas_item_set_selected ((GRptCanvasItem *)objects->data, FALSE);
+ objects = g_list_next (objects);
+ }
+}
+
void
grpt_canvas_free (GRptCanvas *grpt_canvas)
{
GRptCanvasPrivate *priv = GRPT_CANVAS_GET_PRIVATE (grpt_canvas);
- gtk_widget_destroy (priv->grpt_canvas);
+ gtk_widget_destroy (priv->goo_canvas);
gtk_widget_destroy (priv->scrolledw);
}
GList *grpt_canvas_section_get_objects (GRptCanvas *grpt_canvas, RptReportSection section);
-void grpt_canvas_select_object (GRptCanvas *grpt_canvas, GRptCanvasItem *grpt_canvas_item);
+void grpt_canvas_set_object_selected (GRptCanvas *grpt_canvas,
+ GRptCanvasItem *grpt_canvas_item,
+ gboolean selected,
+ gboolean add_to_selection);
+
+void grpt_canvas_select_all (GRptCanvas *grpt_canvas);
+void grpt_canvas_select_none (GRptCanvas *grpt_canvas);
+
+void grpt_canvas_select_section_all (GRptCanvas *grpt_canvas,
+ RptReportSection section,
+ gboolean add_to_selection);
+void grpt_canvas_select_section_none (GRptCanvas *grpt_canvas,
+ RptReportSection section);
void grpt_canvas_free (GRptCanvas *grpt_canvas);
static void grpt_canvas_item_update (GooCanvasItemSimple *simple,
cairo_t *cr);
+static void grpt_canvas_item_paint (GooCanvasItemSimple *simple,
+ cairo_t *cr,
+ const GooCanvasBounds *bounds);
static gboolean grpt_canvas_item_is_item_at (GooCanvasItemSimple *simple,
gdouble x,
gdouble y,
struct _GRptCanvasItemPrivate
{
RptReportSection section;
+
+ gboolean selected;
};
GType
g_type_class_add_private (object_class, sizeof (GRptCanvasItemPrivate));
simple_class->simple_update = grpt_canvas_item_update;
+ simple_class->simple_paint = grpt_canvas_item_paint;
simple_class->simple_is_item_at = grpt_canvas_item_is_item_at;
}
static void
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->selected = FALSE;
}
GooCanvasItem
GRptCanvasItem *grpt_canvas_item;
const char *first_property;
va_list var_args;
- GRptCanvasItemPrivate *priv;
item = g_object_new (GRPT_TYPE_CANVAS_ITEM, NULL);
priv->section = section;
}
+gboolean
+grpt_canvas_item_is_selected (GRptCanvasItem *grpt_canvas_item)
+{
+ GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
+
+ return priv->selected;
+}
+
+void
+grpt_canvas_item_set_selected (GRptCanvasItem *grpt_canvas_item, gboolean selected)
+{
+ GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (grpt_canvas_item);
+
+ priv->selected = selected;
+}
+
static void
grpt_canvas_item_update (GooCanvasItemSimple *simple, cairo_t *cr)
{
GRptCanvasItem *grpt_canvas_item = (GRptCanvasItem *)simple;
- /* Compute the new bounds. */
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;
}
+static void
+grpt_canvas_item_paint (GooCanvasItemSimple *simple,
+ cairo_t *cr,
+ const GooCanvasBounds *bounds)
+{
+ GRptCanvasItem *item = GRPT_CANVAS_ITEM (simple);
+ GRptCanvasItemPrivate *priv = GRPT_CANVAS_ITEM_GET_PRIVATE (item);
+
+ if (GRPT_CANVAS_ITEM_GET_CLASS (item)->paint)
+ {
+ GRPT_CANVAS_ITEM_GET_CLASS (item)->paint (simple, cr, bounds);
+ }
+
+ if (priv->selected)
+ {
+ }
+}
+
static gboolean
grpt_canvas_item_is_item_at (GooCanvasItemSimple *simple, gdouble x, gdouble y, cairo_t *cr, gboolean is_pointer_event)
{
{
GooCanvasItemSimpleClass parent_class;
+ void (*paint) (GooCanvasItemSimple *simple,
+ cairo_t *cr,
+ const GooCanvasBounds *bounds);
+
RptObject *(*get_rpt_object) (GRptCanvasItem *canvas_item);
};
RptReportSection grpt_canvas_item_get_section (GRptCanvasItem *grpt_canvas_item);
void grpt_canvas_item_set_section (GRptCanvasItem *grpt_canvas_item, RptReportSection section);
+gboolean grpt_canvas_item_is_selected (GRptCanvasItem *grpt_canvas_item);
+void grpt_canvas_item_set_selected (GRptCanvasItem *grpt_canvas_item, gboolean selected);
+
G_END_DECLS
g_type_class_add_private (object_class, sizeof (GRptCanvasLinePrivate));
- simple_class->simple_paint = grpt_canvas_line_paint;
-
+ canvas_item_class->paint = grpt_canvas_line_paint;
canvas_item_class->get_rpt_object = grpt_canvas_line_get_rpt_object;
}
--- /dev/null
+/*
+ * Copyright (C) 2007 Andrea Zagli <azagli@inwind.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include "canvasrect.h"
+
+
+static void grpt_canvas_rect_class_init (GRptCanvasRectClass *klass);
+static void grpt_canvas_rect_init (GRptCanvasRect *grpt_canvas_rect);
+
+
+static void grpt_canvas_rect_paint (GooCanvasItemSimple *simple,
+ cairo_t *cr,
+ const GooCanvasBounds *bounds);
+
+static RptObject *grpt_canvas_rect_get_rpt_object (GRptCanvasItem *grpt_canvas_item);
+
+
+#define GRPT_CANVAS_RECT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GRPT_TYPE_CANVAS_RECT, GRptCanvasRectPrivate))
+
+
+typedef struct _GRptCanvasRectPrivate GRptCanvasRectPrivate;
+struct _GRptCanvasRectPrivate
+ {
+ RptObjRect *rpt_object_rect;
+ };
+
+GType
+grpt_canvas_rect_get_type (void)
+{
+ static GType grpt_canvas_rect_type = 0;
+
+ if (!grpt_canvas_rect_type)
+ {
+ static const GTypeInfo grpt_canvas_rect_info =
+ {
+ sizeof (GRptCanvasRectClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) grpt_canvas_rect_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (GRptCanvasRect),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) grpt_canvas_rect_init,
+ NULL
+ };
+
+ grpt_canvas_rect_type = g_type_register_static (GRPT_TYPE_CANVAS_ITEM, "GRptCanvasRect",
+ &grpt_canvas_rect_info, 0);
+ }
+
+ return grpt_canvas_rect_type;
+}
+
+static void
+grpt_canvas_rect_class_init (GRptCanvasRectClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GRptCanvasItemClass *canvas_item_class = GRPT_CANVAS_ITEM_CLASS (klass);
+ GooCanvasItemSimpleClass *simple_class = (GooCanvasItemSimpleClass *)klass;
+
+ g_type_class_add_private (object_class, sizeof (GRptCanvasRectPrivate));
+
+ simple_class->simple_paint = grpt_canvas_rect_paint;
+
+ canvas_item_class->get_rpt_object = grpt_canvas_rect_get_rpt_object;
+}
+
+static void
+grpt_canvas_rect_init (GRptCanvasRect *grpt_canvas_rect)
+{
+}
+
+GRptCanvasItem
+*grpt_canvas_rect_new (GooCanvasItem *parent, gdouble x, gdouble y, gdouble width, gdouble height, RptObjRect *rpt_object_rect, ...)
+{
+ GRptCanvasItem *item;
+ GRptCanvasRect *grpt_canvas_rect;
+ 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;
+
+ priv = GRPT_CANVAS_RECT_GET_PRIVATE (grpt_canvas_rect);
+ priv->rpt_object_rect = g_object_ref (rpt_object_rect);
+
+ va_start (var_args, rpt_object_rect);
+ first_property = va_arg (var_args, char*);
+ if (first_property)
+ {
+ g_object_set_valist ((GObject *)item, first_property, var_args);
+ }
+ va_end (var_args);
+
+ if (parent)
+ {
+ goo_canvas_item_add_child (parent, GOO_CANVAS_ITEM (item), -1);
+ g_object_unref (item);
+ }
+
+ return item;
+}
+
+static void
+grpt_canvas_rect_paint (GooCanvasItemSimple *simple, cairo_t *cr, const GooCanvasBounds *bounds)
+{
+ RptPoint *position = NULL;
+ RptSize *size = NULL;
+ RptRotation *rotation = NULL;
+ RptStroke *stroke = NULL;
+ RptColor *fill_color = NULL;
+
+ GRptCanvasRect *grpt_canvas_rect = (GRptCanvasRect *)simple;
+
+ GRptCanvasItem *grpt_canvas_item = (GRptCanvasItem *)simple;
+
+ GRptCanvasRectPrivate *priv = GRPT_CANVAS_RECT_GET_PRIVATE (grpt_canvas_rect);
+
+ g_object_get (G_OBJECT (priv->rpt_object_rect),
+ "position", &position,
+ "size", &size,
+ "rotation", &rotation,
+ "stroke", &stroke,
+ "fill-color", &fill_color,
+ NULL);
+
+ if (position == NULL || size == NULL)
+ {
+ return;
+ }
+ if (stroke == NULL)
+ {
+ stroke = (RptStroke *)g_malloc0 (sizeof (RptStroke));
+ stroke->width = 1.0;
+ stroke->color = (RptColor *)g_malloc0 (sizeof (RptColor));
+ stroke->color->a = 1.0;
+ stroke->style = NULL;
+ }
+
+ if (rotation != NULL)
+ {
+ /* TO DO */
+ /*rpt_print_rotate (rpt_print, position, size, rotation->angle);*/
+ }
+
+ /* TO DO */
+ /*cairo_set_line_width (priv->cr, stroke.width);*/
+ cairo_rectangle (cr, position->x, position->y, size->width, size->height);
+
+ if (fill_color != NULL)
+ {
+ cairo_set_source_rgba (cr, fill_color->r, fill_color->g, fill_color->b, fill_color->a);
+ cairo_fill_preserve (cr);
+ }
+
+ if (stroke->style != NULL)
+ {
+ gdouble *dash = rpt_common_style_to_array (stroke->style);
+ cairo_set_dash (cr, dash, stroke->style->len, 0.0);
+ }
+
+ cairo_set_source_rgba (cr, stroke->color->r, stroke->color->g, stroke->color->b, stroke->color->a);
+ cairo_stroke (cr);
+}
+
+static RptObject
+*grpt_canvas_rect_get_rpt_object (GRptCanvasItem *grpt_canvas_item)
+{
+ GRptCanvasRectPrivate *priv = GRPT_CANVAS_RECT_GET_PRIVATE (GRPT_CANVAS_RECT (grpt_canvas_item));
+
+ return RPT_OBJECT (priv->rpt_object_rect);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007 Andrea Zagli <azagli@inwind.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GRPT_CANVAS_RECT_H__
+#define __GRPT_CANVAS_RECT_H__
+
+#include <gtk/gtk.h>
+#include <libreptool.h>
+
+#include "canvasitem.h"
+
+
+G_BEGIN_DECLS
+
+
+#define GRPT_TYPE_CANVAS_RECT (grpt_canvas_rect_get_type ())
+#define GRPT_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GRPT_TYPE_CANVAS_RECT, GRptCanvasRect))
+#define GRPT_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GRPT_TYPE_CANVAS_RECT, GRptCanvasRectClass))
+#define GRPT_IS_CANVAS_RECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GRPT_TYPE_CANVAS_RECT))
+#define GRPT_IS_CANVAS_RECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GRPT_TYPE_CANVAS_RECT))
+#define GRPT_CANVAS_RECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GRPT_TYPE_CANVAS_RECT, GRptCanvasRectClass))
+
+
+typedef struct _GRptCanvasRect GRptCanvasRect;
+typedef struct _GRptCanvasRectClass GRptCanvasRectClass;
+
+struct _GRptCanvasRect
+{
+ GRptCanvasItem parent;
+};
+
+struct _GRptCanvasRectClass
+{
+ GRptCanvasItemClass parent_class;
+};
+
+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,
+ ...);
+
+
+G_END_DECLS
+
+
+#endif /* __GRPT_CANVAS_RECT_H__ */
static RptReport *rpt_report;
static gint line_counter = 0;
+static gint rect_counter = 0;
static GtkWidget *w;
static GtkWidget *vbox;
case TOOL_LINE:
ret = g_strdup_printf ("line%d", ++line_counter);
break;
+
+ case TOOL_RECT:
+ ret = g_strdup_printf ("rect%d", ++rect_counter);
+ break;
}
return ret;
GtkTreeStore *tr_store;
GtkTreeSelection *selection;
+ GtkTreeRowReference *trr_report_header;
+ GtkTreeRowReference *trr_page_header;
GtkTreeRowReference *trr_body;
+ GtkTreeRowReference *trr_report_footer;
+ GtkTreeRowReference *trr_page_footer;
};
GType
{
GtkTreeIter iter;
gchar *name = NULL;
+ GtkTreeRowReference *trr;
GRptObjectsTreePrivate *priv = GRPT_OBJECTS_TREE_GET_PRIVATE (grpt_objects_tree);
switch (section)
{
case RPTREPORT_SECTION_REPORT_HEADER:
- name = g_strdup ("Report Header");
+ if (priv->trr_report_header == NULL)
+ {
+ name = g_strdup ("Report Header");
+ }
break;
case RPTREPORT_SECTION_PAGE_HEADER:
- name = g_strdup ("Page Header");
+ if (priv->trr_page_header == NULL)
+ {
+ name = g_strdup ("Page Header");
+ }
break;
- case RPTREPORT_SECTION_REPORT_FOOTER:
- name = g_strdup ("Report Footer");
+ case RPTREPORT_SECTION_BODY:
+ if (priv->trr_body == NULL)
+ {
+ name = g_strdup ("Body");
+ }
break;
- case RPTREPORT_SECTION_PAGE_FOOTER:
- name = g_strdup ("Page Footer");
+ case RPTREPORT_SECTION_REPORT_FOOTER:
+ if (priv->trr_report_footer == NULL)
+ {
+ name = g_strdup ("Report Footer");
+ }
break;
- case RPTREPORT_SECTION_BODY:
- if (priv->trr_body == NULL)
+ case RPTREPORT_SECTION_PAGE_FOOTER:
+ if (priv->trr_page_footer == NULL)
{
- name = g_strdup ("Body");
+ name = g_strdup ("Page Footer");
}
break;
}
OBJS_TREE_COL_NAME, name,
OBJS_TREE_COL_SECTION, section,
-1);
-
- priv->trr_body = gtk_tree_row_reference_new (GTK_TREE_MODEL (priv->tr_store),
- gtk_tree_model_get_path (GTK_TREE_MODEL (priv->tr_store),
- &iter));
+
+ trr = gtk_tree_row_reference_new (GTK_TREE_MODEL (priv->tr_store),
+ gtk_tree_model_get_path (GTK_TREE_MODEL (priv->tr_store),
+ &iter));
+
+ switch (section)
+ {
+ case RPTREPORT_SECTION_REPORT_HEADER:
+ priv->trr_report_header = trr;
+ break;
+
+ case RPTREPORT_SECTION_PAGE_HEADER:
+ priv->trr_page_header = trr;
+ break;
+
+ case RPTREPORT_SECTION_BODY:
+ priv->trr_body = trr;
+ break;
+
+ case RPTREPORT_SECTION_REPORT_FOOTER:
+ priv->trr_report_footer = trr;
+ break;
+
+ case RPTREPORT_SECTION_PAGE_FOOTER:
+ priv->trr_page_footer = trr;
+ break;
+ }
}
}
switch (section)
{
+ case RPTREPORT_SECTION_REPORT_HEADER:
+ trr = priv->trr_report_header;
+ break;
+
+ case RPTREPORT_SECTION_PAGE_HEADER:
+ trr = priv->trr_page_header;
+ break;
+
case RPTREPORT_SECTION_BODY:
trr = priv->trr_body;
break;
+
+ case RPTREPORT_SECTION_REPORT_FOOTER:
+ trr = priv->trr_report_footer;
+ break;
+
+ case RPTREPORT_SECTION_PAGE_FOOTER:
+ trr = priv->trr_page_footer;
+ break;
}
path = gtk_tree_row_reference_get_path (trr);