#include #include #include #include #include #include #include /// Fenêtre d'acquisition /// void aquisition (GtkWidget *wid, GtkWidget *win) { int X=5; GtkWidget *pWindow; GtkWidget *pVBox; GtkWidget *pTable; GtkWidget *pFrame1; GtkWidget *pFrame2; GtkWidget *pFrame3; GtkWidget *pFrame4; GtkWidget *pFrame5; GtkWidget *pFrame6; GtkWidget *pFrame7; GtkWidget *pFrame8; GtkWidget *pFrame9; GtkWidget *pFrame10; GtkWidget *pFrame11; GtkWidget *pFrame12; GtkWidget *pFrame13; GtkWidget *pFrame14; GtkWidget *pFrame15; GtkWidget *pFrame16; GtkWidget *pFrame17; GtkWidget *pFrame18; GtkWidget *pFrame19; GtkWidget *pFrame20; GtkWidget *pVBoxFrame; GtkWidget *pSeparator; GtkWidget *pEntry; GtkWidget *pEntry0; GtkWidget *pLabel; GtkWidget *pLabel1; gchar *sUtf8; pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); /// Creation de la fenêtre /// /* On ajoute un espace de 5 sur les bords de la fenetre */ gtk_container_set_border_width(GTK_CONTAINER(pWindow), 5); gtk_window_set_title(GTK_WINDOW(pWindow), "Regression Lineaire Mesures"); gtk_window_set_default_size(GTK_WINDOW(pWindow), 70, 250); g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(gtk_main_quit), NULL); /* Creation et insertion de la table 10 lignes 4 colonnes */ pTable=gtk_table_new(10,4,FALSE); gtk_container_add(GTK_CONTAINER(pWindow), GTK_WIDGET(pTable)); /// Nb de mesures /// /* Creation et insertion des elements contenus dans le premier GtkFrame */ pLabel1 = gtk_label_new("Nombre de mesures :"); pEntry0 = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); if( X>=1) { /// Mesures 1 /// /* Creation du premier GtkFrame */ pFrame1 = gtk_frame_new("Mesure 1"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame1, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame1), pVBoxFrame); /* Creation et insertion des elements contenus dans le premier GtkFrame */ pLabel = gtk_label_new("X1 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y1 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); } if( X>=2) { /// Mesures 2 /// /* Creation du premier GtkFrame */ pFrame2 = gtk_frame_new("Mesure 2"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame2, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame2), pVBoxFrame); pLabel = gtk_label_new("X2 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y2 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); } if( X>=3) { /// Mesures 3 /// /* Creation du premier GtkFrame */ pFrame3 = gtk_frame_new("Mesure 3"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame3, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame3), pVBoxFrame); pLabel = gtk_label_new("X3 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y3 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); } if( X>=4) { /// Mesures 4 /// /* Creation du premier GtkFrame */ pFrame4 = gtk_frame_new("Mesure 4"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame4, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame4), pVBoxFrame); pLabel = gtk_label_new("X4 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y4 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); } if( X>=5) { /// Mesures 5 /// /* Creation du premier GtkFrame */ pFrame5 = gtk_frame_new("Mesure 5"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame5, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame5), pVBoxFrame); pLabel = gtk_label_new("X5 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y5 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); } if( X>=6) { /// Mesures 6 /// /* Creation du premier GtkFrame */ pFrame6 = gtk_frame_new("Mesure 6"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame6, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame6), pVBoxFrame); pLabel = gtk_label_new("X6 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y6 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); } /// Mesures 7 /// /* Creation du premier GtkFrame */ pFrame7 = gtk_frame_new("Mesure 7"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame7, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame7), pVBoxFrame); pLabel = gtk_label_new("X7 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y7 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 8 /// /* Creation du premier GtkFrame */ pFrame8 = gtk_frame_new("Mesure 8"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame8, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame8), pVBoxFrame); pLabel = gtk_label_new("X8 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y8 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 9 /// /* Creation du premier GtkFrame */ pFrame9 = gtk_frame_new("Mesure 9"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame9, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame9), pVBoxFrame); pLabel = gtk_label_new("X9 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y9 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 10 /// /* Creation du premier GtkFrame */ pFrame10 = gtk_frame_new("Mesure 10"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame10, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame10), pVBoxFrame); pLabel = gtk_label_new("X10 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y10 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 11 /// /* Creation du premier GtkFrame */ pFrame11 = gtk_frame_new("Mesure 11"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame11, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame11), pVBoxFrame); pLabel = gtk_label_new("X11 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y11 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 12 /// /* Creation du premier GtkFrame */ pFrame12 = gtk_frame_new("Mesure 12"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame12, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame12), pVBoxFrame); pLabel = gtk_label_new("X12 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y12 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 13 /// /* Creation du premier GtkFrame */ pFrame13 = gtk_frame_new("Mesure 13"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame13, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame13), pVBoxFrame); pLabel = gtk_label_new("X13 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y13 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 14 /// /* Creation du premier GtkFrame */ pFrame14 = gtk_frame_new("Mesure 14"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame14, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame14), pVBoxFrame); pLabel = gtk_label_new("X14 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y14 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 15 /// /* Creation du premier GtkFrame */ pFrame15 = gtk_frame_new("Mesure 15"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame15, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame15), pVBoxFrame); pLabel = gtk_label_new("X15 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y15 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 16 /// /* Creation du premier GtkFrame */ pFrame16 = gtk_frame_new("Mesure 16"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame16, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame16), pVBoxFrame); pLabel = gtk_label_new("X16 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y16 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 17 /// /* Creation du premier GtkFrame */ pFrame17 = gtk_frame_new("Mesure 17"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame17, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame17), pVBoxFrame); pLabel = gtk_label_new("X17 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y17 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 18 /// /* Creation du premier GtkFrame */ pFrame18 = gtk_frame_new("Mesure 18"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame18, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame18), pVBoxFrame); pLabel = gtk_label_new("X18 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y18 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 19 /// /* Creation du premier GtkFrame */ pFrame19 = gtk_frame_new("Mesure 19"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame19, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame19), pVBoxFrame); pLabel = gtk_label_new("X19 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y19 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Mesures 20 /// /* Creation du premier GtkFrame */ pFrame20 = gtk_frame_new("Mesure 20"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame20, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame20), pVBoxFrame); pLabel = gtk_label_new("X20 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Y20 :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Insertion dans la fenêtre (x1,x2,y1,y2) /// /* Insertion des elements */ gtk_table_attach(GTK_TABLE(pTable), pLabel1,1, 2, 0, 1,GTK_EXPAND | GTK_FILL, GTK_EXPAND,0, 0); gtk_table_attach(GTK_TABLE(pTable), pEntry0,2, 3, 0, 1,GTK_EXPAND | GTK_FILL, GTK_EXPAND,0, 0); if( X>=1) { gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame1,0, 1, 1, 2); } if( X>=2) { gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame2,1, 2, 1, 2); } if( X>=3) { gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame3,2, 3, 1, 2); } if( X>=4) { gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame4,3, 4, 1, 2); } if( X>=5) { gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame5,0, 1, 2, 3); } if( X>=6) { gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame6,1, 2, 2, 3); } gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame7,2, 3, 2, 3); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame8,3, 4, 2, 3); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame9,0, 1, 3, 4); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame10,1, 2, 3, 4); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame11,2, 3, 3, 4); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame12,3, 4, 3, 4); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame13,0, 1, 4, 5); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame14,1, 2, 4, 5); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame15,2, 3, 4, 5); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame16,3, 4, 4, 5); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame17,0, 1, 5, 6); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame18,1, 2, 5, 6); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame19,2, 3, 5, 6); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame20,3, 4, 5, 6); /*Affichage du contenu*/ gtk_widget_show_all(pWindow); gtk_main(); } /// Fenêtre tires /// void paneau (GtkWidget *wid, GtkWidget *win) { GtkWidget *pWindow; GtkWidget *pVBox; GtkWidget *pTable; GtkWidget *pFrame1; GtkWidget *pFrame2; GtkWidget *pVBoxFrame; GtkWidget *pSeparator; GtkWidget *pEntry; GtkWidget *pLabel; GtkWidget *pButton3; GtkWidget *pButton2; GtkWidget *pButton1; GtkWidget *pLabel0; gchar *sUtf8; pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); /// Creation de la fenêtre /// /* On ajoute un espace de 5 sur les bords de la fenetre */ gtk_container_set_border_width(GTK_CONTAINER(pWindow), 5); gtk_window_set_title(GTK_WINDOW(pWindow), "Regression Lineaire"); gtk_window_set_default_size(GTK_WINDOW(pWindow), 200, 150); g_signal_connect(G_OBJECT(pWindow), "destroy", G_CALLBACK(gtk_main_quit), NULL); /* Creation et insertion de la table 8 lignes 10 colonnes */ pTable=gtk_table_new(8,10,FALSE); gtk_container_add(GTK_CONTAINER(pWindow), GTK_WIDGET(pTable)); /// Les éléments /// /* Creation des elements */ pLabel0= gtk_label_new("Regression lineaire"); pButton1= gtk_button_new_with_label("Bouton 2"); pButton2= gtk_button_new_with_label("Graphique"); pButton3= gtk_button_new_with_label("Valeurs"); /// L'opérateur /// /* Creation du premier GtkFrame */ pFrame1 = gtk_frame_new("Operateur"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame1, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame1), pVBoxFrame); /* Creation et insertion des elements contenus dans le premier GtkFrame */ pLabel = gtk_label_new("Nom :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /* Prénom */ pLabel = gtk_label_new("Prenom :"); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pLabel, TRUE, FALSE, 0); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// Les mesures /// /* Creation du premier GtkFrame */ pFrame2 = gtk_frame_new(" Titre"); gtk_box_pack_start(GTK_BOX(pVBox), pFrame2, TRUE, FALSE, 0); /* Creation et insertion d une boite pour le premier GtkFrame */ pVBoxFrame = gtk_vbox_new(TRUE, 0); gtk_container_add(GTK_CONTAINER(pFrame2), pVBoxFrame); pEntry = gtk_entry_new(); gtk_box_pack_start(GTK_BOX(pVBoxFrame), pEntry, TRUE, FALSE, 0); pEntry = gtk_entry_new(); /* Creation d un GtkHSeparator */ pSeparator = gtk_hseparator_new(); /// conexion bouttons/// g_signal_connect (pButton3, "clicked", G_CALLBACK (aquisition), (gpointer) win); /// Insertion dans la fenêtre (x1,x2,y1,y2) /// /* Insertion des elements */ gtk_table_attach(GTK_TABLE(pTable), pLabel0,0, 3, 0, 1,GTK_EXPAND | GTK_FILL, GTK_EXPAND,0, 0); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame1,0, 1, 1, 2); gtk_table_attach_defaults(GTK_TABLE(pTable), pFrame2,0, 1, 2, 3); gtk_table_attach(GTK_TABLE(pTable), pButton2,1, 3, 1, 2,GTK_EXPAND, GTK_EXPAND | GTK_FILL,20, 20); gtk_table_attach(GTK_TABLE(pTable), pButton3,1, 3, 2, 3,GTK_EXPAND, GTK_EXPAND | GTK_FILL,10, 10); /*Affichage du contenu*/ gtk_widget_show_all(pWindow); gtk_main(); } /// Fenêtre d'acceuil/// int main (int argc, char *argv[]) { GtkWidget *button = NULL; GtkWidget *win = NULL; GtkWidget *vsdbox = NULL; GtkWidget *pLabel; /* Initialisation GTK+ */ g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING, (GLogFunc) gtk_false, NULL); gtk_init (&argc, &argv); g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING, g_log_default_handler, NULL); /* fenêtre principal */ win = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_default_size(GTK_WINDOW(win), 220, 220); gtk_container_set_border_width (GTK_CONTAINER (win), 38); gtk_window_set_title (GTK_WINDOW (win), "Regression Lineaire"); gtk_window_set_position (GTK_WINDOW (win), GTK_WIN_POS_CENTER); gtk_widget_realize (win); /* Vertical Box */ vsdbox = gtk_vbox_new (TRUE, 6); gtk_container_add (GTK_CONTAINER (win), vsdbox); pLabel=gtk_label_new("Regression Lineaire C!"); gtk_box_pack_start (GTK_BOX (vsdbox), pLabel, TRUE, TRUE, 0); button = gtk_button_new_from_stock (GTK_STOCK_EXECUTE); g_signal_connect (button, "clicked", G_CALLBACK (paneau), (gpointer) win); gtk_box_pack_start (GTK_BOX (vsdbox), button, TRUE, TRUE, 0); button = gtk_button_new_from_stock (GTK_STOCK_CLOSE); g_signal_connect (button, "clicked", gtk_main_quit, NULL); gtk_box_pack_start (GTK_BOX (vsdbox), button, TRUE, TRUE, 0); /* Affichage */ gtk_widget_show_all (win); gtk_main (); return 0; }