3
* Copyright (C) 2001-2004 Murray Cumming
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
#ifndef GLOM_MODE_DATA_DIALOG_CHOOSE_FIELD_H
22
#define GLOM_MODE_DATA_DIALOG_CHOOSE_FIELD_H
25
#include <glom/utility_widgets/dialog_properties.h>
26
#include <libglom/document/document.h>
27
#include <glom/box_withbuttons.h>
28
#include <glom/utility_widgets/combo_textglade.h>
29
#include <glom/mode_design/layout/combobox_relationship.h>
30
#include <glom/mode_design/comboentry_currency.h>
35
class Dialog_ChooseField : public Gtk::Dialog
38
Dialog_ChooseField(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
39
virtual ~Dialog_ChooseField();
42
* @param document The document, so that the dialog can load the previous layout, and save changes.
43
* @param table_name The table name.
44
* @param field The starting field information.
46
virtual void set_document(Document* document, const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& field);
47
virtual void set_document(Document* document, const Glib::ustring& table_name);
50
//void select_item(const sharedptr<const Field>& field);
52
sharedptr<LayoutItem_Field> get_field_chosen() const;
54
typedef std::list< sharedptr<LayoutItem_Field> > type_list_field_items;
55
type_list_field_items get_fields_chosen() const;
59
virtual void on_row_activated(const Gtk::TreeModel::Path& path, Gtk::TreeViewColumn* view_column);
60
virtual void on_treeview_selection_changed();
61
virtual void on_combo_relationship_changed();
62
virtual void on_checkbutton_related_relationships_toggled();
65
class ModelColumns_Fields : public Gtk::TreeModel::ColumnRecord
70
{ add(m_col_name); add(m_col_title); add(m_col_field); }
72
Gtk::TreeModelColumn<Glib::ustring> m_col_name;
73
Gtk::TreeModelColumn<Glib::ustring> m_col_title;
74
Gtk::TreeModelColumn< sharedptr<Field> > m_col_field;
77
ModelColumns_Fields m_ColumnsFields;
79
ComboBox_Relationship* m_combo_relationship;
80
Gtk::Button* m_button_select;
81
Gtk::CheckButton* m_checkbutton_show_related_relationships;
82
Gtk::TreeView* m_treeview;
83
Glib::RefPtr<Gtk::ListStore> m_model;
85
Glib::ustring m_table_name;
86
sharedptr<LayoutItem_Field> m_start_field; //stored so we can preserve extra information that's not changed here.
93
#endif //GLOM_MODE_DATA_DIALOG_CHOOSE_FIELD_H