1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
#define GTK_STOCK_QUIT "gtk-quit"
#define GTK_STOCK_SAVE "gtk-save"
void Window_Encodage ()
{
/* Declaration Variables */
GtkWidget *pEncodageWindow = NULL;
GtkWidget *pGrille = NULL;
GtkWidget *pMarque = NULL;
GtkWidget *pBtnQuitter = NULL, *pBtnSauver = NULL;
GtkWidget *pEntryModele = NULL;
GtkWidget *pPrix = NULL;
GtkWidget *pLabelEntree = NULL;
/* FIN Declaration Variables */
/* Debut creation fenetre */
pEncodageWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(pEncodageWindow), "Encodage GSM");// Je nomme ma fenetre...
gtk_window_set_position(GTK_WINDOW(pEncodageWindow), GTK_WIN_POS_CENTER);// Je positione la fenetre au centre de l'ecran
//gtk_window_set_resizable(GTK_WINDOW(pEncodageWindow), FALSE);
gtk_window_set_default_size(GTK_WINDOW(pEncodageWindow), 500, 450);// Je Definit la taille de la fenetre
/* FIN Creation fenetre */
/* Debut Creation Grille */
pGrille = gtk_fixed_new();
gtk_container_add(GTK_CONTAINER(pEncodageWindow), pGrille);
/* Debut Creation Grille */
//
//DEBUT Mise en page de la fenetre
//
/* Debut Label des entree */
pLabelEntree = gtk_label_new("Marque :");
gtk_fixed_put(GTK_FIXED(pGrille), pLabelEntree, 4, 30);
pLabelEntree = gtk_label_new("Modele :");
gtk_fixed_put(GTK_FIXED(pGrille), pLabelEntree, 260, 30);
pLabelEntree = gtk_label_new("Prix :");
gtk_fixed_put(GTK_FIXED(pGrille), pLabelEntree, 260, 356);
/* FIN Label des entree */
/* Marque */
pMarque = gtk_combo_box_new_text();
gtk_widget_set_size_request(GTK_WIDGET(pMarque), 160, 30);
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "ALCATEL");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "BENQ");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "EMPORIA");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "HTC");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "LG");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "NOKIA");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "SAMSUNG");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "SONIM");
gtk_combo_box_append_text (GTK_COMBO_BOX(pMarque), "SONY ERICSSON");
gtk_combo_box_set_title (GTK_COMBO_BOX(pMarque), "Marque");
gtk_fixed_put(GTK_FIXED(pGrille), pMarque, 80, 25);
/* FIN ComboBox Marque */
/* Modele */
pEntryModele = gtk_entry_new();
gtk_widget_set_size_request(GTK_WIDGET(pEntryModele), 160, 30);
gtk_fixed_put(GTK_FIXED(pGrille), pEntryModele, 340, 27);
/* FIN Modele */
/* Prix */
pPrix = gtk_entry_new();
gtk_fixed_put(GTK_FIXED(pGrille), pPrix, 340, 352);
/* FIN Prix */
//
//FIN Mise en page de la fenetre
//
/* Debut Creation Bouton */
pBtnQuitter = gtk_button_new_from_stock(GTK_STOCK_QUIT);
gtk_fixed_put(GTK_FIXED(pGrille), pBtnQuitter, 470, 435);
pBtnSauver = gtk_button_new_from_stock(GTK_STOCK_SAVE);
gtk_fixed_put(GTK_FIXED(pGrille), pBtnSauver, 360, 435);
/* FIN Creation Bouton */
gtk_widget_show_all(pEncodageWindow);
/* CALLBACK */
g_signal_connect(G_OBJECT(pEncodageWindow), "destroy", G_CALLBACK(cb_Destroy_Widget), NULL);
g_signal_connect(G_OBJECT(pBtnSauver), "pressed", G_CALLBACK(cb_Encodage_Save), NULL);
/* Fin CALLBACK */ |