genius r686 - in trunk: . po src
- From: jirka svn gnome org
- To: svn-commits-list gnome org
- Subject: genius r686 - in trunk: . po src
- Date: Tue, 4 Nov 2008 06:46:52 +0000 (UTC)
Author: jirka
Date: Tue Nov 4 06:46:51 2008
New Revision: 686
URL: http://svn.gnome.org/viewvc/genius?rev=686&view=rev
Log:
Tue Nov 04 00:46:40 2008 Jiri (George) Lebl <jirka 5z com>
* src/graphing.c: add checkbutton to allow for no legends on the
lineplot, useful if I want to just draw myself on the graphs
Modified:
trunk/ChangeLog
trunk/po/cs.po
trunk/src/graphing.c
Modified: trunk/src/graphing.c
==============================================================================
--- trunk/src/graphing.c (original)
+++ trunk/src/graphing.c Tue Nov 4 06:46:51 2008
@@ -107,6 +107,8 @@
static double deft2 = 1.0;
static double deftinc = 0.01;
+static gboolean lineplot_draw_legends = TRUE;
+
/* Replotting info */
static GelEFunc *plot_func[MAXFUNC] = { NULL };
static char *plot_func_name[MAXFUNC] = { NULL };
@@ -1121,7 +1123,8 @@
if (line_plot == NULL)
return;
- if (plot_mode == MODE_LINEPLOT) {
+ if (plot_mode == MODE_LINEPLOT ||
+ ! lineplot_draw_legends) {
gtk_plot_move (GTK_PLOT (line_plot),
PROPORTION_OFFSET,
PROPORTION_OFFSET);
@@ -1130,6 +1133,8 @@
1.0-2*PROPORTION_OFFSET);
gtk_plot_legends_move (GTK_PLOT (line_plot), 0.80, 0.05);
} else if (plot_mode == MODE_LINEPLOT_PARAMETRIC) {
+ /* move plot out of the way if we are in parametric mode and
+ * there is a legend */
gtk_plot_move (GTK_PLOT (line_plot),
PROPORTION_OFFSET,
PROPORTION_OFFSET);
@@ -2414,6 +2419,11 @@
g_free (label);
}
+ if (lineplot_draw_legends)
+ gtk_plot_show_legends (GTK_PLOT (line_plot));
+ else
+ gtk_plot_hide_legends (GTK_PLOT (line_plot));
+
line_plot_move_about ();
/* could be whacked by closing the window or some such */
@@ -2551,7 +2561,7 @@
G_MAXFLOAT,
1,
10,
- 100);
+ 0);
w = gtk_spin_button_new (adj, 1.0, 5);
g_signal_connect (G_OBJECT (w), "activate", entry_activate, NULL);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (w), TRUE);
@@ -2568,7 +2578,7 @@
G_MAXFLOAT,
1,
10,
- 100);
+ 0);
w = gtk_spin_button_new (adj, 1.0, 5);
g_signal_connect (G_OBJECT (w), "activate", entry_activate, NULL);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (w), TRUE);
@@ -2586,7 +2596,7 @@
G_MAXFLOAT,
1,
10,
- 100);
+ 0);
w = gtk_spin_button_new (adj, 1.0, 5);
g_signal_connect (G_OBJECT (w), "activate", entry_activate, NULL);
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (w), TRUE);
@@ -2622,6 +2632,16 @@
return b;
}
+/*option callback*/
+static void
+optioncb (GtkWidget * widget, int *data)
+{
+ if (GTK_TOGGLE_BUTTON (widget)->active)
+ *data = TRUE;
+ else
+ *data = FALSE;
+}
+
static GtkWidget *
create_lineplot_box (void)
{
@@ -2713,6 +2733,15 @@
box,
gtk_label_new_with_mnemonic (_("_Parametric")));
+ w = gtk_check_button_new_with_mnemonic (_("_Draw legend"));
+ gtk_box_pack_start (GTK_BOX (mainbox), w, FALSE, FALSE, 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
+ lineplot_draw_legends);
+ g_signal_connect (G_OBJECT (w), "toggled",
+ G_CALLBACK (optioncb),
+ (gpointer)&lineplot_draw_legends);
+
+
frame = gtk_frame_new (_("Plot Window"));
gtk_box_pack_start (GTK_BOX (mainbox), frame, FALSE, FALSE, 0);
box = gtk_vbox_new(FALSE,GNOME_PAD);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]