like this
Posted: Wed Jun 24, 2009 5:44 pm
by bufflotrip
use Tk;
use Tk::Text;
use Tk::Frame;
use Tk::Widget;
use Tk::Wm;
use Tk::BrowseEntry;
$my_font = "-*-clean-medium-r-*-*-12-*-100-100-m-10-*-*" ;
$my_font2 = "-*-clean-medium-r-*-*-14-*-100-100-m-10-*-*" ;
$my_font2c = "-*-clean-bold-r-*-*-14-*-100-100-m-10-*-*" ;
$my_font3 = "-*-clean-medium-r-*-*-16-*-100-100-m-10-*-*" ;
$my_font4 = "-*-clean-medium-r-*-*-20-*-100-100-m-10-*-*" ;
$my_font_ECS_Label = "-*-clean-medium-r-*-*-24-*-100-100-m-10-*-*" ;
$my_font2b = "-*-clean-bold-r-*-*-*-100-100-100-m-10-*-*" ;
$topwindow=MainWindow->new();
$topwindow->configure( '-title'=> ' SSA Control-M GUI ');
$frame1 = $topwindow->Frame('-relief' => 'groove', '-borderwidth' => 3 );
$frame1->configure( '-background'=> '#d4d45b84a0aa' );
$frame12 = $frame1->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame13 = $frame1->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
# Example $frame122 = $frame12->Frame ('-relief' => 'groove', '-borderwidth' => 3, '-width'=> 21 );
$frame121 = $frame12->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame122 = $frame12->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1211 = $frame121->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12111 = $frame1211->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12112 = $frame1211->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12113 = $frame1211->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1212 = $frame121->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12121 = $frame1212->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12122 = $frame1212->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12123 = $frame1212->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1221 = $frame122->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12211 = $frame1221->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame12212 = $frame1221->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame122121 = $frame12212->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame122122 = $frame12212->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1222 = $frame122->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame131 = $frame13->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame132 = $frame13->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1311 = $frame131->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1312 = $frame131->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1321 = $frame132->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$frame1322 = $frame132->Frame ('-relief' => 'groove', '-borderwidth' => 3 );
$AppLabel = $frame12111->Label ('-text'=>'Application Name ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$AppLabel = $frame12111->Label ('-text'=>'Test Emods ','-font'=>$my_font2c)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$GroupLabel = $frame12112->Label ('-text'=>'Group Name ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$groupbox = $frame12112->Entry ('-textvariable'=> $timeAPP,'-width'=>16,'-font'=>$my_font2)->pack('-side'=>"right", '-pady' => 2, '-padx' => 2);
$jobLabel = $frame12113->Label ('-text'=>'Job Name ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$jobbox = $frame12113->Entry ('-textvariable'=> $timeAPP,'-width'=>16,'-font'=>$my_font2)->pack('-side'=>"right", '-pady' => 2, '-padx' => 2);
$time_ckbutton = $frame12211->Checkbutton ('-text'=> "Time Triggered ?",'-font'=>$my_font3)->pack('-side'=>"top", '-pady' => 2, '-padx' => 2);
$timeLabel = $frame122121->Label ('-text'=>'Enter Time ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$timebox = $frame122121->Entry ('-textvariable'=> $timeAPP,'-width'=>6,'-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$amRadio = $frame122122->Radiobutton ('-text'=>'a.m.','-variable'=>\$ampmq,'-value'=>"am")->pack('-side'=>"top");
$pmRadio = $frame122122->Radiobutton ('-text'=>'p.m.','-variable'=>\$ampmq,'-value'=>"pm")->pack('-side'=>"left");
$ownerLabel = $frame12121->Label ('-text'=>'Owner Name: ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$ownerLabel = $frame12121->Label ('-text'=>'Mark Scherer ','-font'=>$my_font2c)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$counterLabel = $frame12122->Label ('-text'=>'Job Counter: ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$counterbox = $frame12122->Entry ('-textvariable'=> $timeAPP,'-width'=>3,'-font'=>$my_font2)->pack('-side'=>"right", '-pady' => 2, '-padx' => 2);
$registerbutton = $frame12123->Button ('-text'=> "Register New Group",'-font'=>$my_font2,'-width'=>20, '-activebackground'=> '#feb7e62308ea' , '-background'=> '#d4d4c20671dd' ,'-command'=> sub { Submit_Appointment() } )->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
# $messagebutton3 = $frame1322->Button ('-text'=> "Submit",'-font'=>$my_font2,'-width'=>10, '-activebackground'=> '#feb7e62308ea' , '-background'=> '#d4d4c20671dd' ,'-command'=> sub { Submit_Appointment() } )->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
# $messagebutton4 = $frame1221->Button ('-text'=> "Submit",'-font'=>$my_font2,'-width'=>10, '-activebackground'=> '#feb7e62308ea' , '-background'=> '#d4d4c20671dd' ,'-command'=> sub { Submit_Appointment() } )->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
# $messagebutton5 = $frame1321->Button ('-text'=> "Submit",'-font'=>$my_font2,'-width'=>10, '-activebackground'=> '#feb7e62308ea' , '-background'=> '#d4d4c20671dd' ,'-command'=> sub { Submit_Appointment() } )->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$frame1 -> pack('-side' => 'top',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame12 -> pack('-side' => 'top',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame13 -> pack('-side' => 'bottom',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame121 -> pack('-side' => 'top',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame122 -> pack('-side' => 'bottom',
'-pady' => 2,
'-padx' => 2 );
$frame1211 -> pack('-side' => 'left',
'-pady' => 2,
'-padx' => 2 );
$frame12111 -> pack('-side' => 'top',
'-pady' => 2,
'-padx' => 2 );
$frame12112 -> pack('-pady' => 2,
'-padx' => 2 );
$frame12113 -> pack('-side' => 'bottom',
'-pady' => 2,
'-padx' => 2 );
$frame1212 -> pack('-side' => 'right',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame12121 -> pack('-side' => 'top',
'-pady' => 2,
'-padx' => 2 );
$frame12122 -> pack('-pady' => 2,
'-padx' => 2 );
$frame12123 -> pack('-side' => 'bottom',
'-pady' => 2,
'-padx' => 2 );
$frame1221 -> pack('-side' => 'left',
'-pady' => 2,
'-padx' => 2 );
$frame12211 -> pack('-side' => 'top',
'-pady' => 2,
'-padx' => 2 );
$frame12212 -> pack('-side' => 'bottom',
'-pady' => 2,
'-padx' => 2 );
$frame122121 -> pack('-side' => 'left',
'-pady' => 2,
'-padx' => 2 );
$frame122122 -> pack('-side' => 'right',
'-pady' => 2,
'-padx' => 2 );
$frame1222 -> pack('-side' => 'right',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame131 -> pack('-side' => 'top',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame132 -> pack('-side' => 'bottom',
'-pady' => 2,
'-padx' => 2 );
$frame1311 -> pack('-side' => 'top',
'-pady' => 2,
'-padx' => 2 );
$frame1312 -> pack('-side' => 'bottom',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
$frame1321 -> pack('-side' => 'top',
'-pady' => 2,
'-padx' => 2 );
$frame1322 -> pack('-side' => 'bottom',
'-fill' => 'x',
'-pady' => 2,
'-padx' => 2 );
MainLoop;
sub Submit_Appointment {
$timeee = $timebox -> get ;
$timeee =~ s/:/-/;
$dateee = $datebox -> get ;
$message = $messagebox -> get ;
$filee = "C:\\PageCal\\" . "cal " . $timeee . " " . $ampmq . " " . $dateee . " sub " . $message . "\.txt" ;
# print STDOUT ("scp2 \"$filee\" u0864\@s00dee1\:\/apps1\/users\/mscherer\/\. ------\n");
open (CALFILE,">$filee");
print CALFILE ($filee," ");
close (CALFILE);
`scp2 \"$filee\" u0864\@s00dee1\:\/apps1\/users\/mscherer\/markcal\/\.`;
}
sub trash {
$timeLabel = $frame11->Label ('-text'=>'Enter Time ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$timeLabel = $frame11->Label ('-text'=>'Enter Date (Jun 24) ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$messageLabel = $frame11->Label ('-text'=>' Message ','-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$timebox = $frame121->Entry ('-textvariable'=> $timeAPP,'-width'=>6,'-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
$amRadio = $frame122->Radiobutton ('-text'=>'a.m.','-variable'=>\$ampmq,'-value'=>"am")->pack('-side'=>"top");
$pmRadio = $frame122->Radiobutton ('-text'=>'p.m.','-variable'=>\$ampmq,'-value'=>"pm")->pack('-side'=>"bottom");
$datebox = $frame123->Entry ('-textvariable'=> $dateAPP,'-width'=>11,'-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 22);
$messagebox = $frame124->Entry ('-textvariable'=> $messAPP,'-width'=>60,'-font'=>$my_font2)->pack('-side'=>"left", '-pady' => 2, '-padx' => 22);
$messagebutton = $frame125->Button ('-text'=> "Submit",'-font'=>$my_font2,'-width'=>10, '-activebackground'=> '#feb7e62308ea' , '-background'=> '#d4d4c20671dd' ,'-command'=> sub { Submit_Appointment() } )->pack('-side'=>"left", '-pady' => 2, '-padx' => 2);
}