atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
tab-1.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2026 by CNRS and University of Strasbourg */
15
21
22/*
23* This file: 'tab-1.c'
24*
25* Contains:
26*
27
28 - The 1st tab of the curve layout edition dialog
29
30*
31* List of functions:
32
33 void set_frame_style (gpointer data);
34
35 G_MODULE_EXPORT void set_window_size (GtkEntry * maj, gpointer data);
36 G_MODULE_EXPORT void set_title (GtkCheckButton * but, gpointer data);
37 G_MODULE_EXPORT void set_title (GtkToggleButton * but, gpointer data);
38 G_MODULE_EXPORT void set_title_default (GtkCheckButton * but, gpointer data);
39 G_MODULE_EXPORT void set_title_default (GtkToggleButton * but, gpointer data);
40 G_MODULE_EXPORT void set_title_custom (GtkEntry * tit, gpointer data);
41 G_MODULE_EXPORT void set_title_font (GtkFontButton * fontb, gpointer data);
42 G_MODULE_EXPORT void set_title_color (GtkColorChooser * colob, gpointer data);
43 G_MODULE_EXPORT void set_title_pos (GtkEntry * entry, gpointer data);
44 G_MODULE_EXPORT void set_show_frame (GtkCheckButton * but, gpointer data);
45 G_MODULE_EXPORT void set_show_frame (GtkToggleButton * but, gpointer data);
46 G_MODULE_EXPORT void set_background_color (GtkColorChooser * colob, gpointer data);
47 G_MODULE_EXPORT void set_frame_type (GtkComboBox * fbox, gpointer data);
48 G_MODULE_EXPORT void set_frame_line (GtkComboBox * fbox, gpointer data);
49 G_MODULE_EXPORT void set_frame_thickness (GtkEntry * entry, gpointer data);
50 G_MODULE_EXPORT void set_frame_color (GtkColorChooser * colob, gpointer data);
51 G_MODULE_EXPORT void set_frame_pos (GtkEntry * fen, gpointer data);
52
53 cairo_surface_t * draw_frame_surface (int tf,
54 int da,
55 double ti,
56 double x[2],
57 double y[2],
58 ColRGBA dcol,
59 ColRGBA bcol);
60
61 GtkWidget * create_tab_1 (gpointer data);
62
63*/
64
65#ifdef HAVE_CONFIG_H
66# include <config.h>
67#endif
68
69#include <gtk/gtk.h>
70#include <cairo.h>
71#include <cairo-pdf.h>
72#include <cairo-svg.h>
73#include <string.h>
74#include <stdlib.h>
75#include <math.h>
76
77#include "global.h"
78#include "interface.h"
79#include "callbacks.h"
80#include "project.h"
81#include "curve.h"
82
83extern void set_data_style (gpointer data);
84
85char * ctext[2] = {"x &#x2208; [0.0, 1.0]", "y &#x2208; [0.0, 1.0]"};
86
95G_MODULE_EXPORT void set_window_size (GtkEntry * maj, gpointer data)
96{
97 const gchar *m;
98 char * text[2];
99 int i;
100 qint * ad = (qint *)data;
101 Curve * this_curve = get_project_by_id (ad -> a) -> analysis[ad -> b] -> curves[ad -> c];
102 int shift = get_curve_shift (this_curve);
103 text[0] = i18n("X size must be > 0");
104 text[1] = i18n("Y size must be > 0");
105 m = entry_get_text (maj);
106
107 i = string_to_double ((gpointer)m);
108 if (i > 0)
109 {
110 switch (ad -> d)
111 {
112 case 0:
113 resize_this_window (this_curve -> window, i, this_curve -> wsize[1] + shift);
114 break;
115 case 1:
116 resize_this_window (this_curve -> window, this_curve -> wsize[0], i + shift);
117 break;
118 }
119 this_curve -> wsize[ad -> d] = i;
120 }
121 else
122 {
123 show_warning (_(text[ad -> d]), this_curve -> window);
124 }
125 update_entry_int (maj, this_curve -> wsize[ad -> d]);
126}
127
147cairo_surface_t * draw_frame_surface (int tf,
148 int da,
149 double ti,
150 double x[2],
151 double y[2],
152 ColRGBA dcol,
153 ColRGBA bcol)
154{
155 cairo_surface_t * cst;
156 cairo_t * tcst;
157 int r[2];
158 r[0] = 100;
159 r[1] = 100;
160 cst = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 100, 100);
161 tcst = cairo_create (cst);
162 cairo_set_source_rgb (tcst, bcol.red, bcol.green, bcol.blue);
163 cairo_paint (tcst);
164 show_frame (tcst, tf, da, r, ti, x, y, dcol);
165 cairo_destroy (tcst);
166 return cst;
167}
168
169#ifdef GTK4
178G_MODULE_EXPORT void set_title (GtkCheckButton * but, gpointer data)
179#else
188G_MODULE_EXPORT void set_title (GtkToggleButton * but, gpointer data)
189#endif
190{
191 Curve * this_curve = get_curve_from_pointer (data);
192 this_curve -> show_title = button_get_status ((GtkWidget *)but);
193 widget_set_sensitive (this_curve -> curve_edit -> title_box, this_curve -> show_title);
194 update_curve (data);
195}
196
197#ifdef GTK4
206G_MODULE_EXPORT void set_title_default (GtkCheckButton * but, gpointer data)
207#else
216G_MODULE_EXPORT void set_title_default (GtkToggleButton * but, gpointer data)
217#endif
218{
219 Curve * this_curve = get_curve_from_pointer (data);
220 this_curve -> default_title = button_get_status ((GtkWidget *)but);
221 widget_set_sensitive (this_curve -> curve_edit -> custom_title, ! this_curve -> default_title);
222 if (this_curve -> default_title)
223 {
224 g_free (this_curve -> title);
225 this_curve -> title = g_strdup_printf ("%s - %s", prepare_for_title(get_project_by_id(((tint *)data) -> a) -> name), this_curve -> name);
226 }
227 update_entry_text (GTK_ENTRY(this_curve -> curve_edit -> custom_title), this_curve -> title);
228 update_curve (data);
229}
230
239G_MODULE_EXPORT void set_title_custom (GtkEntry * tit, gpointer data)
240{
241 Curve * this_curve = get_curve_from_pointer (data);
242 g_free (this_curve -> title);
243 this_curve -> title = g_strdup_printf ("%s", entry_get_text (tit));
244 update_entry_text (tit, this_curve -> title);
245 update_curve (data);
246}
247
256G_MODULE_EXPORT void set_title_font (GtkFontButton * fontb, gpointer data)
257{
258 Curve * this_curve = get_curve_from_pointer (data);
259 g_free (this_curve -> title_font);
260 this_curve -> title_font = g_strdup_printf ("%s", gtk_font_chooser_get_font (GTK_FONT_CHOOSER(fontb)));
261 update_curve (data);
262}
263
272G_MODULE_EXPORT void set_title_color (GtkColorChooser * colob, gpointer data)
273{
274 get_curve_from_pointer (data) -> title_color = get_button_color (colob);
275 update_curve (data);
276}
277
286G_MODULE_EXPORT void set_title_pos (GtkEntry * entry, gpointer data)
287{
288 const gchar * p;
289 double v;
290 qint * ad = (qint *)data;
291 tint cd;
292 cd.a = ad -> a;
293 cd.b = ad -> b;
294 cd.c = ad -> c;
295 Curve * this_curve = get_curve_from_pointer ((gpointer)& cd);
296 p = entry_get_text (entry);
297 v = string_to_double ((gpointer)p);
298 if (v >= 0.0 && v <= 1.0)
299 {
300 this_curve -> title_pos[ad -> d] = v;
301 }
302 else
303 {
304 show_warning (ctext[ad -> d], this_curve -> window);
305 }
306 update_entry_double (entry, this_curve -> title_pos[ad -> d]);
307
308 update_curve ((gpointer)& cd);
309}
310
318void set_frame_style (gpointer data)
319{
320 cairo_surface_t * surf;
321 Curve * this_curve = get_curve_from_pointer (data);
322 surf = draw_frame_surface (this_curve -> frame_type,
323 this_curve -> frame_dash,
324 this_curve -> frame_thickness,
325 this_curve -> frame_pos[0],
326 this_curve -> frame_pos[1],
327 this_curve -> frame_color,
328 this_curve -> backcolor);
329 this_curve -> curve_edit -> frame_style_area = destroy_this_widget (this_curve -> curve_edit -> frame_style_area);
330 this_curve -> curve_edit -> frame_style_area = create_image_from_data (IMG_SURFACE, (gpointer)surf);
331 cairo_surface_destroy (surf);
332 widget_set_sensitive (this_curve -> curve_edit -> frame_style_area, this_curve -> show_frame);
333 show_the_widgets (this_curve -> curve_edit -> frame_style_area);
334#ifdef GTK4
335 gtk_widget_set_hexpand (this_curve -> curve_edit -> frame_style_area, TRUE);
336#endif
337 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, this_curve -> curve_edit -> frame_pix_box, this_curve -> curve_edit -> frame_style_area, TRUE, TRUE, 20);
338 update_curve (data);
339}
340
341#ifdef GTK4
350G_MODULE_EXPORT void set_show_frame (GtkCheckButton * but, gpointer data)
351#else
360G_MODULE_EXPORT void set_show_frame (GtkToggleButton * but, gpointer data)
361#endif
362{
363 Curve * this_curve = get_curve_from_pointer (data);
364 this_curve -> show_frame = button_get_status ((GtkWidget *)but);
365 widget_set_sensitive (this_curve -> curve_edit -> frame_box, this_curve -> show_frame);
366 update_curve (data);
367}
368
377G_MODULE_EXPORT void set_background_color (GtkColorChooser * colob, gpointer data)
378{
379 get_curve_from_pointer (data) -> backcolor = get_button_color (colob);
380 set_data_style (data);
381}
382
391G_MODULE_EXPORT void set_frame_type (GtkComboBox * fbox, gpointer data)
392{
393 get_curve_from_pointer (data) -> frame_type = combo_get_active ((GtkWidget *)fbox);
394 set_frame_style (data);
395}
396
405G_MODULE_EXPORT void set_frame_line (GtkComboBox * fbox, gpointer data)
406{
407 get_curve_from_pointer (data) -> frame_dash = combo_get_active ((GtkWidget *)fbox) + 1;
408 set_frame_style (data);
409}
410
419G_MODULE_EXPORT void set_frame_thickness (GtkEntry * entry, gpointer data)
420{
421 const gchar * str;
422 str = entry_get_text (entry);
423 Curve * this_curve = get_curve_from_pointer (data);
424 this_curve -> frame_thickness = string_to_double ((gpointer)str);
425 update_entry_double (entry, this_curve -> frame_thickness);
426 set_frame_style (data);
427}
428
437G_MODULE_EXPORT void set_frame_color (GtkColorChooser * colob, gpointer data)
438{
439 get_curve_from_pointer (data) -> frame_color = get_button_color (colob);
440 set_frame_style (data);
441}
442
451G_MODULE_EXPORT void set_frame_pos (GtkEntry * fen, gpointer data)
452{
453 qint * cd = (qint *)data;
454 int k;
455 const gchar * m;
456 double z;
457 Curve * this_curve = get_curve_from_pointer (data);
458 m = entry_get_text (fen);
459 z = string_to_double ((gpointer)m);
460 if (cd -> d < 2)
461 {
462 if (cd -> d == 0)
463 {
464 k = 0;
465 if (z < this_curve -> frame_pos[0][1])
466 {
467 this_curve -> frame_pos[0][0] = z;
468 }
469 else
470 {
471 show_warning (_("Frame x min must be < to frame x max"), this_curve -> window);
472 }
473 }
474 else if (cd -> d == 1)
475 {
476 k = 1;
477 if (z > this_curve -> frame_pos[0][0])
478 {
479 this_curve -> frame_pos[0][1] = z;
480 }
481 else
482 {
483 show_warning (_("Frame x max must be > to frame x min"), this_curve -> window);
484 }
485 }
486 update_entry_double (fen, this_curve -> frame_pos[0][k]);
487 }
488 else
489 {
490 if (cd -> d == 2)
491 {
492 k = 0;
493 if (z > this_curve -> frame_pos[1][1])
494 {
495 this_curve -> frame_pos[1][0] = z;
496 }
497 else
498 {
499 show_warning (_("Frame y min must be > to frame y max"), this_curve -> window);
500 }
501 }
502 else
503 {
504 k = 1;
505 if (z < this_curve -> frame_pos[1][0])
506 {
507 this_curve -> frame_pos[1][1] = z;
508 }
509 else
510 {
511 show_warning (_("Frame y max must be < to frame y min"), this_curve -> window);
512 }
513 }
514 update_entry_double (fen, this_curve -> frame_pos[1][k]);
515 }
516 set_frame_style (data);
517}
518
527GtkWidget * create_tab_1 (curve_edition * cedit, gpointer data)
528{
529 GtkWidget * graphbox;
530 GtkWidget * fbox;
531 GtkWidget * ghbox;
532 GtkWidget * gvbox;
533 GtkWidget * frame_style_box;
534 GtkWidget * frame_thickness;
535 GtkWidget * xyf;
536
537 gchar * str[2];
538 str[0] = "min";
539 str[1] = "max";
540 gchar * axl[2];
541 axl[0] = "x";
542 axl[1] = "y";
543 gchar * ftb[5] = {i18n("Closed"), i18n("Top Open"), i18n("Right Open"), i18n("Left Open"), i18n("Open ")};
544 int xlgt, ylgt;
545 int i, j, k;
546
547 Curve * this_curve = get_curve_from_pointer (data);
548 // Axis related signals
549 for ( i=0 ; i < 2 ; i++ )
550 {
551 cedit -> dataxe[i].a = ((tint *)data) -> a;
552 cedit -> dataxe[i].b = ((tint *)data) -> b;
553 cedit -> dataxe[i].c = ((tint *)data) -> c;
554 cedit -> dataxe[i].d = i;
555 cedit -> xyp[i] = create_entry (G_CALLBACK(set_window_size), 100, 10, FALSE, (gpointer)& cedit -> dataxe[i]);
556 }
557 graphbox = create_vbox (BSEP);
558 ghbox = create_hbox (0);
559 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, ghbox, FALSE, FALSE, 15);
560 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, markup_label(_("Size:"), 50, 35, 1.0, 0.5), FALSE, FALSE, 20);
561 xlgt = get_widget_width (this_curve -> plot);
562 ylgt = get_widget_height (this_curve -> plot);
563 update_entry_int (GTK_ENTRY(cedit -> xyp[0]), xlgt);
564 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, cedit -> xyp[0], FALSE, FALSE, 0);
565 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, markup_label("x", -1, -1, 0.5, 0.5), FALSE, FALSE, 10);
566 update_entry_int (GTK_ENTRY(cedit -> xyp[1]), ylgt);
567 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, cedit -> xyp[1], FALSE, FALSE, 0);
568 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, markup_label(_("pixels"), -1, -1, 0.0, 0.5), FALSE, FALSE, 20);
569
570 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 5);
571 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox,
572 check_button (_("Insert title"), -1, -1, this_curve -> show_title, G_CALLBACK(set_title), data),
573 FALSE, FALSE, 10);
574
575 cedit -> title_box = create_vbox (BSEP);
576 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, cedit -> title_box, FALSE, FALSE, 0);
577 ghbox = create_hbox (0);
578 add_box_child_start (GTK_ORIENTATION_VERTICAL, cedit -> title_box, ghbox, FALSE, FALSE, 2);
579 gvbox = create_hbox (0);
580 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, gvbox, FALSE, FALSE, 0);
581 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, gvbox,
582 check_button (_("Default title"), 100, 35, this_curve -> default_title, G_CALLBACK(set_title_default), data),
583 FALSE, FALSE, 40);
584 cedit -> custom_title = create_entry (G_CALLBACK(set_title_custom), 200, 15, TRUE, data);
585 gtk_entry_set_alignment (GTK_ENTRY(cedit -> custom_title), 0.0);
586 if (this_curve -> show_title)
587 {
588 widget_set_sensitive (cedit -> custom_title, ! this_curve -> default_title);
589 }
590 else
591 {
592 widget_set_sensitive (cedit -> custom_title, 0);
593 }
594 update_entry_text (GTK_ENTRY(cedit -> custom_title), this_curve -> title);
595 add_box_child_end (gvbox, cedit -> custom_title, FALSE, FALSE, 0);
596
597 add_box_child_end (bbox (cedit -> title_box, _("Font:")),
598 font_button (this_curve -> title_font, 150, 35, G_CALLBACK(set_title_font), data),
599 FALSE, FALSE, 0);
600
601 add_box_child_end (bbox (cedit -> title_box, _("Color:")),
602 color_button (this_curve -> title_color, TRUE, 150, 30, G_CALLBACK(set_title_color), data),
603 FALSE, FALSE, 0);
604
605 ghbox = bbox (cedit -> title_box, _("Position:"));
606 GtkWidget * txyc;
607 for ( i=0 ; i < 2 ; i++ )
608 {
609 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, markup_label(lapos[i], (i==0)?10:30, -1, 1.0, 0.5), FALSE, FALSE, 5);
610 txyc = create_entry (G_CALLBACK(set_title_pos), 100, 10, FALSE, (gpointer)& cedit -> dataxe[i]);
611 update_entry_double (GTK_ENTRY(txyc), this_curve -> title_pos[i]);
612 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, txyc, FALSE, FALSE, 5);
613 }
614 widget_set_sensitive (cedit -> title_box, this_curve -> show_title);
615
616 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 10);
617
618 ghbox = create_hbox (0);
619 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, ghbox, FALSE, FALSE, 0);
620 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, markup_label(_("Background color:"), 120, 30, 0.0, 0.5), FALSE, FALSE, 40);
621 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox,
622 color_button (this_curve -> backcolor, TRUE, 100, -1, G_CALLBACK(set_background_color), data),
623 FALSE, FALSE, 40);
624
625 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 10);
626
627// Frame
628 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox,
629 check_button (_("Show/Hide frame"), -1, -1, this_curve -> show_frame, G_CALLBACK(set_show_frame), data),
630 FALSE, FALSE, 10);
631
632 cedit -> frame_box = create_vbox (BSEP);
633 add_box_child_start (GTK_ORIENTATION_VERTICAL, graphbox, cedit -> frame_box, FALSE, FALSE, 0);
634 cedit -> frame_pix_box = create_hbox (0);
635 frame_style_box = create_vbox (BSEP);
636 add_box_child_start (GTK_ORIENTATION_VERTICAL, cedit -> frame_box, cedit -> frame_pix_box, FALSE, FALSE, 0);
637 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, cedit -> frame_pix_box, frame_style_box, FALSE, FALSE, 0);
638
639// Frame style
640 fbox = create_combo ();
641 for (i=0; i<5; i++)
642 {
643 combo_text_append (fbox, _(ftb[i]));
644 }
645 gtk_widget_set_size_request (fbox, 150, 30);
646 combo_set_active (fbox, this_curve -> frame_type);
647 g_signal_connect (G_OBJECT(fbox), "changed", G_CALLBACK(set_frame_type), data);
648 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bbox (frame_style_box, _("Type:")), fbox, FALSE, FALSE, 0);
649
650// Frame line style
651 fbox = create_combo ();
652 for ( i=1 ; i < ndash ; i++)
653 {
654 combo_text_append (fbox, g_strdup_printf("%d", i));
655 }
656 gtk_widget_set_size_request (fbox, 150, 30);
657 combo_set_active (fbox, this_curve -> frame_dash - 1);
658 g_signal_connect (G_OBJECT(fbox), "changed", G_CALLBACK(set_frame_line), data);
659 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bbox (frame_style_box, _("Line style:")), fbox, FALSE, FALSE, 0);
660
661// Frame line width
662 frame_thickness = create_entry (G_CALLBACK(set_frame_thickness), -1, 10, FALSE, data);
663 update_entry_double (GTK_ENTRY(frame_thickness), this_curve -> frame_thickness);
664 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bbox (frame_style_box, _("Line width:")), frame_thickness, FALSE, FALSE, 0);
665
666// Frame color
667 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, bbox (frame_style_box, _("Color:")),
668 color_button (this_curve -> frame_color, TRUE, 150, 30, G_CALLBACK(set_frame_color), data),
669 FALSE, FALSE, 0);
670
671// Frame pix
672 cairo_surface_t * frame = draw_frame_surface (this_curve -> frame_type,
673 this_curve -> frame_dash,
674 this_curve -> frame_thickness,
675 this_curve -> frame_pos[0],
676 this_curve -> frame_pos[1],
677 this_curve -> frame_color,
678 this_curve -> backcolor);
679 cedit -> frame_style_area = create_image_from_data (IMG_SURFACE, (gpointer)frame);
680 cairo_surface_destroy (frame);
681
682 gtk_widget_set_size_request (cedit -> frame_pix_box, -1, 150);
683#ifdef GTK4
684 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, cedit -> frame_pix_box, markup_label(" ", 20, -1, 0.0, 0.0), FALSE, FALSE, 0);
685 gtk_widget_set_hexpand (cedit -> frame_style_area, TRUE);
686#endif
687 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, cedit -> frame_pix_box, cedit -> frame_style_area, FALSE, FALSE, 20);
688
689 bbox (cedit -> frame_box, _("Position: "));
690 GtkWidget * fxyc;
691 k = -1;
692 for (i=0; i<2; i++)
693 {
694 ghbox = create_hbox (0);
695 add_box_child_start (GTK_ORIENTATION_VERTICAL, cedit -> frame_box, ghbox, FALSE, FALSE, 0);
696 for (j=0; j<2; j++)
697 {
698 k = k + 1;
699 cedit -> framxe[k].a = ((tint *)data) -> a;
700 cedit -> framxe[k].b = ((tint *)data) -> b;
701 cedit -> framxe[k].c = ((tint *)data) -> c;
702 cedit -> framxe[k].d = k;
703 xyf = markup_label (g_strdup_printf ("%s %s: ",axl[i], str[j]), 70, -1, 1.0, 0.5);
704 widget_set_sensitive (xyf, this_curve -> show_frame);
705 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, xyf, FALSE, FALSE, 20);
706 fxyc = create_entry (G_CALLBACK(set_frame_pos), 100, 10, FALSE, (gpointer)& cedit -> framxe[k]);
707 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ghbox, fxyc, FALSE, FALSE, 0);
708 update_entry_double (GTK_ENTRY(fxyc), this_curve -> frame_pos[i][j]);
709 }
710 }
711
712 widget_set_sensitive (cedit -> frame_box, this_curve -> show_frame);
713 return graphbox;
714}
Callback declarations for main window.
char * lapos[2]
Definition cedit.c:78
char * ctext[2]
Definition tab-1.c:85
Curve * get_curve_from_pointer(gpointer data)
get Curve pointer from pointer
Definition curve.c:313
int ndash
Definition curve.c:92
void update_curve(gpointer data)
update curve rendering
Definition curve.c:635
Variable declarations for the curve widget Functions for interactions with the curve widget.
void show_frame(cairo_t *cd, int tf, int da, int res[2], double ti, double x[2], double y[2], ColRGBA dcol)
draw frame
Definition frame.c:81
GtkWidget * xyp[2]
void show_title(cairo_t *cr, Curve *this_curve)
draw title
Definition title.c:104
int get_curve_shift(Curve *this_curve)
get cruve window size shift
Definition w_curve.c:555
const gchar * default_title(int ax, gpointer data)
default title string
Definition title.c:54
atom * tf
Definition d_measures.c:70
int * shift
Definition d_measures.c:72
gchar * text
Definition datab.c:105
#define i18n(String)
Definition global.c:80
double string_to_double(gpointer string)
convert string to double
Definition global.c:611
Global variable declarations Global convenience function declarations Global data structure defin...
@ IMG_SURFACE
Definition global.h:278
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
Definition gtk-misc.c:935
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
Definition gtk-misc.c:1401
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
Definition gtk-misc.c:688
GtkWidget * font_button(gchar *font, int dimx, int dimy, GCallback handler, gpointer data)
create a font selection button
Definition gtk-misc.c:1855
void resize_this_window(GtkWidget *window, int x, int y)
resize this GtkWindow
Definition gtk-misc.c:636
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
Definition gtk-misc.c:958
int get_widget_height(GtkWidget *widg)
retrive GtkWidget height
Definition gtk-misc.c:2589
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
Definition gtk-misc.c:652
#define BSEP
Definition global.h:261
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
Definition gtk-misc.c:669
int get_widget_width(GtkWidget *widg)
retrive GtkWidget width
Definition gtk-misc.c:2573
GtkWidget * fbox(GtkWidget *box, char *lab)
box creating routine, to help design faster elements for the GUI
Definition gtk-misc.c:2120
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
Definition gtk-misc.c:1937
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
Definition gtk-misc.c:1010
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
Definition gtk-misc.c:1672
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
Definition gtk-misc.c:340
ColRGBA get_button_color(GtkColorChooser *colob)
get the ColRGBA color from a GtkColorChooser button
Definition gtk-misc.c:2406
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
Definition gtk-misc.c:247
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
Definition gtk-misc.c:849
GtkWidget * create_image_from_data(int format, gpointer item_image)
create Gtk image for data
Definition gtk-misc.c:1530
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
Definition gtk-misc.c:987
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
Definition gtk-misc.c:2213
GtkWidget * color_button(ColRGBA col, gboolean alpha, int dimx, int dimy, GCallback handler, gpointer data)
create a color selection button
Definition gtk-misc.c:1833
GtkWidget * bbox(GtkWidget *box, char *lab)
box creating routine, to help design faster elements for the GUI
Definition gtk-misc.c:2084
void add_box_child_end(GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the end position.
Definition gtk-misc.c:318
void update_entry_text(GtkEntry *entry, gchar *text)
update the content of a GtkEntry as string
Definition gtk-misc.c:726
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
Definition tools.c:71
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
Definition gtk-misc.c:837
int button_get_status(GtkWidget *button)
get status of check / toggle button
Definition gtk-misc.c:1899
void show_the_widgets(GtkWidget *widg)
show GtkWidget
Definition gtk-misc.c:202
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
image * plot
Definition ogl_draw.c:72
void show_warning(char *warning, GtkWidget *win)
show warning
Definition interface.c:266
Messaging function declarations.
double z
Definition ogl_draw.c:63
double y
Definition ogl_draw.c:63
double x
Definition ogl_draw.c:63
Function declarations for reading atomes project file Function declarations for saving atomes proje...
float blue
Definition global.h:138
float red
Definition global.h:136
float green
Definition global.h:137
Definition global.h:126
Definition global.h:118
int b
Definition global.h:120
int c
Definition global.h:121
int a
Definition global.h:119
G_MODULE_EXPORT void set_title(GtkToggleButton *but, gpointer data)
show / hide title toggle callback GTK3
Definition tab-1.c:188
cairo_surface_t * draw_frame_surface(int tf, int da, double ti, double x[2], double y[2], ColRGBA dcol, ColRGBA bcol)
draw frame preview
Definition tab-1.c:147
G_MODULE_EXPORT void set_title_color(GtkColorChooser *colob, gpointer data)
set title color
Definition tab-1.c:272
void set_data_style(gpointer data)
update the data style widgets
Definition tab-2.c:190
G_MODULE_EXPORT void set_title_font(GtkFontButton *fontb, gpointer data)
set title font
Definition tab-1.c:256
G_MODULE_EXPORT void set_frame_type(GtkComboBox *fbox, gpointer data)
change frame type
Definition tab-1.c:391
G_MODULE_EXPORT void set_title_custom(GtkEntry *tit, gpointer data)
set custom title entry callback
Definition tab-1.c:239
G_MODULE_EXPORT void set_title_pos(GtkEntry *entry, gpointer data)
set axis title position entry callback
Definition tab-1.c:286
G_MODULE_EXPORT void set_frame_line(GtkComboBox *fbox, gpointer data)
change frame line type
Definition tab-1.c:405
G_MODULE_EXPORT void set_frame_color(GtkColorChooser *colob, gpointer data)
set frame color
Definition tab-1.c:437
GtkWidget * create_tab_1(curve_edition *cedit, gpointer data)
handle the creation of the 1st tab of the curve edition dialog
Definition tab-1.c:527
G_MODULE_EXPORT void set_background_color(GtkColorChooser *colob, gpointer data)
change background color
Definition tab-1.c:377
G_MODULE_EXPORT void set_title_default(GtkToggleButton *but, gpointer data)
use / not default title toggle callback GTK3
Definition tab-1.c:216
G_MODULE_EXPORT void set_frame_thickness(GtkEntry *entry, gpointer data)
set frame thickness entry callback
Definition tab-1.c:419
G_MODULE_EXPORT void set_frame_pos(GtkEntry *fen, gpointer data)
set frame position entry callback
Definition tab-1.c:451
G_MODULE_EXPORT void set_show_frame(GtkToggleButton *but, gpointer data)
show / hide frame toggle callback GTK3
Definition tab-1.c:360
void set_frame_style(gpointer data)
create frame preview
Definition tab-1.c:318
G_MODULE_EXPORT void set_window_size(GtkEntry *maj, gpointer data)
change window size entry callback
Definition tab-1.c:95