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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
| # Module create IHM
use Tk;
use lib "$ENV{PATH_LIB_PERL}/perlmod";
use Tilt::SetCalibre;
use Tilt::gtcheck;
use Tilt::XorGdsOasislite;
use File::Basename;
use File::stat;
my $window_color = "lavender";
my $button_color = "gray85";
my $button_colorG = "LimeGreen";
my $entry_color = "white";
my $font = "Arial 10";
my $sfont = "Arial 8";
my $bfont = "Arial 12";
chop( my $directory = `pwd` );
#&RECUP_ARG(@ARGV);
#&RECUP_ARG_OTHERS();
#&CREATE_WINDOW;
###############################################################################################################
# Read specific command-line options and parameters
###############################################################################################################
sub RECUP_ARG_OTHERS {
my $all_arg = join( " ", @ARGV );
if ( $all_arg =~ /-extract +(\S+)/ ) { $summary = $1; &EXTRACT_RESULT; exit; }
if ( $all_arg =~ /-rve/i ) { $rve = 1; }
}
###############################################################################################################
# Main GUI window
###############################################################################################################
sub CREATE_WINDOW {
my $mw = MainWindow->new( -background => $window_color, -title => "Add Xor GDS" );
# Give a modern look & feel to the Tk GUI : anti-alias font and a thin border
$mw->optionAdd("*font", "-*-arial-normal-r-*-*-*-120-*-*-*-*-*-*");
$mw->optionAdd("*borderWidth", 1);
#$mw->geometry("700x720");
$mw->geometry("500x150");
my $mw_scrolled = $mw->Scrolled( "Pane", -scrollbars => 'e', -borderwidth => 2, -relief => 'groove', -sticky => 'nwse', -background => $window_color );
$mw_scrolled->pack( -in => $mw, -fill => 'both', -expand => 1 );
$mw_scrolled->{SubWidget}->{yscrollbar}->configure( -width => 10, -background => $button_color );
my $Menu_techno_scrolled = &CREATE_WINDOW_COMMON($mw_scrolled,
$directory,
$directory
);
$mw_scrolled->Button( -text => "Save", -command => [\&save_xorgds, $mw], -background => $button_color, -font => $font )
->grid( -columnspan => 2, -sticky => "nsew", -padx => 5, -pady => 5 );
$mw_scrolled->Button( -text => "Exit", -command => [\&close_xor_ihm, $mw], -background => $button_color, -font => $font )
->grid( -columnspan => 2, -sticky => "nsew", -padx => 5, -pady => 5 );
# Run GUI !!
MainLoop;
return $gds1;
}
sub save_xorgds {
my $mw = shift;
# Destruction de l'interface graphique, mais pas arrêt du programme Perl
$mw->destroy;
}
sub ihm_box_yesno
{
# Creation de la fenetre ( parent widget )
my $mw = MainWindow->new(-title => "Check Teg width");
my $frame = $mw->Frame(
-borderwidth => 5,
-relief => 'groove'
);
$frame->Label(-text => "${TegName} hasn't a regular width, would you force the release ? \n",
-foreground => 'red' )->pack;
my $button_yes = $frame->Button(
-text => "YES",
-command => [\&close_ihm, $mw],
);
my $button_no = $frame->Button(
-text => "NO",
-command => [\&close_program, $mw],
);
$frame->pack( -side => 'top', -fill => 'x' );
$button_yes->pack( -side => 'left', -padx => 50, -pady => 5 );
$button_no->pack( -side => 'right', -padx => 50, -pady => 5 );
MainLoop;
}
sub close_ihm {
my $mw = shift;
# Destruction de l'interface graphique, mais pas arrêt du programme Perl
$mw->destroy;
}
sub close_xor_ihm {
$gds1 = "none";
my $mw = shift;
# Destruction de l'interface graphique, mais pas arrêt du programme Perl
$mw->destroy;
}
sub close_program {
my $mw = shift;
# Destruction de l'interface graphique, mais pas arrêt du programme Perl
$mw->destroy;
print "\n";
print "***************************************************************************\n";
print "* *\n";
print "* Config_generator_file was aborted *\n";
print "* *\n";
print "***************************************************************************\n";
print "\n";
# Arrêt du programme complet
exit;
}
1; |
Partager