Commit e561e28a authored by Jiri (George) Lebl's avatar Jiri (George) Lebl Committed by George Lebl

add checkbutton to allow for no legends on the lineplot, useful if I want


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


svn path=/trunk/; revision=686
parent 4d1a70ed
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
Tue Nov 04 00:19:54 2008 Jiri (George) Lebl <jirka@5z.com>
* src/gnome-genius.c: fix warning
......
......@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: genius VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-11-04 00:26-0600\n"
"POT-Creation-Date: 2008-11-04 00:45-0600\n"
"PO-Revision-Date: 2005-08-05 12:14+0200\n"
"Last-Translator: Miloslav Trmac <mitr@volny.cz>\n"
"Language-Team: Czech <cs@li.org>\n"
......@@ -3123,7 +3123,7 @@ msgstr "_Monitorovat proměnnou"
msgid "Monitor a variable continuously"
msgstr "Kontinuálně monitorovat proměnnou"
#: ../src/gnome-genius.c:313 ../src/graphing.c:3363
#: ../src/gnome-genius.c:313 ../src/graphing.c:3392
msgid "_Plot"
msgstr "_Vykreslit"
......@@ -3203,7 +3203,7 @@ msgstr "Otevřít"
msgid "Open a GEL file for running"
msgstr "Otevřít soubor GEL pro spuštění"
#: ../src/gnome-genius.c:375 ../src/graphing.c:1250
#: ../src/gnome-genius.c:375 ../src/graphing.c:1255
msgid "Plot"
msgstr "Vykreslit"
......@@ -3549,7 +3549,7 @@ msgstr ""
msgid "GEL files"
msgstr "Soubory GEL"
#: ../src/gnome-genius.c:2210 ../src/graphing.c:831
#: ../src/gnome-genius.c:2210 ../src/graphing.c:833
msgid "All files"
msgstr "Všechny soubory"
......@@ -3616,8 +3616,8 @@ msgstr ""
msgid "Save new programs by \"Save As..\" first!"
msgstr "Uložte nové programy použitím \"Uložit jako...\"!"
#: ../src/gnome-genius.c:3211 ../src/gnome-genius.c:3326 ../src/graphing.c:632
#: ../src/graphing.c:734
#: ../src/gnome-genius.c:3211 ../src/gnome-genius.c:3326 ../src/graphing.c:634
#: ../src/graphing.c:736
msgid "File already exists. Overwrite it?"
msgstr "Soubor již existuje. Přepsat jej?"
......@@ -3729,162 +3729,162 @@ msgstr "Matematický nástroj Genius"
msgid "Genius Mathematical Tool and Calculator"
msgstr "Matematický nástroj a kalkulátor Genius"
#: ../src/graphing.c:318
#: ../src/graphing.c:320
msgid "Rotate"
msgstr "Rotovat"
#: ../src/graphing.c:337
#: ../src/graphing.c:339
msgid "Rotate X: "
msgstr "Rotovat X: "
#: ../src/graphing.c:362
#: ../src/graphing.c:364
msgid "Rotate Y: "
msgstr "Rotovat Y: "
#: ../src/graphing.c:387
#: ../src/graphing.c:389
msgid "Rotate Z: "
msgstr "Rotovat Z: "
#: ../src/graphing.c:495
#: ../src/graphing.c:497
msgid "Print"
msgstr "Vytisknout"
#: ../src/graphing.c:512
#: ../src/graphing.c:514
msgid "Print command: "
msgstr "Příkaz tisku: "
#: ../src/graphing.c:539
#: ../src/graphing.c:541
msgid "Cannot open temporary file, cannot print."
msgstr "Nemohu otevřít dočasný soubor, nemohu tisknout."
#: ../src/graphing.c:561
#: ../src/graphing.c:563
msgid "Printing failed"
msgstr "Tisk selhal"
#: ../src/graphing.c:573
#: ../src/graphing.c:575
#, c-format
msgid "Printing failed: %s"
msgstr "Tisk selhal: %s"
#: ../src/graphing.c:697 ../src/graphing.c:749 ../src/graphing.c:766
#: ../src/graphing.c:699 ../src/graphing.c:751 ../src/graphing.c:768
msgid "Export failed"
msgstr "Export selhal"
#: ../src/graphing.c:797
#: ../src/graphing.c:799
msgid "Export encapsulated postscript"
msgstr "Exportovat zapouzdřený postscript"
#: ../src/graphing.c:799
#: ../src/graphing.c:801
msgid "Export postscript"
msgstr "Exportovat postscript"
#: ../src/graphing.c:801
#: ../src/graphing.c:803
msgid "Export PNG"
msgstr "Exportovat PNG"
#: ../src/graphing.c:817
#: ../src/graphing.c:819
msgid "EPS files"
msgstr "Soubory EPS"
#: ../src/graphing.c:821
#: ../src/graphing.c:823
msgid "PS files"
msgstr "Soubory PS"
#: ../src/graphing.c:825
#: ../src/graphing.c:827
msgid "PNG files"
msgstr "Soubory PNG"
#: ../src/graphing.c:1276
#: ../src/graphing.c:1281
msgid "_Graph"
msgstr "_Graf"
#: ../src/graphing.c:1280
#: ../src/graphing.c:1285
msgid "_Print..."
msgstr "Vy_tisknout..."
#: ../src/graphing.c:1286
#: ../src/graphing.c:1291
msgid "_Export postscript..."
msgstr "_Exportovat postscript..."
#: ../src/graphing.c:1292
#: ../src/graphing.c:1297
msgid "E_xport encapsulated postscript..."
msgstr "E_xportovat zapouzdřený postscript..."
#: ../src/graphing.c:1298
#: ../src/graphing.c:1303
msgid "_Export PNG..."
msgstr "_Exportovat PNG..."
#: ../src/graphing.c:1306
#: ../src/graphing.c:1311
msgid "_Zoom"
msgstr "_Zvětšení"
#: ../src/graphing.c:1310
#: ../src/graphing.c:1315
msgid "Zoom _out"
msgstr "Z_menšit"
#: ../src/graphing.c:1316
#: ../src/graphing.c:1321
msgid "Zoom _in"
msgstr "Z_většit"
#: ../src/graphing.c:1322
#: ../src/graphing.c:1327
msgid "_Fit dependent axis"
msgstr "_Přizpůsobit závislou osu"
#: ../src/graphing.c:1330
#: ../src/graphing.c:1335
msgid "_View"
msgstr "_Zobrazit"
#: ../src/graphing.c:1335
#: ../src/graphing.c:1340
msgid "_Reset angles"
msgstr "_Vynulovat úhly"
#: ../src/graphing.c:1340
#: ../src/graphing.c:1345
msgid "_Top view"
msgstr "Pohled _shora"
#: ../src/graphing.c:1345
#: ../src/graphing.c:1350
msgid "R_otate axis..."
msgstr "_Rotovat osu..."
#: ../src/graphing.c:2013
#: ../src/graphing.c:2018
#, c-format
msgid "Function"
msgstr "Funkce"
#: ../src/graphing.c:2015
#: ../src/graphing.c:2020
#, c-format
msgid "Function #%d"
msgstr "Funkce #%d"
#: ../src/graphing.c:2024
#: ../src/graphing.c:2029
#, c-format
msgid "%s: argument number %d not a number"
msgstr "%s: parametr číslo %d není číslo"
#: ../src/graphing.c:2037
#: ../src/graphing.c:2042
msgid "Graph limits not given as a 4-vector"
msgstr "Limity grafu nebyly zadány jako čtyřprvkový vektor"
#: ../src/graphing.c:2043 ../src/graphing.c:2049 ../src/graphing.c:2055
#: ../src/graphing.c:2061 ../src/graphing.c:2126 ../src/graphing.c:2132
#: ../src/graphing.c:2138 ../src/graphing.c:2144 ../src/graphing.c:2150
#: ../src/graphing.c:2156
#: ../src/graphing.c:2048 ../src/graphing.c:2054 ../src/graphing.c:2060
#: ../src/graphing.c:2066 ../src/graphing.c:2131 ../src/graphing.c:2137
#: ../src/graphing.c:2143 ../src/graphing.c:2149 ../src/graphing.c:2155
#: ../src/graphing.c:2161
msgid "Graph limits not given as numbers"
msgstr "Limity grafu nebyly zadány jako čísla"
#: ../src/graphing.c:2120
#: ../src/graphing.c:2125
msgid "Graph limits not given as a 6-vector"
msgstr "Limity grafu nebyly zadány jako šestiprvkový vektor"
#: ../src/graphing.c:2564
#: ../src/graphing.c:2574
msgid "to:"
msgstr "do:"
#: ../src/graphing.c:2582
#: ../src/graphing.c:2592
msgid "by:"
msgstr "po:"
#: ../src/graphing.c:2644
#: ../src/graphing.c:2664
msgid ""
"Type in function names or expressions involving the x variable in the boxes "
"below to graph them"
......@@ -3892,11 +3892,11 @@ msgstr ""
"Grafy vykreslíte zadáním názvů funkcí nebo výrazů obsahujících proměnnou x "
"do polí níže"
#: ../src/graphing.c:2660
#: ../src/graphing.c:2680
msgid "_Functions / Expressions"
msgstr "_Funkce / výrazy"
#: ../src/graphing.c:2668
#: ../src/graphing.c:2688
msgid ""
"Type in function names or expressions involving the t variable in the boxes "
"below to graph them. Either fill in both boxes with x= and y= in front of "
......@@ -3908,42 +3908,46 @@ msgstr ""
"souřadnice x a y odděleně, nebo vyplňte pole z= a zadejte x a y jako reálné "
"a imaginární části komplexního čísla."
#: ../src/graphing.c:2691
#: ../src/graphing.c:2711
msgid "or"
msgstr "nebo"
#. t range
#: ../src/graphing.c:2706
#: ../src/graphing.c:2726
msgid "Parameter t from:"
msgstr "Parametr t od:"
#: ../src/graphing.c:2714
#: ../src/graphing.c:2734
msgid "_Parametric"
msgstr "_Parametrické"
#: ../src/graphing.c:2716 ../src/graphing.c:2771
#: ../src/graphing.c:2736
msgid "_Draw legend"
msgstr "_Kreslit popisky"
#: ../src/graphing.c:2745 ../src/graphing.c:2800
msgid "Plot Window"
msgstr "Okno grafu"
#.
#. * X range
#.
#: ../src/graphing.c:2725 ../src/graphing.c:2780
#: ../src/graphing.c:2754 ../src/graphing.c:2809
msgid "X from:"
msgstr "X od:"
#.
#. * Y range
#.
#: ../src/graphing.c:2731 ../src/graphing.c:2787
#: ../src/graphing.c:2760 ../src/graphing.c:2816
msgid "Y from:"
msgstr "Y od:"
#: ../src/graphing.c:2746
#: ../src/graphing.c:2775
msgid "Function / Expression"
msgstr "Funkce / výraz"
#: ../src/graphing.c:2751
#: ../src/graphing.c:2780
msgid ""
"Type a function name or an expression involving the x and y variables (or "
"the z variable which will be z=x+iy) in the boxes below to graph them. "
......@@ -3956,95 +3960,95 @@ msgstr ""
#.
#. * Z range
#.
#: ../src/graphing.c:2794
#: ../src/graphing.c:2823
msgid "Z from:"
msgstr "Z od:"
#: ../src/graphing.c:2808
#: ../src/graphing.c:2837
msgid "Function _line plot"
msgstr "Čá_rový graf funkce"
#: ../src/graphing.c:2812
#: ../src/graphing.c:2841
msgid "_Surface plot"
msgstr "_Plošný graf"
#: ../src/graphing.c:3012 ../src/graphing.c:3217
#: ../src/graphing.c:3041 ../src/graphing.c:3246
msgid "No functions to plot or no functions could be parsed"
msgstr "Není funkce, kterou kreslitn, nebo funcke nemohla být zpracována"
#: ../src/graphing.c:3043 ../src/graphing.c:3248
#: ../src/graphing.c:3072 ../src/graphing.c:3277
msgid "Invalid X range"
msgstr "Neplatný rozsah X"
#: ../src/graphing.c:3048 ../src/graphing.c:3253
#: ../src/graphing.c:3077 ../src/graphing.c:3282
msgid "Invalid Y range"
msgstr "Neplatný rozsah Y"
#: ../src/graphing.c:3053
#: ../src/graphing.c:3082
msgid "Invalid Z range"
msgstr "Neplatný rozsah Z"
#: ../src/graphing.c:3206
#: ../src/graphing.c:3235
msgid "Only specify x and y, or z, not all at once."
msgstr "Zadejte jen x a y, nebo z, ne vše najednou."
#: ../src/graphing.c:3225
#: ../src/graphing.c:3254
msgid "Invalid t range"
msgstr "Neplatný rozsah t"
#: ../src/graphing.c:3358
#: ../src/graphing.c:3387
msgid "Create Plot"
msgstr "Vytvořit graf"
#: ../src/graphing.c:3398 ../src/graphing.c:3544
#: ../src/graphing.c:3427 ../src/graphing.c:3573
#, c-format
msgid "%s: argument not a function"
msgstr "%s: parametr není funkce"
#: ../src/graphing.c:3408
#: ../src/graphing.c:3437
#, c-format
msgid "%s: only one function supported"
msgstr "%s: podporována jen jedna funkce"
#: ../src/graphing.c:3475 ../src/graphing.c:3595 ../src/graphing.c:3725
#: ../src/graphing.c:3857
#: ../src/graphing.c:3504 ../src/graphing.c:3624 ../src/graphing.c:3754
#: ../src/graphing.c:3886
#, c-format
msgid "%s: invalid X range"
msgstr "%s: neplatný rozsah X"
#: ../src/graphing.c:3480 ../src/graphing.c:3600 ../src/graphing.c:3730
#: ../src/graphing.c:3862
#: ../src/graphing.c:3509 ../src/graphing.c:3629 ../src/graphing.c:3759
#: ../src/graphing.c:3891
#, c-format
msgid "%s: invalid Y range"
msgstr "%s: neplatný rozsah Y"
#: ../src/graphing.c:3485
#: ../src/graphing.c:3514
#, c-format
msgid "%s: invalid Z range"
msgstr "%s: neplatný rozsah Z"
#: ../src/graphing.c:3539
#: ../src/graphing.c:3568
#, c-format
msgid "%s: only up to 10 functions supported"
msgstr "%s: podporováno nejvýše 10 funkcí"
#: ../src/graphing.c:3644
#: ../src/graphing.c:3673
#, c-format
msgid "%s: First two arguments must be functions"
msgstr "%s: První dva parametry musí být funkce"
#: ../src/graphing.c:3735 ../src/graphing.c:3867
#: ../src/graphing.c:3764 ../src/graphing.c:3896
#, c-format
msgid "%s: invalid T range"
msgstr "%s: neplatný rozsah T"
# FIXME: s/functions/function/
#: ../src/graphing.c:3778
#: ../src/graphing.c:3807
#, c-format
msgid "%s: First argument must be functions"
msgstr "%s: První parametr musí být funkce"
#: ../src/graphing.c:3924 ../src/graphing.c:3972
#: ../src/graphing.c:3953 ../src/graphing.c:4001
#, c-format
msgid ""
"%s: Line should be given as a real, n by 2 matrix with columns for x and y, "
......@@ -4052,43 +4056,43 @@ msgid ""
msgstr ""
"%s: line by měla dostat reálnou matici n krát 2 se sloupci pro x a y, n>=2"
#: ../src/graphing.c:4012
#: ../src/graphing.c:4041
#, c-format
msgid "%s: Wrong number of arguments"
msgstr "%s: Špatný počet mnoho parametrů"
#: ../src/graphing.c:4051
#: ../src/graphing.c:4080
#, c-format
msgid "%s: No color specified"
msgstr "%s: Nezadána barva"
#: ../src/graphing.c:4063
#: ../src/graphing.c:4092
#, c-format
msgid "%s: Color must be a string"
msgstr "%s: Barva musí být řetězec"
# FIXME: s/thicnkess/thickness/
#: ../src/graphing.c:4072
#: ../src/graphing.c:4101
#, c-format
msgid "%s: No thicnkess specified"
msgstr "%s: Nezadána tloušťka"
#: ../src/graphing.c:4088
#: ../src/graphing.c:4117
#, c-format
msgid "%s: Unknown style"
msgstr "%s: Neznámý styl"
#: ../src/graphing.c:4095
#: ../src/graphing.c:4124
#, c-format
msgid "%s: Bad parameter"
msgstr "%s: Špatný parametr"
#: ../src/graphing.c:4173
#: ../src/graphing.c:4202
msgid "Plotting"
msgstr "Kreslím"
#. internal
#: ../src/graphing.c:4175
#: ../src/graphing.c:4204
msgid ""
"Plot a function with a line. First come the functions (up to 10) then "
"optionally limits as x1,x2,y1,y2"
......@@ -4096,7 +4100,7 @@ msgstr ""
"Vykreslit funkci jako křivku. Nejdříve jsou funkce (nejvýš 10), pak "
"nepovinně limity jako x1, x2, y1, y2"
#: ../src/graphing.c:4176
#: ../src/graphing.c:4205
msgid ""
"Plot a parametric function with a line. First come the functions for x and "
"y then optionally the t limits as t1,t2,tinc, then optionally the limits as "
......@@ -4106,7 +4110,7 @@ msgstr ""
"pak nepovinně limity t jako t1, t2, tpřír, pak nepovinně limity jako x1, x2, "
"y1, y2"
#: ../src/graphing.c:4177
#: ../src/graphing.c:4206
msgid ""
"Plot a parametric complex valued function with a line. First comes the "
"function that returns x+iy then optionally the t limits as t1,t2,tinc, then "
......@@ -4116,7 +4120,7 @@ msgstr ""
"funkce, která vrací x+iy, pak nepovinně limity t jako t1, t2, tpřír, pak "
"nepovinně limity jako x1, x2, y1, y2"
#: ../src/graphing.c:4178
#: ../src/graphing.c:4207
msgid ""
"Plot a surface function which takes either two arguments or a complex "
"number. First comes the function then optionally limits as x1,x2,y1,y2,z1,z2"
......@@ -4124,11 +4128,11 @@ msgstr ""
"Vykreslit plošnou funkci, která má buď dva argumenty, nebo komplexní číslo. "
"Nejdříve je funkce, pak nepovinně limity jako x1, x2, y1, y2, z1, z2"
#: ../src/graphing.c:4180
#: ../src/graphing.c:4209
msgid "Show the line plot window and clear out functions"
msgstr "Zobrazit okno čárového grafu a vymazat funkce"
#: ../src/graphing.c:4181
#: ../src/graphing.c:4210
msgid ""
"Draw a line from x1,y1 to x2,y2. x1,y1,x2,y2 can be replaced by a n by 2 "
"matrix for a longer line"
......@@ -4136,13 +4140,13 @@ msgstr ""
"Kreslit úsečku od x1,y1 do x2,y2. x1,y1,x2,y2 mohou být nahrazeny maticí n "
"krát 2 pro delší čáru"
#: ../src/graphing.c:4183
#: ../src/graphing.c:4212
msgid "Line plotting window (limits) as a 4-vector of the form [x1,x2,y1,y2]"
msgstr ""
"Okno vykreslování čáry (limity) jako čtyřprvkový vektor ve tvaru [x1,x2,y1,"
"y2]"
#: ../src/graphing.c:4184
#: ../src/graphing.c:4213
msgid ""
"Surface plotting window (limits) as a 6-vector of the form [x1,x2,y1,y2,z1,"
"z2]"
......
......@@ -107,6 +107,8 @@ static double deft1 = 0.0;
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 @@ line_plot_move_about (void)
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 @@ line_plot_move_about (void)
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 @@ plot_functions (void)
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 @@ create_range_spinboxes (const char *title, double *val1, double *val2,
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 @@ create_range_spinboxes (const char *title, double *val1, double *val2,
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 @@ create_range_spinboxes (const char *title, double *val1, double *val2,
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 @@ create_expression_box (const char *label,
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 @@ create_lineplot_box (void)
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment