#define HIG_VBOX_INNER_SPACING 6
-#define HIG_HBOX_SPACING 6
+#define HIG_HBOX_SPACING 12
/*===========================================*/
/* Private globals */
/* 2nd row, Column 2: User area (inner vbox) */
hig_category->vbox = gtk_vbox_new (FALSE, HIG_VBOX_INNER_SPACING);
gtk_box_pack_start (GTK_BOX(hbox),
- hig_category->vbox, FALSE, FALSE, 0);
+ hig_category->vbox, TRUE, TRUE, 0);
}
static void
gtk_box_pack_start (GTK_BOX (hig_hbox), widget, FALSE, FALSE, 0);
}
+/****************************************************************************/
+/* Add widget (from left) to hbox with a right justification. */
+/****************************************************************************/
+void
+gl_hig_hbox_add_widget_justify (glHigHBox *hig_hbox,
+ GtkWidget *widget)
+{
+ gtk_box_pack_start (GTK_BOX (hig_hbox), widget, TRUE, TRUE, 0);
+}
+
G_BEGIN_DECLS
+#define GL_HIG_PAD1 6
+#define GL_HIG_PAD2 12
+
/*===========================================================================*/
/* HIG Dialog wrapper. */
/*===========================================================================*/
GtkHBoxClass parent_class;
};
-guint gl_hig_hbox_get_type (void);
+guint gl_hig_hbox_get_type (void);
-GtkWidget *gl_hig_hbox_new (void);
+GtkWidget *gl_hig_hbox_new (void);
-void gl_hig_hbox_add_widget (glHigHBox *hig_hbox,
- GtkWidget *widget);
+void gl_hig_hbox_add_widget (glHigHBox *hig_hbox,
+ GtkWidget *widget);
+
+void gl_hig_hbox_add_widget_justify (glHigHBox *hig_hbox,
+ GtkWidget *widget);
G_END_DECLS
#include "merge.h"
#include "merge-ui.h"
#include "merge-properties.h"
+#include "hig.h"
#include "debug.h"
/* Local function prototypes */
/*===========================================*/
-static void create_merge_dialog_widgets (GtkDialog * dialog,
- PropertyDialogPassback * data);
+static void create_merge_dialog_widgets (glHigDialog *dialog,
+ PropertyDialogPassback *data);
-static void type_changed_cb (GtkWidget * widget, PropertyDialogPassback * data);
-static void src_changed_cb (GtkWidget * widget, PropertyDialogPassback * data);
+static void type_changed_cb (GtkWidget *widget,
+ PropertyDialogPassback *data);
-static void response_cb (GtkDialog * dialog, gint response,
- PropertyDialogPassback * data);
+static void src_changed_cb (GtkWidget *widget,
+ PropertyDialogPassback *data);
+
+static void response_cb (glHigDialog *dialog,
+ gint response,
+ PropertyDialogPassback *data);
\f
/****************************************************************************/
/* Launch merge properties dialog. */
/****************************************************************************/
void
-gl_merge_properties_dialog (glView * view)
+gl_merge_properties_dialog (glView *view)
{
static PropertyDialogPassback *data = NULL;
GtkWidget *dialog;
data = g_new0 (PropertyDialogPassback, 1);
}
- dialog = gtk_dialog_new_with_buttons (
- _("Edit document-merge properties"),
- GTK_WINDOW (win),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- NULL);
+ dialog = gl_hig_dialog_new_with_buttons (
+ _("Edit document-merge properties"),
+ GTK_WINDOW (win),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ NULL);
data->dialog = dialog;
data->view = view;
data->src_entry = NULL;
data->field_ws = NULL;
- create_merge_dialog_widgets (GTK_DIALOG (dialog), data);
+ create_merge_dialog_widgets (GL_HIG_DIALOG (dialog), data);
g_signal_connect (G_OBJECT(dialog), "response",
G_CALLBACK(response_cb), data);
}
/*--------------------------------------------------------------------------*/
-/* PRIVATE. Create and add start page to druid. */
+/* PRIVATE. Create merge widgets. */
/*--------------------------------------------------------------------------*/
static void
-create_merge_dialog_widgets (GtkDialog * dialog,
+create_merge_dialog_widgets (glHigDialog * dialog,
PropertyDialogPassback * data)
{
- GtkWidget *wvbox, *wframe, *whbox, *wtable, *wlabel, *wcombo, *wscroll;
+ GtkWidget *wframe, *whbox, *wtable, *wlabel, *wcombo, *wscroll;
GList *texts;
glMerge *merge;
glMergeType type;
gchar *src;
GList *fields;
+ GtkSizeGroup *label_size_group;
merge = gl_label_get_merge (data->label);
type = merge->type;
src = merge->src;
fields = merge->field_defs;
- gl_merge_free (&merge);
-
- wvbox = dialog->vbox;
- wframe = gtk_frame_new (_("Source"));
- gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
+ /* ---- Source section ---- */
+ wframe = gl_hig_category_new (_("Source"));
+ gl_hig_dialog_add_widget (dialog, wframe);
+ label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- whbox = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_container_add (GTK_CONTAINER (wframe), whbox);
-
- wtable = gtk_table_new (2, 2, FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (wtable), 10);
- gtk_table_set_row_spacings (GTK_TABLE (wtable), 5);
- gtk_table_set_col_spacings (GTK_TABLE (wtable), 5);
- gtk_box_pack_start (GTK_BOX (whbox), wtable, FALSE, FALSE, GNOME_PAD);
+ /* Format line */
+ whbox = gl_hig_hbox_new();
+ gl_hig_category_add_widget (GL_HIG_CATEGORY (wframe), whbox);
wlabel = gtk_label_new (_("Format:"));
+ gtk_size_group_add_widget (label_size_group, wlabel);
gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 0, 1);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wlabel);
wcombo = gtk_combo_new ();
- gtk_widget_set_usize (wcombo, 400, -1);
texts = gl_merge_get_long_texts_list ();
gtk_combo_set_popdown_strings (GTK_COMBO (wcombo), texts);
gl_merge_free_long_texts_list (&texts);
data->type_entry = GTK_COMBO (wcombo)->entry;
gtk_entry_set_editable (GTK_ENTRY (data->type_entry), FALSE);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wcombo, 1, 2, 0, 1);
gtk_entry_set_text (GTK_ENTRY (data->type_entry),
gl_merge_type_to_long_text (type));
+ gl_hig_hbox_add_widget_justify (GL_HIG_HBOX(whbox), wcombo);
+
+ whbox = gl_hig_hbox_new();
+ gl_hig_category_add_widget (GL_HIG_CATEGORY (wframe), whbox);
+ /* Location line */
wlabel = gtk_label_new (_("Location:"));
+ gtk_size_group_add_widget (label_size_group, wlabel);
gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wlabel);
data->src_entry = gl_merge_ui_src_new ();
- gtk_table_attach_defaults (GTK_TABLE (wtable), data->src_entry, 1, 2, 1,
- 2);
gl_merge_ui_src_set_type (GL_MERGE_UI_SRC (data->src_entry), type);
gl_merge_ui_src_set_value (GL_MERGE_UI_SRC (data->src_entry), src);
+ gl_hig_hbox_add_widget_justify (GL_HIG_HBOX(whbox), data->src_entry);
- wframe = gtk_frame_new (_("Fields"));
- gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
+ /* ---- Fields section ---- */
+ wframe = gl_hig_category_new (_("Fields"));
+ gl_hig_dialog_add_widget (dialog, wframe);
wscroll = gtk_scrolled_window_new (NULL, NULL);
gtk_container_set_border_width (GTK_CONTAINER (wscroll), 5);
- gtk_widget_set_usize (wscroll, 500, 300);
+ gtk_widget_set_usize (wscroll, 400, 250);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (wscroll),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (wframe), wscroll);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe), wscroll);
data->field_ws = gl_merge_ui_field_ws_new ();
gtk_container_set_border_width (GTK_CONTAINER (data->field_ws), 10);
g_signal_connect (G_OBJECT (data->src_entry), "changed",
G_CALLBACK (src_changed_cb), data);
+ gl_merge_free (&merge);
}
/*--------------------------------------------------------------------------*/
/* PRIVATE. response callback. */
/*--------------------------------------------------------------------------*/
static void
-response_cb (GtkDialog * dialog,
+response_cb (glHigDialog * dialog,
gint response,
PropertyDialogPassback * data)
{
#include "view.h"
-extern void gl_merge_properties_dialog (glView * view);
+extern void gl_merge_properties_dialog (glView *view);
#endif
src->type = GL_MERGE_NONE;
src->backend_widget = gtk_label_new (_("N/A"));
gtk_misc_set_alignment (GTK_MISC (src->backend_widget), 0, 0.5);
- gtk_box_pack_start (GTK_BOX (src), src->backend_widget, FALSE, FALSE,
+ gtk_box_pack_start (GTK_BOX (src), src->backend_widget, TRUE, TRUE,
0);
gl_debug (DEBUG_MERGE, "END");
}
gtk_box_pack_start (GTK_BOX (src), src->backend_widget,
- FALSE, FALSE, 0);
+ TRUE, TRUE, 0);
if (GTK_WIDGET_VISIBLE (src)) {
gtk_widget_show_all (src->backend_widget);
(GInstanceInitFunc) gl_prefs_dialog_init
};
- dialog_type = g_type_register_static (GTK_TYPE_DIALOG,
+ dialog_type = g_type_register_static (GL_TYPE_HIG_DIALOG,
"glPrefsDialog",
&dialog_info,
0);
G_CALLBACK (response_cb), NULL);
notebook = gtk_notebook_new ();
- gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dlg)->vbox),
- notebook, TRUE, TRUE, 0);
+ gl_hig_dialog_add_widget (GL_HIG_DIALOG(dlg), notebook);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook),
locale_page (dlg),
static GtkWidget *
locale_page (glPrefsDialog *dlg)
{
- GtkWidget *wlabel, *wvbox, *whbox, *wvbox1, *wframe;
+ GtkWidget *wlabel, *wvbox, *wframe;
GSList *radio_group = NULL;
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_container_set_border_width (GTK_CONTAINER (wvbox), 10);
+ wvbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
wlabel = gtk_label_new (_("Select locale specific behavior."));
- gtk_box_pack_start (GTK_BOX (wvbox), wlabel, FALSE, FALSE, 0);
-
- whbox = gtk_hbox_new (TRUE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (wvbox), whbox, FALSE, FALSE, 0);
+ gtk_misc_set_alignment (GTK_MISC(wlabel), 0.0, 0.0);
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wlabel);
/* ----- Display Units Frame ------------------------------------ */
- wframe = gtk_frame_new (_("Display units"));
- gtk_box_pack_start (GTK_BOX (whbox), wframe, FALSE, TRUE, 0);
-
- wvbox1 = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_container_set_border_width (GTK_CONTAINER (wvbox1), 10);
- gtk_container_add (GTK_CONTAINER (wframe), wvbox1);
+ wframe = gl_hig_category_new (_("Display units"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wframe);
radio_group = NULL;
gtk_radio_button_new_with_label (radio_group, _("Points"));
radio_group =
gtk_radio_button_get_group (GTK_RADIO_BUTTON (dlg->private->units_points_radio));
- gtk_box_pack_start (GTK_BOX (wvbox1), dlg->private->units_points_radio,
- FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->units_points_radio);
dlg->private->units_inches_radio =
gtk_radio_button_new_with_label (radio_group, _("Inches"));
radio_group =
gtk_radio_button_get_group (GTK_RADIO_BUTTON (dlg->private->units_inches_radio));
- gtk_box_pack_start (GTK_BOX (wvbox1), dlg->private->units_inches_radio,
- FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->units_inches_radio);
dlg->private->units_mm_radio =
gtk_radio_button_new_with_label (radio_group, _("Millimeters"));
radio_group =
gtk_radio_button_get_group (GTK_RADIO_BUTTON (dlg->private->units_mm_radio));
- gtk_box_pack_start (GTK_BOX (wvbox1), dlg->private->units_mm_radio,
- FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->units_mm_radio);
/* ----- Page Size Frame ------------------------------------ */
- wframe = gtk_frame_new (_("Default page size"));
- gtk_box_pack_start (GTK_BOX (whbox), wframe, FALSE, TRUE, 0);
-
- wvbox1 = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_container_set_border_width (GTK_CONTAINER (wvbox1), 10);
- gtk_container_add (GTK_CONTAINER (wframe), wvbox1);
+ wframe = gl_hig_category_new (_("Default page size"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wframe);
radio_group = NULL;
radio_group =
gtk_radio_button_get_group (GTK_RADIO_BUTTON
(dlg->private->page_size_us_letter_radio));
- gtk_box_pack_start (GTK_BOX (wvbox1), dlg->private->page_size_us_letter_radio, FALSE,
- FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->page_size_us_letter_radio);
dlg->private->page_size_a4_radio =
gtk_radio_button_new_with_label (radio_group, A4);
radio_group =
gtk_radio_button_get_group (GTK_RADIO_BUTTON (dlg->private->page_size_a4_radio));
- gtk_box_pack_start (GTK_BOX (wvbox1), dlg->private->page_size_a4_radio,
- FALSE, FALSE, 0);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->page_size_a4_radio);
g_signal_connect_swapped (
G_OBJECT(dlg->private->units_points_radio),
static GtkWidget *
object_page (glPrefsDialog *dlg)
{
- GtkWidget *wlabel, *wvbox, *whbox;
+ GtkWidget *wlabel, *wvbox, *wframe;
+ GtkSizeGroup *label_size_group;
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_container_set_border_width (GTK_CONTAINER (wvbox), 10);
+ wvbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
+ label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
wlabel = gtk_label_new (_("Select default properties for new objects."));
- gtk_box_pack_start (GTK_BOX (wvbox), wlabel, FALSE, FALSE, 0);
-
- /* text props entry */
- dlg->private->text =
- gl_wdgt_text_props_new ("Text");
- gtk_box_pack_start (GTK_BOX (wvbox), dlg->private->text,
- FALSE, FALSE, 0);
-
- whbox = gtk_hbox_new (TRUE, GNOME_PAD);
- gtk_box_pack_start (GTK_BOX (wvbox), whbox, FALSE, FALSE, 0);
+ gtk_misc_set_alignment (GTK_MISC(wlabel), 0.0, 0.0);
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wlabel);
+
+ /* ------ text props entry ------ */
+ wframe = gl_hig_category_new (_("Text"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wframe);
+ dlg->private->text = gl_wdgt_text_props_new ();
+ gl_wdgt_text_props_set_label_size_group (GL_WDGT_TEXT_PROPS(dlg->private->text),
+ label_size_group);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->text);
/* ------ Line box ------ */
- dlg->private->line = gl_wdgt_line_new (_("Line"));
- gtk_box_pack_start (GTK_BOX (whbox), dlg->private->line,
- FALSE, TRUE, 0);
+ wframe = gl_hig_category_new (_("Line"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wframe);
+ dlg->private->line = gl_wdgt_line_new ();
+ gl_wdgt_line_set_label_size_group (GL_WDGT_LINE(dlg->private->line),
+ label_size_group);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->line);
/* ------ Fill box ------ */
- dlg->private->fill = gl_wdgt_fill_new (_("Fill"));
- gtk_box_pack_start (GTK_BOX (whbox), dlg->private->fill,
- FALSE, TRUE, 0);
+ wframe = gl_hig_category_new (_("Fill"));
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wframe);
+ dlg->private->fill = gl_wdgt_fill_new ();
+ gl_wdgt_fill_set_label_size_group (GL_WDGT_FILL(dlg->private->fill),
+ label_size_group);
+ gl_hig_category_add_widget (GL_HIG_CATEGORY(wframe),
+ dlg->private->fill);
g_signal_connect_swapped (G_OBJECT(dlg->private->text),
"changed",
#define __PREFS_DIALOG_H__
#include <gtk/gtk.h>
+#include "hig.h"
#define GL_TYPE_PREFS_DIALOG (gl_prefs_dialog_get_type ())
#define GL_PREFS_DIALOG(obj) (GTK_CHECK_CAST ((obj), GL_TYPE_PREFS_DIALOG, glPrefsDialog))
struct _glPrefsDialog
{
- GtkDialog parent_instance;
+ glHigDialog parent_instance;
glPrefsDialogPrivate *private;
struct _glPrefsDialogClass
{
- GtkDialogClass parent_class;
+ glHigDialogClass parent_class;
};
GtkType gl_prefs_dialog_get_type (void) G_GNUC_CONST;
/* ------ Position Frame ------ */
gl_debug (DEBUG_VIEW, "Creating position entry...");
- view_barcode->private->position = gl_wdgt_position_new (_("Position"));
+ view_barcode->private->position = gl_wdgt_position_new ();
gl_wdgt_position_set_params (GL_WDGT_POSITION (view_barcode->private->position),
x, y,
label_width, label_height);
gtk_label_new (_("Appearance")));
/* ------ Line box ------ */
- view_box->private->line = gl_wdgt_line_new (_("Outline"));
+ view_box->private->line = gl_wdgt_line_new ();
gl_wdgt_line_set_params (GL_WDGT_LINE (view_box->private->line),
line_width,
line_color);
G_CALLBACK(line_changed_cb), view_box);
/* ------ Fill box ------ */
- view_box->private->fill = gl_wdgt_fill_new (_("Fill"));
+ view_box->private->fill = gl_wdgt_fill_new ();
gl_wdgt_fill_set_params (GL_WDGT_FILL (view_box->private->fill),
fill_color);
gtk_box_pack_start (GTK_BOX (wvbox), view_box->private->fill,
gtk_label_new (_("Position/Size")));
/* ------ Position Frame ------ */
- view_box->private->position = gl_wdgt_position_new (_("Position"));
+ view_box->private->position = gl_wdgt_position_new ();
gl_wdgt_position_set_params (GL_WDGT_POSITION (view_box->private->position),
x, y,
label_width, label_height);
gtk_label_new (_("Appearance")));
/* ------ Line ellipse ------ */
- view_ellipse->private->line = gl_wdgt_line_new (_("Outline"));
+ view_ellipse->private->line = gl_wdgt_line_new ();
gl_wdgt_line_set_params (GL_WDGT_LINE (view_ellipse->private->line),
line_width,
line_color);
G_CALLBACK(line_changed_cb), view_ellipse);
/* ------ Fill ellipse ------ */
- view_ellipse->private->fill = gl_wdgt_fill_new (_("Fill"));
+ view_ellipse->private->fill = gl_wdgt_fill_new ();
gl_wdgt_fill_set_params (GL_WDGT_FILL (view_ellipse->private->fill),
fill_color);
gtk_box_pack_start (GTK_BOX (wvbox), view_ellipse->private->fill,
gtk_label_new (_("Position/Size")));
/* ------ Position Frame ------ */
- view_ellipse->private->position = gl_wdgt_position_new (_("Position"));
+ view_ellipse->private->position = gl_wdgt_position_new ();
gl_wdgt_position_set_params (GL_WDGT_POSITION (view_ellipse->private->position),
x, y,
label_width, label_height);
gtk_label_new (_("Position/Size")));
/* ------ Position Frame ------ */
- view_image->private->position = gl_wdgt_position_new (_("Position"));
+ view_image->private->position = gl_wdgt_position_new ();
gl_wdgt_position_set_params (GL_WDGT_POSITION (view_image->private->position),
x, y,
label_width, label_height);
gtk_label_new (_("Appearance")));
/* ------ Line line ------ */
- view_line->private->line = gl_wdgt_line_new (_("Outline"));
+ view_line->private->line = gl_wdgt_line_new ();
gl_wdgt_line_set_params (GL_WDGT_LINE (view_line->private->line),
line_width,
line_color);
gtk_label_new (_("Position/Size")));
/* ------ Position Frame ------ */
- view_line->private->position = gl_wdgt_position_new (_("Position"));
+ view_line->private->position = gl_wdgt_position_new ();
gl_wdgt_position_set_params (GL_WDGT_POSITION (view_line->private->position),
x, y,
label_width, label_height);
#include "view-text.h"
#include "canvas-hacktext.h"
-
#include "view-highlight.h"
-
#include "glabels.h"
#include "wdgt-text-entry.h"
#include "wdgt-text-props.h"
#include "wdgt-position.h"
#include "color.h"
#include "prefs.h"
+#include "hig.h"
#include "pixmaps/cursor_text.xbm"
#include "pixmaps/cursor_text_mask.xbm"
guint color;
GtkJustification just;
glMerge *merge;
+ GtkSizeGroup *label_size_group;
gl_debug (DEBUG_VIEW, "START");
/* Build dialog with notebook. */
/*-----------------------------------------------------------------*/
gl_debug (DEBUG_VIEW, "Creating dialog...");
- dialog = gtk_dialog_new_with_buttons ( _("Edit text object properties"),
- GTK_WINDOW (win),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_CLOSE,
+ dialog = gl_hig_dialog_new_with_buttons ( _("Edit text object properties"),
+ GTK_WINDOW (win),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_STOCK_CLOSE,
GTK_RESPONSE_CLOSE,
- NULL );
+ NULL );
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (response_cb), view_text);
notebook = gtk_notebook_new ();
- gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox),
- notebook, TRUE, TRUE, 0);
+ gl_hig_dialog_add_widget (GL_HIG_DIALOG(dialog), notebook);
+ label_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
/*---------------------------*/
/* Text Notebook Tab */
/*---------------------------*/
gl_debug (DEBUG_VIEW, "Creating text tab...");
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
- gtk_container_set_border_width (GTK_CONTAINER (wvbox), 10);
+ wvbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), wvbox,
gtk_label_new (_("Text")));
/* text entry */
gl_debug (DEBUG_VIEW, "Creating text entry...");
view_text->private->text_entry =
- gl_wdgt_text_entry_new ("Text", merge->field_defs);
- gl_debug (DEBUG_VIEW, "1");
+ gl_wdgt_text_entry_new (merge->field_defs);
gl_wdgt_text_entry_set_text (GL_WDGT_TEXT_ENTRY(view_text->private->text_entry),
(merge->type != GL_MERGE_NONE),
lines);
- gl_debug (DEBUG_VIEW, "2");
- gtk_box_pack_start (GTK_BOX (wvbox), view_text->private->text_entry,
- FALSE, FALSE, 0);
- gl_debug (DEBUG_VIEW, "3");
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox),
+ view_text->private->text_entry);
g_signal_connect ( G_OBJECT(view_text->private->text_entry),
"changed", G_CALLBACK (text_entry_changed_cb),
view_text);
/* Text Props Notebook Tab */
/*---------------------------*/
gl_debug (DEBUG_VIEW, "Creating props tab...");
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
+ wvbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
gtk_container_set_border_width (GTK_CONTAINER (wvbox), 10);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), wvbox,
gtk_label_new (_("Appearance")));
/* text props entry */
gl_debug (DEBUG_VIEW, "Creating props entry...");
- view_text->private->text_props =
- gl_wdgt_text_props_new ("Text Properties");
+ view_text->private->text_props = gl_wdgt_text_props_new ();
+ gl_wdgt_text_props_set_label_size_group (GL_WDGT_TEXT_PROPS(view_text->private->text_props),
+ label_size_group);
gl_wdgt_text_props_set_params (GL_WDGT_TEXT_PROPS(view_text->private->text_props),
font_family, font_size, font_weight,
font_italic_flag, color, just);
- gtk_box_pack_start (GTK_BOX (wvbox), view_text->private->text_props,
- FALSE, FALSE, 0);
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox),
+ view_text->private->text_props);
g_signal_connect ( G_OBJECT(view_text->private->text_props),
"changed", G_CALLBACK (text_props_changed_cb),
view_text);
/* Position/Size Notebook Tab */
/*----------------------------*/
gl_debug (DEBUG_VIEW, "Creating position tab...");
- wvbox = gtk_vbox_new (FALSE, GNOME_PAD);
+ wvbox = gl_hig_vbox_new (GL_HIG_VBOX_OUTER);
gtk_container_set_border_width (GTK_CONTAINER (wvbox), 10);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), wvbox,
gtk_label_new (_("Position")));
/* ------ Position Frame ------ */
gl_debug (DEBUG_VIEW, "Creating position entry...");
- view_text->private->position = gl_wdgt_position_new (_("Position"));
+ view_text->private->position = gl_wdgt_position_new ();
gl_wdgt_position_set_params (GL_WDGT_POSITION (view_text->private->position),
x, y,
label_width, label_height);
- gtk_box_pack_start (GTK_BOX (wvbox),
- view_text->private->position,
- FALSE, FALSE, 0);
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox),
+ view_text->private->position);
g_signal_connect (G_OBJECT (view_text->private->position),
"changed",
G_CALLBACK(position_changed_cb), view_text);
/*---------------------------------------------------------------------------*/
static void
response_cb (GtkDialog *dialog,
- gint response,
- glViewText *view_text)
+ gint response,
+ glViewText *view_text)
{
gl_debug (DEBUG_VIEW, "START");
/* Local function prototypes */
/*===========================================*/
-static void gl_wdgt_fill_class_init (glWdgtFillClass * class);
-static void gl_wdgt_fill_instance_init (glWdgtFill * fill);
-static void gl_wdgt_fill_finalize (GObject * object);
-static void gl_wdgt_fill_construct (glWdgtFill * fill, gchar * label);
-static void changed_cb (glWdgtFill * fill);
+static void gl_wdgt_fill_class_init (glWdgtFillClass *class);
+static void gl_wdgt_fill_instance_init (glWdgtFill *fill);
+static void gl_wdgt_fill_finalize (GObject *object);
+static void gl_wdgt_fill_construct (glWdgtFill *fill);
+
+static void changed_cb (glWdgtFill *fill);
+
\f
-/*================================================================*/
-/* Boilerplate Object stuff. */
-/*================================================================*/
+/****************************************************************************/
+/* Boilerplate Object stuff. */
+/****************************************************************************/
guint
gl_wdgt_fill_get_type (void)
{
};
wdgt_fill_type =
- g_type_register_static (gtk_vbox_get_type (),
+ g_type_register_static (gl_hig_vbox_get_type (),
"glWdgtFill",
&wdgt_fill_info, 0);
}
}
static void
-gl_wdgt_fill_class_init (glWdgtFillClass * class)
+gl_wdgt_fill_class_init (glWdgtFillClass *class)
{
GObjectClass *object_class;
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_vbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_fill_finalize;
}
static void
-gl_wdgt_fill_instance_init (glWdgtFill * fill)
+gl_wdgt_fill_instance_init (glWdgtFill *fill)
{
fill->color_picker = NULL;
}
static void
-gl_wdgt_fill_finalize (GObject * object)
+gl_wdgt_fill_finalize (GObject *object)
{
glWdgtFill *fill;
glWdgtFillClass *class;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
+/****************************************************************************/
+/* New widget. */
+/****************************************************************************/
GtkWidget *
-gl_wdgt_fill_new (gchar * label)
+gl_wdgt_fill_new (void)
{
glWdgtFill *fill;
fill = g_object_new (gl_wdgt_fill_get_type (), NULL);
- gl_wdgt_fill_construct (fill, label);
+ gl_wdgt_fill_construct (fill);
return GTK_WIDGET (fill);
}
-\f
-/*============================================================*/
-/* Construct composite widget. */
-/*============================================================*/
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Construct composite widget. */
+/*--------------------------------------------------------------------------*/
static void
-gl_wdgt_fill_construct (glWdgtFill * fill,
- gchar * label)
+gl_wdgt_fill_construct (glWdgtFill *fill)
{
- GtkWidget *wvbox, *wframe, *wtable, *wlabel;
+ GtkWidget *wvbox, *whbox;
wvbox = GTK_WIDGET (fill);
- wframe = gtk_frame_new (label);
- gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
-
- wtable = gtk_table_new (1, 3, TRUE);
- gtk_container_set_border_width (GTK_CONTAINER (wtable), 10);
- gtk_table_set_row_spacings (GTK_TABLE (wtable), 5);
- gtk_table_set_col_spacings (GTK_TABLE (wtable), 5);
- gtk_container_add (GTK_CONTAINER (wframe), wtable);
+ /* ---- Line color line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* Fill Color Label */
- wlabel = gtk_label_new (_("Color:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_label_set_justify (GTK_LABEL (wlabel), GTK_JUSTIFY_RIGHT);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 0, 1);
+ fill->color_label = gtk_label_new (_("Color:"));
+ gtk_misc_set_alignment (GTK_MISC (fill->color_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), fill->color_label);
/* Fill Color picker widget */
fill->color_picker = gnome_color_picker_new ();
g_signal_connect_swapped (G_OBJECT (fill->color_picker), "color_set",
G_CALLBACK (changed_cb),
G_OBJECT (fill));
- gtk_table_attach_defaults (GTK_TABLE (wtable), fill->color_picker, 1, 3,
- 0, 1);
-
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), fill->color_picker);
}
/*--------------------------------------------------------------------------*/
/* PRIVATE. Callback for when any control in the widget has changed. */
/*--------------------------------------------------------------------------*/
static void
-changed_cb (glWdgtFill * fill)
+changed_cb (glWdgtFill *fill)
{
/* Emit our "changed" signal */
g_signal_emit (G_OBJECT (fill), wdgt_fill_signals[CHANGED], 0);
}
-\f
-/*====================================================================*/
-/* query values from controls. */
-/*====================================================================*/
+
+/****************************************************************************/
+/* query values from controls. */
+/****************************************************************************/
void
-gl_wdgt_fill_get_params (glWdgtFill * fill,
- guint * color)
+gl_wdgt_fill_get_params (glWdgtFill *fill,
+ guint *color)
{
guint8 r, g, b, a;
*color = GL_COLOR_A (r, g, b, a);
}
-/*====================================================================*/
-/* fill in values and ranges for controls. */
-/*====================================================================*/
+/****************************************************************************/
+/* fill in values and ranges for controls. */
+/****************************************************************************/
void
-gl_wdgt_fill_set_params (glWdgtFill * fill,
- guint color)
+gl_wdgt_fill_set_params (glWdgtFill *fill,
+ guint color)
{
gnome_color_picker_set_i8 (GNOME_COLOR_PICKER (fill->color_picker),
GL_COLOR_I_RED (color),
GL_COLOR_I_BLUE (color),
GL_COLOR_I_ALPHA (color));
}
+
+/****************************************************************************/
+/* Set size group for internal labels */
+/****************************************************************************/
+void
+gl_wdgt_fill_set_label_size_group (glWdgtFill *fill,
+ GtkSizeGroup *label_size_group)
+{
+ gtk_size_group_add_widget (label_size_group, fill->color_label);
+}
+
#include <gnome.h>
#include "label.h"
+#include "hig.h"
+
+G_BEGIN_DECLS
#define GL_TYPE_WDGT_FILL (gl_wdgt_fill_get_type ())
#define GL_WDGT_FILL(obj) \
typedef struct _glWdgtFillClass glWdgtFillClass;
struct _glWdgtFill {
- GtkVBox parent_widget;
+ glHigVBox parent_widget;
+ GtkWidget *color_label;
GtkWidget *color_picker;
};
struct _glWdgtFillClass {
- GtkVBoxClass parent_class;
+ glHigVBoxClass parent_class;
void (*changed) (glWdgtFill * fill, gpointer user_data);
};
-extern guint gl_wdgt_fill_get_type (void);
+guint gl_wdgt_fill_get_type (void);
+
+GtkWidget *gl_wdgt_fill_new (void);
+
+void gl_wdgt_fill_get_params (glWdgtFill *fill,
+ guint *color);
-extern GtkWidget *gl_wdgt_fill_new (gchar * label);
+void gl_wdgt_fill_set_params (glWdgtFill *fill,
+ guint color);
-extern void gl_wdgt_fill_get_params (glWdgtFill * fill, guint * color);
+void gl_wdgt_fill_set_label_size_group (glWdgtFill *fill,
+ GtkSizeGroup *label_size_group);
-extern void gl_wdgt_fill_set_params (glWdgtFill * fill, guint color);
+G_END_DECLS
#endif
/* Local function prototypes */
/*===========================================*/
-static void gl_wdgt_line_class_init (glWdgtLineClass * class);
-static void gl_wdgt_line_instance_init (glWdgtLine * line);
-static void gl_wdgt_line_finalize (GObject * object);
-static void gl_wdgt_line_construct (glWdgtLine * line, gchar * label);
-static void changed_cb (glWdgtLine * line);
+static void gl_wdgt_line_class_init (glWdgtLineClass *class);
+static void gl_wdgt_line_instance_init (glWdgtLine *line);
+static void gl_wdgt_line_finalize (GObject *object);
+static void gl_wdgt_line_construct (glWdgtLine *line);
+
+static void changed_cb (glWdgtLine *line);
\f
-/*================================================================*/
-/* Boilerplate Object stuff. */
-/*================================================================*/
+/****************************************************************************/
+/* Boilerplate Object stuff. */
+/****************************************************************************/
guint
gl_wdgt_line_get_type (void)
{
};
wdgt_line_type =
- g_type_register_static (gtk_vbox_get_type (),
+ g_type_register_static (gl_hig_vbox_get_type (),
"glWdgtLine",
&wdgt_line_info, 0);
}
}
static void
-gl_wdgt_line_class_init (glWdgtLineClass * class)
+gl_wdgt_line_class_init (glWdgtLineClass *class)
{
GObjectClass *object_class;
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_vbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_line_finalize;
}
static void
-gl_wdgt_line_instance_init (glWdgtLine * line)
+gl_wdgt_line_instance_init (glWdgtLine *line)
{
line->width_spin = NULL;
line->color_picker = NULL;
}
static void
-gl_wdgt_line_finalize (GObject * object)
+gl_wdgt_line_finalize (GObject *object)
{
glWdgtLine *line;
glWdgtLineClass *class;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
+/****************************************************************************/
+/* New widget. */
+/****************************************************************************/
GtkWidget *
-gl_wdgt_line_new (gchar * label)
+gl_wdgt_line_new (void)
{
glWdgtLine *line;
line = g_object_new (gl_wdgt_line_get_type (), NULL);
- gl_wdgt_line_construct (line, label);
+ gl_wdgt_line_construct (line);
return GTK_WIDGET (line);
}
-\f
-/*============================================================*/
-/* Construct composite widget. */
-/*============================================================*/
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Construct composite widget. */
+/*--------------------------------------------------------------------------*/
static void
-gl_wdgt_line_construct (glWdgtLine * line,
- gchar * label)
+gl_wdgt_line_construct (glWdgtLine *line)
{
- GtkWidget *wvbox, *wframe, *wtable, *wlabel;
+ GtkWidget *wvbox, *wframe, *whbox;
GtkObject *adjust;
wvbox = GTK_WIDGET (line);
- wframe = gtk_frame_new (label);
- gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
-
- wtable = gtk_table_new (2, 3, TRUE);
- gtk_container_set_border_width (GTK_CONTAINER (wtable), 10);
- gtk_table_set_row_spacings (GTK_TABLE (wtable), 5);
- gtk_table_set_col_spacings (GTK_TABLE (wtable), 5);
- gtk_container_add (GTK_CONTAINER (wframe), wtable);
+ /* ---- Line width line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* Line Width Label */
- wlabel = gtk_label_new (_("Width:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_label_set_justify (GTK_LABEL (wlabel), GTK_JUSTIFY_RIGHT);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 0, 1);
+ line->width_label = gtk_label_new (_("Width:"));
+ gtk_misc_set_alignment (GTK_MISC (line->width_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), line->width_label);
+
/* Line Width widget */
adjust = gtk_adjustment_new (1.0, 0.25, 4.0, 0.25, 1.0, 1.0);
line->width_spin =
g_signal_connect_swapped (G_OBJECT (line->width_spin), "changed",
G_CALLBACK (changed_cb),
G_OBJECT (line));
- gtk_table_attach_defaults (GTK_TABLE (wtable), line->width_spin, 1, 2,
- 0, 1);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), line->width_spin);
+
/* Line Width units */
line->units_label = gtk_label_new (_("points"));
gtk_misc_set_alignment (GTK_MISC (line->units_label), 0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (wtable), line->units_label,
- 2, 3, 0, 1);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), line->units_label);
+
+ /* ---- Line color line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* Line Color Label */
- wlabel = gtk_label_new (_("Color:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 1, 2);
+ line->color_label = gtk_label_new (_("Color:"));
+ gtk_misc_set_alignment (GTK_MISC (line->color_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), line->color_label);
+
/* Line Color picker widget */
line->color_picker = gnome_color_picker_new ();
g_signal_connect_swapped (G_OBJECT (line->color_picker), "color_set",
G_CALLBACK (changed_cb),
G_OBJECT (line));
- gtk_table_attach_defaults (GTK_TABLE (wtable), line->color_picker, 1, 3,
- 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), line->color_picker);
}
/* PRIVATE. Callback for when any control in the widget has changed. */
/*--------------------------------------------------------------------------*/
static void
-changed_cb (glWdgtLine * line)
+changed_cb (glWdgtLine *line)
{
/* Emit our "changed" signal */
g_signal_emit (G_OBJECT (line), wdgt_line_signals[CHANGED], 0);
}
-\f
-/*====================================================================*/
-/* query values from controls. */
-/*====================================================================*/
+
+/****************************************************************************/
+/* query values from controls. */
+/****************************************************************************/
void
-gl_wdgt_line_get_params (glWdgtLine * line,
- gdouble * width,
- guint * color)
+gl_wdgt_line_get_params (glWdgtLine *line,
+ gdouble *width,
+ guint *color)
{
guint8 r, g, b, a;
*color = GL_COLOR_A (r, g, b, a);
}
-/*====================================================================*/
-/* fill in values and ranges for controls. */
-/*====================================================================*/
+/****************************************************************************/
+/* fill in values and ranges for controls. */
+/****************************************************************************/
void
-gl_wdgt_line_set_params (glWdgtLine * line,
- gdouble width,
- guint color)
+gl_wdgt_line_set_params (glWdgtLine *line,
+ gdouble width,
+ guint color)
{
gtk_spin_button_set_value (GTK_SPIN_BUTTON (line->width_spin), width);
GL_COLOR_I_BLUE (color),
GL_COLOR_I_ALPHA (color));
}
+
+/****************************************************************************/
+/* Set size group for internal labels */
+/****************************************************************************/
+void
+gl_wdgt_line_set_label_size_group (glWdgtLine *line,
+ GtkSizeGroup *label_size_group)
+{
+ gtk_size_group_add_widget (label_size_group, line->width_label);
+ gtk_size_group_add_widget (label_size_group, line->color_label);
+}
+
#include <gnome.h>
#include "label.h"
+#include "hig.h"
+
+G_BEGIN_DECLS
#define GL_TYPE_WDGT_LINE (gl_wdgt_line_get_type ())
#define GL_WDGT_LINE(obj) \
typedef struct _glWdgtLineClass glWdgtLineClass;
struct _glWdgtLine {
- GtkVBox parent_widget;
+ glHigVBox parent_widget;
+ GtkWidget *width_label;
GtkWidget *width_spin;
+
+ GtkWidget *color_label;
GtkWidget *color_picker;
GtkWidget *units_label;
};
struct _glWdgtLineClass {
- GtkVBoxClass parent_class;
+ glHigVBoxClass parent_class;
void (*changed) (glWdgtLine * line, gpointer user_data);
};
-extern guint gl_wdgt_line_get_type (void);
+guint gl_wdgt_line_get_type (void);
+
+GtkWidget *gl_wdgt_line_new (void);
+
+void gl_wdgt_line_get_params (glWdgtLine *line,
+ gdouble *width,
+ guint *color);
-extern GtkWidget *gl_wdgt_line_new (gchar * label);
+void gl_wdgt_line_set_params (glWdgtLine *line,
+ gdouble width,
+ guint color);
-extern void gl_wdgt_line_get_params (glWdgtLine * line,
- gdouble * width,
- guint * color);
+void gl_wdgt_line_set_label_size_group (glWdgtLine *line,
+ GtkSizeGroup *label_size_group);
-extern void gl_wdgt_line_set_params (glWdgtLine * line,
- gdouble width,
- guint color);
+G_END_DECLS
#endif
/* Private globals */
/*===========================================*/
-static GObjectClass *parent_class;
+static glHigVBoxClass *parent_class;
static gint wdgt_position_signals[LAST_SIGNAL] = { 0 };
\f
/* Local function prototypes */
/*===========================================*/
-static void gl_wdgt_position_class_init (glWdgtPositionClass * class);
-static void gl_wdgt_position_instance_init (glWdgtPosition * position);
-static void gl_wdgt_position_finalize (GObject * object);
-static void gl_wdgt_position_construct (glWdgtPosition * position,
- gchar * label);
-static void changed_cb (glWdgtPosition * position);
+static void gl_wdgt_position_class_init (glWdgtPositionClass *class);
+static void gl_wdgt_position_instance_init (glWdgtPosition *position);
+static void gl_wdgt_position_finalize (GObject *object);
+static void gl_wdgt_position_construct (glWdgtPosition *position);
+
+static void changed_cb (glWdgtPosition *position);
+
\f
-/*================================================================*/
-/* Boilerplate Object stuff. */
-/*================================================================*/
+/***************************************************************************/
+/* Boilerplate Object stuff. */
+/***************************************************************************/
guint
gl_wdgt_position_get_type (void)
{
(GInstanceInitFunc) gl_wdgt_position_instance_init,
};
- wdgt_position_type = g_type_register_static (gtk_vbox_get_type (),
- "glWdgtPosition",
- &wdgt_position_info,
- 0);
+ wdgt_position_type =
+ g_type_register_static (gl_hig_vbox_get_type (),
+ "glWdgtPosition",
+ &wdgt_position_info, 0);
}
return wdgt_position_type;
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_vbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_position_finalize;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
+/***************************************************************************/
+/* New widget. */
+/***************************************************************************/
GtkWidget *
-gl_wdgt_position_new (gchar * label)
+gl_wdgt_position_new (void)
{
glWdgtPosition *position;
position = g_object_new (gl_wdgt_position_get_type (), NULL);
- gl_wdgt_position_construct (position, label);
+ gl_wdgt_position_construct (position);
return GTK_WIDGET (position);
}
-\f
-/*============================================================*/
-/* Construct composite widget. */
-/*============================================================*/
+
+/*-------------------------------------------------------------------------*/
+/* PRIVATE. Construct composite widget. */
+/*-------------------------------------------------------------------------*/
static void
-gl_wdgt_position_construct (glWdgtPosition * position,
- gchar * label)
+gl_wdgt_position_construct (glWdgtPosition *position)
{
- GtkWidget *wvbox, *wframe, *wtable, *wlabel;
+ GtkWidget *wvbox, *whbox;
GtkObject *x_adjust, *y_adjust;
const gchar *units_string;
gdouble units_per_point, climb_rate;
wvbox = GTK_WIDGET (position);
- wframe = gtk_frame_new (label);
- gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
-
- wtable = gtk_table_new (2, 3, TRUE);
- gtk_container_set_border_width (GTK_CONTAINER (wtable), 10);
- gtk_table_set_row_spacings (GTK_TABLE (wtable), 5);
- gtk_table_set_col_spacings (GTK_TABLE (wtable), 5);
- gtk_container_add (GTK_CONTAINER (wframe), wtable);
+ /* ---- X line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* X label */
- wlabel = gtk_label_new (_("X:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_label_set_justify (GTK_LABEL (wlabel), GTK_JUSTIFY_RIGHT);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 0, 1);
+ position->x_label = gtk_label_new (_("X:"));
+ gtk_misc_set_alignment (GTK_MISC (position->x_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), position->x_label);
+
/* X spin */
x_adjust = gtk_adjustment_new (0.0, 0.0, 100.0, climb_rate, 10.0, 10.0);
position->x_spin = gtk_spin_button_new (GTK_ADJUSTMENT (x_adjust),
g_signal_connect_swapped (G_OBJECT (position->x_spin), "changed",
G_CALLBACK (changed_cb),
G_OBJECT (position));
- gtk_table_attach_defaults (GTK_TABLE (wtable), position->x_spin,
- 1, 2, 0, 1);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), position->x_spin);
+
+ /* ---- Y line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* Y label */
- wlabel = gtk_label_new (_("Y:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_label_set_justify (GTK_LABEL (wlabel), GTK_JUSTIFY_RIGHT);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 1, 2);
+ position->y_label = gtk_label_new (_("Y:"));
+ gtk_misc_set_alignment (GTK_MISC (position->y_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), position->y_label);
+
/* Y spin */
y_adjust = gtk_adjustment_new (0.0, 0.0, 100.0, climb_rate, 10.0, 10.0);
position->y_spin = gtk_spin_button_new (GTK_ADJUSTMENT (y_adjust),
g_signal_connect_swapped (G_OBJECT (position->y_spin), "changed",
G_CALLBACK (changed_cb),
G_OBJECT (position));
- gtk_table_attach_defaults (GTK_TABLE (wtable), position->y_spin,
- 1, 2, 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), position->y_spin);
/* Units */
position->units_label = gtk_label_new (units_string);
gtk_misc_set_alignment (GTK_MISC (position->units_label), 0, 0.5);
- gtk_table_attach_defaults (GTK_TABLE (wtable),
- position->units_label, 2, 3, 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), position->units_label);
gl_debug (DEBUG_WDGT, "END");
}
/* PRIVATE. Callback for when any control in the widget has changed. */
/*--------------------------------------------------------------------------*/
static void
-changed_cb (glWdgtPosition * position)
+changed_cb (glWdgtPosition *position)
{
/* Emit our "changed" signal */
g_signal_emit (G_OBJECT (position), wdgt_position_signals[CHANGED], 0);
}
-\f
-/*====================================================================*/
-/* query values from controls. */
-/*====================================================================*/
+
+/***************************************************************************/
+/* query values from controls. */
+/***************************************************************************/
void
-gl_wdgt_position_get_position (glWdgtPosition * position,
- gdouble * x,
- gdouble * y)
+gl_wdgt_position_get_position (glWdgtPosition *position,
+ gdouble *x,
+ gdouble *y)
{
gdouble units_per_point;
*y /= units_per_point;
}
-/*====================================================================*/
-/* fill in values and ranges for controls. */
-/*====================================================================*/
+/***************************************************************************/
+/* fill in values and ranges for controls. */
+/***************************************************************************/
void
-gl_wdgt_position_set_params (glWdgtPosition * position,
- gdouble x,
- gdouble y,
- gdouble x_max,
- gdouble y_max)
+gl_wdgt_position_set_params (glWdgtPosition *position,
+ gdouble x,
+ gdouble y,
+ gdouble x_max,
+ gdouble y_max)
{
GtkObject *x_adjust, *y_adjust;
const gchar *units_string;
}
-/*====================================================================*/
-/* fill in position info only. */
-/*====================================================================*/
+/***************************************************************************/
+/* fill in position info only. */
+/***************************************************************************/
void
-gl_wdgt_position_set_position (glWdgtPosition * position,
- gdouble x,
- gdouble y)
+gl_wdgt_position_set_position (glWdgtPosition *position,
+ gdouble x,
+ gdouble y)
{
gdouble units_per_point;
gl_debug (DEBUG_WDGT, "END");
}
+
+/****************************************************************************/
+/* Set size group for internal labels */
+/****************************************************************************/
+void
+gl_wdgt_position_set_label_size_group (glWdgtPosition *position,
+ GtkSizeGroup *label_size_group)
+{
+ gtk_size_group_add_widget (label_size_group, position->x_label);
+ gtk_size_group_add_widget (label_size_group, position->y_label);
+}
+
#include <gnome.h>
#include "label.h"
+#include "hig.h"
+
+G_BEGIN_DECLS
#define GL_TYPE_WDGT_POSITION (gl_wdgt_position_get_type ())
#define GL_WDGT_POSITION(obj) \
typedef struct _glWdgtPositionClass glWdgtPositionClass;
struct _glWdgtPosition {
- GtkVBox parent_widget;
+ glHigVBox parent_widget;
+ GtkWidget *x_label;
GtkWidget *x_spin;
+
+ GtkWidget *y_label;
GtkWidget *y_spin;
+
GtkWidget *units_label;
};
struct _glWdgtPositionClass {
- GtkVBoxClass parent_class;
+ glHigVBoxClass parent_class;
void (*changed) (glWdgtPosition * prop, gpointer user_data);
};
-extern guint gl_wdgt_position_get_type (void);
+guint gl_wdgt_position_get_type (void);
+
+GtkWidget *gl_wdgt_position_new (void);
+
+void gl_wdgt_position_get_position (glWdgtPosition *position,
+ gdouble *x,
+ gdouble *y);
-extern GtkWidget *gl_wdgt_position_new (gchar * label);
+void gl_wdgt_position_set_params (glWdgtPosition *position,
+ gdouble x,
+ gdouble y,
+ gdouble x_max,
+ gdouble y_max);
-extern void gl_wdgt_position_get_position (glWdgtPosition * position,
- gdouble * x, gdouble * y);
+void gl_wdgt_position_set_position (glWdgtPosition *position,
+ gdouble x,
+ gdouble y);
-extern void gl_wdgt_position_set_params (glWdgtPosition * position,
- gdouble x, gdouble y,
- gdouble x_max, gdouble y_max);
+void gl_wdgt_position_set_label_size_group (glWdgtPosition *position,
+ GtkSizeGroup *size_group);
-extern void gl_wdgt_position_set_position (glWdgtPosition * position,
- gdouble x, gdouble y);
+G_END_DECLS
#endif
/* Private globals */
/*===========================================*/
-static GtkContainerClass *parent_class;
+static glHigVBoxClass *parent_class;
static gint wdgt_text_entry_signals[LAST_SIGNAL] = { 0 };
/* Local function prototypes */
/*===========================================*/
-static void gl_wdgt_text_entry_class_init (glWdgtTextEntryClass * class);
-static void gl_wdgt_text_entry_instance_init (glWdgtTextEntry * text_entry);
-static void gl_wdgt_text_entry_finalize (GObject * object);
-static void gl_wdgt_text_entry_construct (glWdgtTextEntry * text_entry,
- gchar * label, GList * field_defs);
+static void gl_wdgt_text_entry_class_init (glWdgtTextEntryClass *class);
+static void gl_wdgt_text_entry_instance_init (glWdgtTextEntry *text_entry);
+static void gl_wdgt_text_entry_finalize (GObject *object);
+static void gl_wdgt_text_entry_construct (glWdgtTextEntry *text_entry,
+ GList *field_defs);
-static void changed_cb (glWdgtTextEntry * text_entry);
-static void insert_cb (glWdgtTextEntry * text_entry);
+static void changed_cb (glWdgtTextEntry *text_entry);
+static void insert_cb (glWdgtTextEntry *text_entry);
\f
-/*================================================================*/
-/* Boilerplate Object stuff. */
-/*================================================================*/
+/****************************************************************************/
+/* Boilerplate Object stuff. */
+/****************************************************************************/
guint
gl_wdgt_text_entry_get_type (void)
{
(GInstanceInitFunc) gl_wdgt_text_entry_instance_init,
};
- wdgt_text_entry_type = g_type_register_static (gtk_vbox_get_type (),
- "glWdgtTextEntry",
- &wdgt_text_entry_info,
- 0);
+ wdgt_text_entry_type =
+ g_type_register_static (gl_hig_vbox_get_type (),
+ "glWdgtTextEntry",
+ &wdgt_text_entry_info, 0);
}
return wdgt_text_entry_type;
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_vbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_text_entry_finalize;
}
static void
-gl_wdgt_text_entry_instance_init (glWdgtTextEntry * text_entry)
+gl_wdgt_text_entry_instance_init (glWdgtTextEntry *text_entry)
{
gl_debug (DEBUG_WDGT, "START");
}
static void
-gl_wdgt_text_entry_finalize (GObject * object)
+gl_wdgt_text_entry_finalize (GObject *object)
{
- glWdgtTextEntry *text_entry;
+ glWdgtTextEntry *text_entry;
glWdgtTextEntryClass *class;
gl_debug (DEBUG_WDGT, "START");
gl_debug (DEBUG_WDGT, "END");
}
+/****************************************************************************/
+/* New widget. */
+/****************************************************************************/
GtkWidget *
-gl_wdgt_text_entry_new (gchar * label,
- GList * field_defs)
+gl_wdgt_text_entry_new (GList *field_defs)
{
glWdgtTextEntry *text_entry;
text_entry = g_object_new (gl_wdgt_text_entry_get_type (), NULL);
- gl_wdgt_text_entry_construct (text_entry, label, field_defs);
+ gl_wdgt_text_entry_construct (text_entry, field_defs);
gl_debug (DEBUG_WDGT, "END");
return GTK_WIDGET (text_entry);
}
-/*============================================================*/
-/* Construct composite widget. */
-/*============================================================*/
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Construct composite widget. */
+/*--------------------------------------------------------------------------*/
static void
-gl_wdgt_text_entry_construct (glWdgtTextEntry * text_entry,
- gchar * label,
- GList * field_defs)
+gl_wdgt_text_entry_construct (glWdgtTextEntry *text_entry,
+ GList *field_defs)
{
- GtkWidget *wvbox, *wframe, *wtable, *wlabel, *wcombo;
+ GtkWidget *wvbox, *whbox, *wlabel, *wscroll, *wcombo;
GList *keys;
gl_debug (DEBUG_WDGT, "START");
wvbox = GTK_WIDGET (text_entry);
- wframe = gtk_frame_new (label);
- gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
-
- wtable = gtk_table_new (2, 3, FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (wtable), 10);
- gtk_table_set_row_spacings (GTK_TABLE (wtable), 5);
- gtk_table_set_col_spacings (GTK_TABLE (wtable), 5);
- gtk_container_add (GTK_CONTAINER (wframe), wtable);
+ /* Text Label */
+ wlabel = gtk_label_new (_("Edit text:"));
+ gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wlabel);
/* Actual text entry widget */
+ wscroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_set_size_request (wscroll, -1, 70);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (wscroll),
+ GTK_POLICY_AUTOMATIC,
+ GTK_POLICY_AUTOMATIC);
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), wscroll);
text_entry->text_entry = gtk_text_view_new ();
text_entry->text_buffer =
gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_entry->text_entry));
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (wscroll),
+ text_entry->text_entry);
g_signal_connect_swapped (G_OBJECT (text_entry->text_buffer),
"changed", G_CALLBACK (changed_cb),
G_OBJECT (text_entry));
- gtk_widget_set_size_request (text_entry->text_entry, -1, 70);
- gtk_table_attach_defaults (GTK_TABLE (wtable), text_entry->text_entry,
- 0, 3, 0, 1);
+
+ /* ---- Merge field line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* Insert merge field label */
wlabel = gtk_label_new (_("Key:"));
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wlabel);
/* Key entry widget */
wcombo = gtk_combo_new ();
text_entry->key_entry = GTK_COMBO (wcombo)->entry;
gtk_entry_set_editable (GTK_ENTRY (text_entry->key_entry), FALSE);
gtk_widget_set_size_request (wcombo, 200, -1);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wcombo, 1, 2, 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wcombo);
/* Insert button */
text_entry->insert_button =
g_signal_connect_swapped (G_OBJECT (text_entry->insert_button),
"clicked", G_CALLBACK (insert_cb),
G_OBJECT (text_entry));
- gtk_table_attach_defaults (GTK_TABLE (wtable),
- text_entry->insert_button, 2, 3, 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text_entry->insert_button);
gl_debug (DEBUG_WDGT, "END");
}
gl_debug (DEBUG_WDGT, "END");
}
-/*--------------------------------------------------------------------------*/
+/****************************************************************************/
/* Get widget data. */
-/*--------------------------------------------------------------------------*/
+/****************************************************************************/
GList *
gl_wdgt_text_entry_get_text (glWdgtTextEntry * text_entry)
{
return lines;
}
-/*--------------------------------------------------------------------------*/
+/****************************************************************************/
/* Set widget data. */
-/*--------------------------------------------------------------------------*/
+/****************************************************************************/
void
gl_wdgt_text_entry_set_text (glWdgtTextEntry * text_entry,
gboolean merge_flag,
#define __WDGT_TEXT_ENTRY_H__
#include <gnome.h>
-
#include "merge.h"
+#include "hig.h"
+
+G_BEGIN_DECLS
#define GL_TYPE_WDGT_TEXT_ENTRY (gl_wdgt_text_entry_get_type ())
#define GL_WDGT_TEXT_ENTRY(obj) \
typedef struct _glWdgtTextEntryClass glWdgtTextEntryClass;
struct _glWdgtTextEntry {
- GtkVBox parent_widget;
+ glHigVBox parent_widget;
- GtkWidget *text_entry;
- GtkWidget *key_entry;
- GtkWidget *insert_button;
+ GtkWidget *text_entry;
+ GtkWidget *key_entry;
+ GtkWidget *insert_button;
GtkTextBuffer *text_buffer;
};
struct _glWdgtTextEntryClass {
- GtkVBoxClass parent_class;
+ glHigVBoxClass parent_class;
void (*changed) (glWdgtTextEntry * text_entry, gpointer user_data);
};
-extern guint gl_wdgt_text_entry_get_type (void);
+guint gl_wdgt_text_entry_get_type (void);
+
+GtkWidget *gl_wdgt_text_entry_new (GList *field_defs);
-extern GtkWidget *gl_wdgt_text_entry_new (gchar * label, GList * field_defs);
+GList *gl_wdgt_text_entry_get_text (glWdgtTextEntry *text_entry);
-extern GList *gl_wdgt_text_entry_get_text (glWdgtTextEntry * text_entry);
+void gl_wdgt_text_entry_set_text (glWdgtTextEntry *text_entry,
+ gboolean merge_flag,
+ GList *lines);
-extern void gl_wdgt_text_entry_set_text (glWdgtTextEntry * text_entry,
- gboolean merge_flag,
- GList * lines);
+G_END_DECLS
#endif
/*===========================================*/
static void gl_wdgt_text_props_class_init (glWdgtTextPropsClass *class);
-static void gl_wdgt_text_props_instance_init (glWdgtTextProps *text);
-static void gl_wdgt_text_props_finalize (GObject *object);
-static void gl_wdgt_text_props_construct (glWdgtTextProps *text,
- gchar *label);
+static void gl_wdgt_text_props_instance_init (glWdgtTextProps *text);
+static void gl_wdgt_text_props_finalize (GObject *object);
+static void gl_wdgt_text_props_construct (glWdgtTextProps *text);
+
+static void family_changed_cb (GtkEntry *entry,
+ glWdgtTextProps *text);
-static void family_changed_cb (GtkEntry *entry, glWdgtTextProps *text);
static void changed_cb (glWdgtTextProps *text);
+
static void just_toggled_cb (GtkToggleButton *togglebutton,
- gpointer user_data);
+ gpointer user_data);
\f
-/*================================================================*/
-/* Boilerplate Object stuff. */
-/*================================================================*/
+/*****************************************************************************/
+/* Boilerplate Object stuff. */
+/*****************************************************************************/
guint
gl_wdgt_text_props_get_type (void)
{
};
wdgt_text_props_type =
- g_type_register_static (gtk_vbox_get_type (),
- "glWdgtTextProps", &wdgt_text_props_info, 0);
+ g_type_register_static (gl_hig_vbox_get_type (),
+ "glWdgtTextProps",
+ &wdgt_text_props_info, 0);
}
return wdgt_text_props_type;
object_class = (GObjectClass *) class;
- parent_class = gtk_type_class (gtk_vbox_get_type ());
+ parent_class = g_type_class_peek_parent (class);
object_class->finalize = gl_wdgt_text_props_finalize;
G_OBJECT_CLASS (parent_class)->finalize (object);
}
+/*****************************************************************************/
+/* New widget. */
+/*****************************************************************************/
GtkWidget *
-gl_wdgt_text_props_new (gchar *label)
+gl_wdgt_text_props_new (void)
{
glWdgtTextProps *text;
text = g_object_new (gl_wdgt_text_props_get_type (), NULL);
- gl_wdgt_text_props_construct (text, label);
+ gl_wdgt_text_props_construct (text);
return GTK_WIDGET (text);
}
-\f
-/*============================================================*/
-/* Construct composite widget. */
-/*============================================================*/
+
+/*--------------------------------------------------------------------------*/
+/* PRIVATE. Construct composite widget. */
+/*--------------------------------------------------------------------------*/
static void
-gl_wdgt_text_props_construct (glWdgtTextProps *text,
- gchar *label)
+gl_wdgt_text_props_construct (glWdgtTextProps *text)
{
- GtkWidget *wvbox, *wframe, *wtable, *wlabel, *whbox1, *wcombo;
+ GtkWidget *wvbox, *whbox, *wcombo, *wbhbox;
GList *family_names = NULL;
GtkObject *adjust;
wvbox = GTK_WIDGET (text);
- wframe = gtk_frame_new (label);
- gtk_box_pack_start (GTK_BOX (wvbox), wframe, FALSE, FALSE, 0);
-
- wtable = gtk_table_new (3, 3, FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (wtable), 10);
- gtk_table_set_row_spacings (GTK_TABLE (wtable), 5);
- gtk_table_set_col_spacings (GTK_TABLE (wtable), 5);
- gtk_container_add (GTK_CONTAINER (wframe), wtable);
+ /* ---- Font line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
/* Font label */
- wlabel = gtk_label_new (_("Font:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_label_set_justify (GTK_LABEL (wlabel), GTK_JUSTIFY_RIGHT);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 0, 1);
-
- /* Pack these widgets into an inner hbox */
- whbox1 = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_table_attach_defaults (GTK_TABLE (wtable), whbox1, 1, 3, 0, 1);
+ text->font_label = gtk_label_new (_("Font:"));
+ gtk_misc_set_alignment (GTK_MISC (text->font_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->font_label);
/* Font family entry widget */
wcombo = gtk_combo_new ();
gtk_combo_set_value_in_list (GTK_COMBO(wcombo), TRUE, FALSE);
gtk_entry_set_editable (GTK_ENTRY (text->font_family_entry), FALSE);
gtk_widget_set_size_request (wcombo, 200, -1);
- gtk_box_pack_start (GTK_BOX (whbox1), wcombo, FALSE, FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), wcombo);
g_signal_connect (G_OBJECT (text->font_family_entry),
"changed", G_CALLBACK (family_changed_cb), text);
adjust = gtk_adjustment_new (1.0, 1.0, 250.0, 1.0, 10.0, 10.0);
text->font_size_spin =
gtk_spin_button_new (GTK_ADJUSTMENT (adjust), 1.0, 0);
- gtk_box_pack_start (GTK_BOX (whbox1), text->font_size_spin, FALSE,
- FALSE, 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->font_size_spin);
g_signal_connect_swapped (G_OBJECT (text->font_size_spin), "changed",
G_CALLBACK (changed_cb),
G_OBJECT (text));
gtk_container_add (GTK_CONTAINER (text->font_b_button),
gtk_image_new_from_stock (GTK_STOCK_BOLD,
GTK_ICON_SIZE_BUTTON));
- gtk_box_pack_start (GTK_BOX (whbox1), text->font_b_button, FALSE, FALSE,
- 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->font_b_button);
g_signal_connect_swapped (G_OBJECT (text->font_b_button), "toggled",
G_CALLBACK (changed_cb),
G_OBJECT (text));
gtk_container_add (GTK_CONTAINER (text->font_i_button),
gtk_image_new_from_stock (GTK_STOCK_ITALIC,
GTK_ICON_SIZE_BUTTON));
- gtk_box_pack_start (GTK_BOX (whbox1), text->font_i_button, FALSE, FALSE,
- 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->font_i_button);
g_signal_connect_swapped (G_OBJECT (text->font_i_button), "toggled",
G_CALLBACK (changed_cb),
G_OBJECT (text));
+ /* ---- Color line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
+
/* Text Color Label */
- wlabel = gtk_label_new (_("Color:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_label_set_justify (GTK_LABEL (wlabel), GTK_JUSTIFY_RIGHT);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 1, 2);
+ text->color_label = gtk_label_new (_("Color:"));
+ gtk_misc_set_alignment (GTK_MISC (text->color_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->color_label);
/* Text Color picker widget */
text->color_picker = gnome_color_picker_new ();
g_signal_connect_swapped (G_OBJECT (text->color_picker), "color_set",
G_CALLBACK (changed_cb),
G_OBJECT (text));
- gtk_table_attach_defaults (GTK_TABLE (wtable), text->color_picker, 1, 2,
- 1, 2);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->color_picker);
- /* Alignment label */
- wlabel = gtk_label_new (_("Alignment:"));
- gtk_misc_set_alignment (GTK_MISC (wlabel), 0, 0.5);
- gtk_label_set_justify (GTK_LABEL (wlabel), GTK_JUSTIFY_RIGHT);
- gtk_table_attach_defaults (GTK_TABLE (wtable), wlabel, 0, 1, 2, 3);
+ /* ---- Alignment line ---- */
+ whbox = gl_hig_hbox_new ();
+ gl_hig_vbox_add_widget (GL_HIG_VBOX(wvbox), whbox);
- /* Pack these widgets into an inner hbox */
- whbox1 = gtk_hbox_new (FALSE, GNOME_PAD);
- gtk_table_attach_defaults (GTK_TABLE (wtable), whbox1, 1, 2, 2, 3);
+ /* Alignment label */
+ text->alignment_label = gtk_label_new (_("Alignment:"));
+ gtk_misc_set_alignment (GTK_MISC (text->alignment_label), 0, 0.5);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->alignment_label);
/* Justification entry widget */
text->left_button = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (text->left_button),
gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_LEFT,
GTK_ICON_SIZE_BUTTON));
- gtk_box_pack_start (GTK_BOX (whbox1), text->left_button, FALSE, FALSE,
- 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->left_button);
text->center_button = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (text->center_button),
gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_CENTER,
GTK_ICON_SIZE_BUTTON));
- gtk_box_pack_start (GTK_BOX (whbox1), text->center_button, FALSE, FALSE,
- 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->center_button);
text->right_button = gtk_toggle_button_new ();
gtk_container_add (GTK_CONTAINER (text->right_button),
gtk_image_new_from_stock (GTK_STOCK_JUSTIFY_RIGHT,
GTK_ICON_SIZE_BUTTON));
- gtk_box_pack_start (GTK_BOX (whbox1), text->right_button, FALSE, FALSE,
- 0);
+ gl_hig_hbox_add_widget (GL_HIG_HBOX(whbox), text->right_button);
/* Now connect a callback that makes these toggles mutually exclusive */
g_signal_connect (G_OBJECT (text->left_button), "toggled",
/*--------------------------------------------------------------------------*/
static void
just_toggled_cb (GtkToggleButton *togglebutton,
- gpointer user_data)
+ gpointer user_data)
{
glWdgtTextProps *text = GL_WDGT_TEXT_PROPS (user_data);
g_signal_emit (G_OBJECT (text), wdgt_text_props_signals[CHANGED], 0);
}
\f
-/*====================================================================*/
-/* query values from controls. */
-/*====================================================================*/
+/*****************************************************************************/
+/* query values from controls. */
+/*****************************************************************************/
void
gl_wdgt_text_props_get_params (glWdgtTextProps *text,
gchar **font_family,
}
-/*====================================================================*/
-/* fill in values and ranges for controls. */
-/*====================================================================*/
+/*****************************************************************************/
+/* fill in values and ranges for controls. */
+/*****************************************************************************/
void
gl_wdgt_text_props_set_params (glWdgtTextProps *text,
gchar *font_family,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (text->right_button),
(just == GTK_JUSTIFY_RIGHT));
}
+
+/*****************************************************************************/
+/* Set size group for internal labels */
+/*****************************************************************************/
+void
+gl_wdgt_text_props_set_label_size_group (glWdgtTextProps *text,
+ GtkSizeGroup *label_size_group)
+{
+ gtk_size_group_add_widget (label_size_group, text->font_label);
+ gtk_size_group_add_widget (label_size_group, text->color_label);
+ gtk_size_group_add_widget (label_size_group, text->alignment_label);
+}
+
#include <gtk/gtk.h>
#include <libgnomeprint/gnome-font.h>
#include "label.h"
+#include "hig.h"
+
+G_BEGIN_DECLS
#define GL_TYPE_WDGT_TEXT_PROPS (gl_wdgt_text_props_get_type ())
#define GL_WDGT_TEXT_PROPS(obj) \
typedef struct _glWdgtTextPropsClass glWdgtTextPropsClass;
struct _glWdgtTextProps {
- GtkVBox parent_widget;
+ glHigVBox parent_widget;
+ GtkWidget *font_label;
GtkWidget *font_family_entry;
GtkWidget *font_size_spin;
GtkWidget *font_b_button;
GtkWidget *font_i_button;
+ GtkWidget *color_label;
GtkWidget *color_picker;
+ GtkWidget *alignment_label;
GtkWidget *left_button, *right_button, *center_button;
};
struct _glWdgtTextPropsClass {
- GtkVBoxClass parent_class;
+ glHigVBoxClass parent_class;
void (*changed) (glWdgtTextProps * text, gpointer user_data);
};
-extern guint gl_wdgt_text_props_get_type (void);
-
-extern GtkWidget *gl_wdgt_text_props_new (gchar * label);
-
-extern void gl_wdgt_text_props_get_params (glWdgtTextProps * text,
- gchar ** font_family,
- gdouble * font_size,
- GnomeFontWeight * font_weight,
- gboolean * font_italic_flag,
- guint * color,
- GtkJustification * just);
-
-extern void gl_wdgt_text_props_set_params (glWdgtTextProps * text,
- gchar * font_family,
- gdouble font_size,
- GnomeFontWeight font_weight,
- gboolean font_italic_flag,
- guint color,
- GtkJustification just);
+guint gl_wdgt_text_props_get_type (void);
+
+GtkWidget *gl_wdgt_text_props_new (void);
+
+void gl_wdgt_text_props_get_params (glWdgtTextProps *text,
+ gchar **font_family,
+ gdouble *font_size,
+ GnomeFontWeight *font_weight,
+ gboolean *font_italic_flag,
+ guint *color,
+ GtkJustification *just);
+
+void gl_wdgt_text_props_set_params (glWdgtTextProps *text,
+ gchar *font_family,
+ gdouble font_size,
+ GnomeFontWeight font_weight,
+ gboolean font_italic_flag,
+ guint color,
+ GtkJustification just);
+
+void gl_wdgt_text_props_set_label_size_group (glWdgtTextProps *text,
+ GtkSizeGroup *size_grp);
+
+G_END_DECLS
#endif