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_BOX_FORMATTING_H
22
#define GLOM_BOX_FORMATTING_H
25
#include <glom/utility_widgets/dialog_properties.h>
26
#include <libglom/document/document.h>
27
#include <glom/box_withbuttons.h>
28
#include <glom/mode_design/comboentry_currency.h>
29
#include <glom/mode_design/layout/combobox_relationship.h>
30
#include <glom/mode_design/layout/combobox_fields.h>
40
Box_Formatting(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
41
virtual ~Box_Formatting();
44
* @param format The starting information.
46
void set_formatting(const FieldFormatting& format);
49
* @param format The starting information.
50
* @param table_name The field's table.
51
* @param The field that will have this formatting, so we know what formatting options to allow.
53
void set_formatting(const FieldFormatting& format, const Glib::ustring& table_name, const sharedptr<const Field>& field);
54
bool get_formatting(FieldFormatting& format) const;
56
//When used for print layout items,
58
void set_is_for_print_layout();
62
void on_combo_choices_relationship_changed();
65
void enforce_constraints();
67
Gtk::VBox* m_vbox_numeric_format;
68
Gtk::CheckButton* m_checkbox_format_use_thousands;
69
Gtk::CheckButton* m_checkbox_format_use_decimal_places;
70
Gtk::Entry* m_entry_format_decimal_places;
71
ComboEntry_Currency* m_entry_currency_symbol;
73
Gtk::VBox* m_vbox_text_format;
74
Gtk::CheckButton* m_checkbox_format_text_multiline;
75
Gtk::Label* m_label_format_text_multiline_height;
76
Gtk::SpinButton* m_spinbutton_format_text_multiline_height;
77
Gtk::HBox* m_hbox_font;
78
Gtk::CheckButton* m_checkbox_format_text_font;
79
Gtk::FontButton* m_fontbutton;
80
Gtk::HBox* m_hbox_color_foreground;
81
Gtk::CheckButton* m_checkbox_format_text_color_foreground;
82
Gtk::ColorButton* m_colorbutton_foreground;
83
Gtk::HBox* m_hbox_color_background;
84
Gtk::CheckButton* m_checkbox_format_text_color_background;
85
Gtk::ColorButton* m_colorbutton_background;
87
Gtk::VBox* m_vbox_choices;
88
Gtk::RadioButton* m_radiobutton_choices_custom;
89
Gtk::RadioButton* m_radiobutton_choices_related;
90
Gtk::CheckButton* m_checkbutton_choices_restricted;
91
AddDel_WithButtons* m_adddel_choices_custom;
92
guint m_col_index_custom_choices;
93
ComboBox_Relationship* m_combo_choices_relationship;
94
ComboBox_Fields* m_combo_choices_field;
95
ComboBox_Fields* m_combo_choices_field_second;
97
mutable FieldFormatting m_format;
99
Glib::ustring m_table_name;
100
sharedptr<const Field> m_field;
102
//We show different options when
103
//showing this on a print layout.
104
bool m_for_print_layout;
109
#endif //GLOM_BOX_FORMATTING_H