3
* Copyright (C) 2007, 2008 Openismus GmbH
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of the
8
* License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful, but
11
* WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* General Public License for more details.
15
* You should have received a copy of the GNU General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
* Boston, MA 02111-1307, USA.
21
#include "print_layout_toolbar.h"
22
#include "print_layout_toolbar_button.h"
23
#include <gtkmm/stock.h>
24
#include <glibmm/i18n.h>
27
//#include "layoutwidgetbase.h"
28
#include <glom/utility_widgets/egg/toolpalette/eggtoolitemgroup.h>
33
PrintLayoutToolbar::PrintLayoutToolbar()
35
// Looks ugly otherwise:
36
set_size_request(100, 200);
38
PrintLayoutToolbarButton* drag_field =
39
Gtk::manage(new PrintLayoutToolbarButton("glom-field.png", PrintLayoutToolbarButton::ITEM_FIELD,
40
_("Database Field"), _("Drag this to the layout to add a new database field.")));
41
PrintLayoutToolbarButton* drag_text =
42
Gtk::manage(new PrintLayoutToolbarButton("glom-text.png", PrintLayoutToolbarButton::ITEM_TEXT,
43
_("Text"), _("Drag this to the layout to add a new static text box.")));
44
PrintLayoutToolbarButton* drag_image =
45
Gtk::manage(new PrintLayoutToolbarButton("glom-image.png", PrintLayoutToolbarButton::ITEM_IMAGE,
46
_("Image"), _("Drag this to the layout to add a new static image.")));
48
PrintLayoutToolbarButton* drag_line_horizontal =
49
Gtk::manage(new PrintLayoutToolbarButton("glom-line-horizontal.png", PrintLayoutToolbarButton::ITEM_LINE_HORIZONTAL,
50
_("Horizontal Line"), _("Drag this to the layout to add a new horizontal line.")));
51
PrintLayoutToolbarButton* drag_line_vertical =
52
Gtk::manage(new PrintLayoutToolbarButton("glom-line-vertical.png", PrintLayoutToolbarButton::ITEM_LINE_VERTICAL,
53
_("Vertical Line"), _("Drag this to the layout to add a new vertical line.")));
55
PrintLayoutToolbarButton* drag_related_records =
56
Gtk::manage(new PrintLayoutToolbarButton("glom-related-records.png", PrintLayoutToolbarButton::ITEM_PORTAL,
57
_("Related Records"), _("Drag this to the layout to add a new related records portal.")));
59
//Note for translators: These are layout items, like widgets in GTK+.
60
GtkContainer* items_group = GTK_CONTAINER(egg_tool_item_group_new(_("Items")));
61
gtk_container_add(items_group, GTK_WIDGET(drag_field->gobj()));
62
gtk_container_add(items_group, GTK_WIDGET(drag_text->gobj()));
63
gtk_container_add(items_group, GTK_WIDGET(drag_image->gobj()));
65
//Note for translators: These are layout items, like widgets in GTK+.
66
GtkContainer* lines_group = GTK_CONTAINER(egg_tool_item_group_new(_("Lines")));
67
gtk_container_add(lines_group, GTK_WIDGET(drag_line_horizontal->gobj()));
68
gtk_container_add(lines_group, GTK_WIDGET(drag_line_vertical->gobj()));
70
//Note for translators: These are layout items, like widgets in GTK+.
71
GtkContainer* related_group = GTK_CONTAINER(egg_tool_item_group_new(_("Records")));
72
gtk_container_add(related_group, GTK_WIDGET(drag_related_records->gobj()));
74
add_group(EGG_TOOL_ITEM_GROUP(items_group));
75
add_group(EGG_TOOL_ITEM_GROUP(lines_group));
76
add_group(EGG_TOOL_ITEM_GROUP(related_group));
83
PrintLayoutToolbar::~PrintLayoutToolbar()