/* ***********************IMPORTANT *********************************************
 *  Copyright (C) 2004-2007 Thierry Lagarde <tlagarde@users.sourceforge.net>
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License.
 *
 *
 *                      ********************
 *
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *
 *                      ********************
 *
 *
 * You are highly encouraged to send your changes to <tlagarde@users.sourceforge.net>
 * for possible incorporation into the main distribution.
 * By sending these changes to <tlagarde@users.sourceforge.net>,
 * it is assumed that you are offering <tlagarde@users.sourceforge.net>
 * the unlimited, non-exclusive right to reuse, modify, and relicense the code.
 *
 *
 *                      ********************
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **************************************************************************************/
#ifdef         __SCRIPT_ENABLE

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>

#include <gtk/gtk.h>

#include "Script_Callbacks.h"
#include "Script_Interface.h"
#include "../Declaration_Constante.h"
#include "Root_Interface.h"
#include "Combo.h"


GtkWidget *create_win_Script (void)
{

	scrolledwindow_Script = gtk_scrolled_window_new (NULL, NULL);
	gtk_widget_show (scrolledwindow_Script);
	gtk_container_add (GTK_CONTAINER (viewport_Modules), scrolledwindow_Script);
	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_Script), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

	viewport_Script = gtk_viewport_new (NULL, NULL);
	gtk_widget_show (viewport_Script);
	gtk_container_add (GTK_CONTAINER (scrolledwindow_Script), viewport_Script);
	gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport_Script), GTK_SHADOW_NONE);

	vbox_Script = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_Script);
	gtk_container_add (GTK_CONTAINER (viewport_Script), vbox_Script);

	hbox_Script_Tout = gtk_hbox_new (FALSE, 0);
	gtk_widget_show (hbox_Script_Tout);
	gtk_box_pack_start (GTK_BOX (vbox_Script), hbox_Script_Tout, FALSE, TRUE, 0);

	fixed_Script_Gauche = gtk_fixed_new ();
	gtk_widget_show (fixed_Script_Gauche);
	gtk_box_pack_start (GTK_BOX (hbox_Script_Tout), fixed_Script_Gauche, TRUE, TRUE, 0);

	vbox_Script_Combo = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_Script_Combo);
	gtk_box_pack_start (GTK_BOX (hbox_Script_Tout), vbox_Script_Combo, TRUE, TRUE, 0);

	fixed_Script_Combo_Haut = gtk_fixed_new ();
	gtk_widget_show (fixed_Script_Combo_Haut);
	gtk_box_pack_start (GTK_BOX (vbox_Script_Combo), fixed_Script_Combo_Haut, TRUE, TRUE, 4);

	combobox_Script = creation_combo (FALSE);
	gtk_box_pack_start (GTK_BOX (vbox_Script_Combo), combobox_Script, TRUE, TRUE, 0);
	creation_combo_script();
	/*combobox_Script = gtk_combo_box_new_text ();
	gtk_widget_show (combobox_Script);
	gtk_box_pack_start (GTK_BOX (vbox_Script_Combo), combobox_Script, FALSE, TRUE, 0);*/
	gtk_widget_set_size_request (combobox_Script, 78, 30);

	fixed_Script_Combo_Bas = gtk_fixed_new ();
	gtk_widget_show (fixed_Script_Combo_Bas);
	gtk_box_pack_start (GTK_BOX (vbox_Script_Combo), fixed_Script_Combo_Bas, TRUE, TRUE, 4);

	fixed_Script_Milieu = gtk_fixed_new ();
	gtk_widget_show (fixed_Script_Milieu);
	gtk_box_pack_start (GTK_BOX (hbox_Script_Tout), fixed_Script_Milieu, TRUE, TRUE, 0);

	vbox_Script_Bouton = gtk_vbox_new (FALSE, 0);
	gtk_widget_show (vbox_Script_Bouton);
	gtk_box_pack_start (GTK_BOX (hbox_Script_Tout), vbox_Script_Bouton, TRUE, TRUE, 0);

	fixed_Script_Button_Haut = gtk_fixed_new ();
	gtk_widget_show (fixed_Script_Button_Haut);
	gtk_box_pack_start (GTK_BOX (vbox_Script_Bouton), fixed_Script_Button_Haut, TRUE, TRUE, 4);

	button_Script_Run = gtk_button_new ();
	gtk_widget_show (button_Script_Run);
	gtk_box_pack_start (GTK_BOX (vbox_Script_Bouton), button_Script_Run, TRUE, FALSE, 0);

	alignment1 = gtk_alignment_new (0.5, 0.5, 0, 0);
	gtk_widget_show (alignment1);
	gtk_container_add (GTK_CONTAINER (button_Script_Run), alignment1);

	hbox5 = gtk_hbox_new (FALSE, 2);
	gtk_widget_show (hbox5);
	gtk_container_add (GTK_CONTAINER (alignment1), hbox5);

	image1 = gtk_image_new_from_file (PATH_ICONE "run.png");
	gtk_widget_show (image1);
	gtk_box_pack_start (GTK_BOX (hbox5), image1, FALSE, FALSE, 0);

	label1 = gtk_label_new_with_mnemonic ("Run");
	gtk_widget_show (label1);
	gtk_box_pack_start (GTK_BOX (hbox5), label1, FALSE, FALSE, 0);

	fixed_Script_Button_Bas = gtk_fixed_new ();
	gtk_widget_show (fixed_Script_Button_Bas);
	gtk_box_pack_start (GTK_BOX (vbox_Script_Bouton), fixed_Script_Button_Bas, TRUE, TRUE, 4);

	fixed_Script_Droite = gtk_fixed_new ();
	gtk_widget_show (fixed_Script_Droite);
	gtk_box_pack_start (GTK_BOX (hbox_Script_Tout), fixed_Script_Droite, TRUE, TRUE, 0);

	scrolledwindow_Script_Texte = gtk_scrolled_window_new (NULL, NULL);
	gtk_widget_show (scrolledwindow_Script_Texte);
	gtk_box_pack_start (GTK_BOX (vbox_Script), scrolledwindow_Script_Texte, TRUE, TRUE, 0);
	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_Script_Texte), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
	gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow_Script_Texte), GTK_SHADOW_IN);

	textview_Script = gtk_text_view_new ();
	gtk_widget_show (textview_Script);
	gtk_container_add (GTK_CONTAINER (scrolledwindow_Script_Texte), textview_Script);

	g_signal_connect ((gpointer) button_Script_Run, "clicked", G_CALLBACK (on_button_Script_Run_clicked), NULL);

	return scrolledwindow_Script;
}


#endif
