1
<refentry id="MgWorkMatrix">
3
<refentrytitle>MgWorkMatrix</refentrytitle>
4
<manvolnum>3</manvolnum>
5
<refmiscinfo>LIBMERGEANT Library</refmiscinfo>
9
<refname>MgWorkMatrix</refname><refpurpose>Widget to modify the assoctations between two tables</refpurpose>
12
<refsynopsisdiv><title>Synopsis</title>
18
struct <link linkend="MgWorkMatrix-struct">MgWorkMatrix</link>;
19
enum <link linkend="MgWorkMatrixType">MgWorkMatrixType</link>;
20
<link linkend="guint">guint</link> <link linkend="mg-work-matrix-get-type">mg_work_matrix_get_type</link> (void);
21
<link linkend="GtkWidget">GtkWidget</link>* <link linkend="mg-work-matrix-new">mg_work_matrix_new</link> (<link linkend="MgConf">MgConf</link> *conf,
22
<link linkend="MgQuery">MgQuery</link> *rows_select_query,
23
<link linkend="MgTarget">MgTarget</link> *rows_target,
24
<link linkend="MgQuery">MgQuery</link> *cols_select_query,
25
<link linkend="MgTarget">MgTarget</link> *cols_target,
26
<link linkend="MgDbTable">MgDbTable</link> *modif_table,
27
<link linkend="GSList">GSList</link> *modif_table_fields);
28
<link linkend="void">void</link> <link linkend="mg-work-matrix-set-view-type">mg_work_matrix_set_view_type</link> (<link linkend="MgWorkMatrix">MgWorkMatrix</link> *matrix,
29
<link linkend="MgWorkMatrixType">MgWorkMatrixType</link> type);
34
<title>Object Hierarchy</title>
37
<link linkend="GObject">GObject</link>
38
+----<link linkend="GtkObject">GtkObject</link>
39
+----<link linkend="GtkWidget">GtkWidget</link>
40
+----<link linkend="GtkContainer">GtkContainer</link>
41
+----<link linkend="GtkBox">GtkBox</link>
42
+----<link linkend="GtkVBox">GtkVBox</link>
51
<title>Implemented Interfaces</title>
53
MgWorkMatrix implements
54
<link linkend="MgWorkWidget">MgWorkWidget</link> and <link linkend="AtkImplementorIface">AtkImplementorIface</link>.</para>
60
<title>Properties</title>
63
"<link linkend="MgWorkMatrix--assoc-data-only">assoc-data-only</link>" <link linkend="gboolean">gboolean</link> : Write
64
"<link linkend="MgWorkMatrix--layout-nb-columns">layout-nb-columns</link>" <link linkend="gint">gint</link> : Read / Write
65
"<link linkend="MgWorkMatrix--title-string">title-string</link>" <link linkend="gchararray">gchararray</link> : Write
66
"<link linkend="MgWorkMatrix--title-visible">title-visible</link>" <link linkend="gboolean">gboolean</link> : Write
73
<title>Description</title>
75
This widget provides an easy way of modifying the contents of an association table (a table
76
which purpose is to store the primary keys of two or more tables, as foreign keys, and
77
optionnaly some associated data).
80
Upon widget creation, the SELECT queries limiting the values of the two associated tables are required,
81
as well as the <link linkend="MgDbTable"><type>MgDbTable</type></link> table which will be modified. The widget then uses the Foreign key constraints
82
defined in the data dictionnary to define the real modification queries.
87
<title>Details</title>
89
<title><anchor id="MgWorkMatrix-struct"/>struct MgWorkMatrix</title>
90
<indexterm><primary>MgWorkMatrix</primary></indexterm><programlisting>struct MgWorkMatrix;</programlisting>
95
<title><anchor id="MgWorkMatrixType"/>enum MgWorkMatrixType</title>
96
<indexterm><primary>MgWorkMatrixType</primary></indexterm><programlisting>typedef enum {
97
MG_WORK_MATRIX_TABULAR_SYNTHETIC = 0,
98
MG_WORK_MATRIX_LIST_DETAILLED = 1,
99
MG_WORK_MATRIX_LIST_SYNTHETIC = 2,
106
<title><anchor id="mg-work-matrix-get-type"/>mg_work_matrix_get_type ()</title>
107
<indexterm><primary>mg_work_matrix_get_type</primary></indexterm><programlisting><link linkend="guint">guint</link> mg_work_matrix_get_type (void);</programlisting>
110
</para><variablelist role="params">
111
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>
114
</simpara></listitem></varlistentry>
115
</variablelist></refsect2>
117
<title><anchor id="mg-work-matrix-new"/>mg_work_matrix_new ()</title>
118
<indexterm><primary>mg_work_matrix_new</primary></indexterm><programlisting><link linkend="GtkWidget">GtkWidget</link>* mg_work_matrix_new (<link linkend="MgConf">MgConf</link> *conf,
119
<link linkend="MgQuery">MgQuery</link> *rows_select_query,
120
<link linkend="MgTarget">MgTarget</link> *rows_target,
121
<link linkend="MgQuery">MgQuery</link> *cols_select_query,
122
<link linkend="MgTarget">MgTarget</link> *cols_target,
123
<link linkend="MgDbTable">MgDbTable</link> *modif_table,
124
<link linkend="GSList">GSList</link> *modif_table_fields);</programlisting>
126
Creates a new <link linkend="MgWorkMatrix"><type>MgWorkMatrix</type></link> widget.
129
<parameter>rows_select_query</parameter> and <parameter>cols_select_query</parameter> must be SELECT queries, from their results depend what
130
will be displayed in each row and column of the associated matrix widget.
133
The <parameter>rows_target</parameter> and <parameter>cols_target</parameter> targets are used as reference for primary key values.</para>
136
</para><variablelist role="params">
137
<varlistentry><term><parameter>conf</parameter> :</term>
138
<listitem><simpara> a <link linkend="MgConf"><type>MgConf</type></link> object
139
</simpara></listitem></varlistentry>
140
<varlistentry><term><parameter>rows_select_query</parameter> :</term>
142
</simpara></listitem></varlistentry>
143
<varlistentry><term><parameter>rows_target</parameter> :</term>
145
</simpara></listitem></varlistentry>
146
<varlistentry><term><parameter>cols_select_query</parameter> :</term>
148
</simpara></listitem></varlistentry>
149
<varlistentry><term><parameter>cols_target</parameter> :</term>
151
</simpara></listitem></varlistentry>
152
<varlistentry><term><parameter>modif_table</parameter> :</term>
154
</simpara></listitem></varlistentry>
155
<varlistentry><term><parameter>modif_table_fields</parameter> :</term>
157
</simpara></listitem></varlistentry>
158
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara> the new widget
159
</simpara></listitem></varlistentry>
160
</variablelist></refsect2>
162
<title><anchor id="mg-work-matrix-set-view-type"/>mg_work_matrix_set_view_type ()</title>
163
<indexterm><primary>mg_work_matrix_set_view_type</primary></indexterm><programlisting><link linkend="void">void</link> mg_work_matrix_set_view_type (<link linkend="MgWorkMatrix">MgWorkMatrix</link> *matrix,
164
<link linkend="MgWorkMatrixType">MgWorkMatrixType</link> type);</programlisting>
166
Select which way the <parameter>matrix</parameter> widget must present its interface</para>
169
</para><variablelist role="params">
170
<varlistentry><term><parameter>matrix</parameter> :</term>
171
<listitem><simpara> a <link linkend="MgWorkMatrix"><type>MgWorkMatrix</type></link> widget
172
</simpara></listitem></varlistentry>
173
<varlistentry><term><parameter>type</parameter> :</term>
174
<listitem><simpara> a <link linkend="MgWorkMatrixType"><type>MgWorkMatrixType</type></link> value
175
</simpara></listitem></varlistentry>
176
</variablelist></refsect2>
180
<title>Properties</title>
182
<varlistentry><term><anchor id="MgWorkMatrix--assoc-data-only"/>"<literal>assoc-data-only</literal>" (<link linkend="gboolean">gboolean</link> : Write)</term>
184
<para>Disallow INSERT and DELETE on the modified table.</para>
185
</listitem></varlistentry>
186
<varlistentry><term><anchor id="MgWorkMatrix--layout-nb-columns"/>"<literal>layout-nb-columns</literal>" (<link linkend="gint">gint</link> : Read / Write)</term>
188
<para>Number of columns when the chosen view involves a table layout.</para>
189
</listitem></varlistentry>
190
<varlistentry><term><anchor id="MgWorkMatrix--title-string"/>"<literal>title-string</literal>" (<link linkend="gchararray">gchararray</link> : Write)</term>
192
<para>String to display in the widget's title.</para>
193
</listitem></varlistentry>
194
<varlistentry><term><anchor id="MgWorkMatrix--title-visible"/>"<literal>title-visible</literal>" (<link linkend="gboolean">gboolean</link> : Write)</term>
196
<para>Show of hide the title of the widget.</para>
197
</listitem></varlistentry>