summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne2005-02-21 14:28:10 +0000
committeretienne2005-02-21 14:28:10 +0000
commitd42a4ed10f8ad712bbcc2bfe8f902cd33848f320 (patch)
treed37282095db81c29765af167c838b3e6207ed2a3
parentfefdf118ad15d4148a5107bff14d86e81202f419 (diff)
downloadivymon-d42a4ed10f8ad712bbcc2bfe8f902cd33848f320.zip
ivymon-d42a4ed10f8ad712bbcc2bfe8f902cd33848f320.tar.gz
ivymon-d42a4ed10f8ad712bbcc2bfe8f902cd33848f320.tar.bz2
ivymon-d42a4ed10f8ad712bbcc2bfe8f902cd33848f320.tar.xz
Ajout d'un mécanisme permettant d'élargir la frame d'envoi de message à
la largeur de la fenetre.
-rwxr-xr-xsrc/ivymon76
1 files changed, 67 insertions, 9 deletions
diff --git a/src/ivymon b/src/ivymon
index c8ebf01..79c7de9 100755
--- a/src/ivymon
+++ b/src/ivymon
@@ -1,5 +1,7 @@
#!/usr/bin/perl
+
+
$SIG{INT} = \&quit;
$SIG{QUIT} = \&quit;
use Tk;
@@ -39,6 +41,7 @@ my $history = 200000;
my $casesensitiveflag = 1;
my $regexpflag = 0;
# misc
+my $enlarge = 0;
my $hostname = hostname();
my %clientsMessagesTpl;
my %connectedClients;
@@ -67,6 +70,7 @@ my @bindHistory;
my $bindHistoryIndex = -1;
my $clockbackwardflag = 0;
+my @packinfo = ();
my @messagesbuffer;
my $markers_cnt = 0;
@@ -299,13 +303,33 @@ my $clients_fm =
-padx => 5*$coef,
);
my $send_fm =
- $bottom_fm->LabFrame(-label => 'Messages to send : ',
+ $bottom_fm->LabFrame(-label => ' Messages to send : ',
-labelside => 'acrosstop',
-borderwidth => 3)->pack(-fill => 'x',
-side => 'left',
-expand => 1,
-padx => 5*$coef,
);
+my $send_lab = $send_fm->Subwidget('label');
+my $send_lab_bgcolor = $send_lab->cget(-background);
+
+$send_lab->configure(-relief => 'groove');
+$send_lab->bind("<Enter>", sub {
+ $send_lab->configure( -relief => 'raised');
+});
+$send_lab->bind("<Leave>", sub {
+ $send_lab->configure(-bg => $send_lab_bgcolor, -relief => 'groove');
+});
+$send_lab->bind("<1>", sub {
+ if ($enlarge) {
+ &shrink;
+ $enlarge = 0;
+ } else {
+ &enlarge;
+ $enlarge = 1;
+ }
+});
+
my $searchandcontrol_fm = $bottom_fm->Frame()->pack(-fill => 'both',
-side => 'right',
-expand => 0);
@@ -323,6 +347,8 @@ my $control_fm =
-side => 'bottom',
-padx => 5*$coef,
-expand => 0);
+my $progressbar;
+=pod
my $progressbar =
$bottom_fm->ProgressBar(-from => 0,
-length => 200,
@@ -331,11 +357,12 @@ my $progressbar =
-relief => 'sunken',
-resolution => 0,
-anchor => 'n',
- )->pack(#-fill => 'both',
+ )->pack(-fill => 'none',
-side => 'right',
- #-expand => 1,
+ -expand => 0,
-padx => 5*$coef,
);
+=cut
#----------------------------------------------------------------------------------
# Messages display area
#----------------------------------------------------------------------------------
@@ -529,8 +556,9 @@ my $sendEntry =
-anchor => 'w',
-ipady => 3,
-expand => 1,
- -pady => 5*$coef);
+ -pady => 0);
my $send2_fm = $send_fm->Frame()->pack(-side => 'top',
+ -pady => 5*$coef,
-expand => 1,
-fill => 'both');
@@ -542,7 +570,7 @@ if($smallsized){
# $clockstartButtonmsg = "Start";
$clockstartButtonmsg = "Go";
$clockstopButtonmsg = "Stop";
- $clockbackCheckButtonmsg = "Back";
+ $clockbackCheckButtonmsg = "Backw";
}
my $clockstartButton =
@@ -569,10 +597,9 @@ my $sendList =
-scrollbars => 'osoe',
-height => 9,
-width => 40*$coef)->pack(-fill => 'both',
- -anchor => 'w',
- -side => 'bottom',
- -expand => 1);
-
+ -anchor => 'w',
+ -side => 'top',
+ -expand => 1);
$sendEntry->bind('<Key>' => [\&findExprInList, $sendList]);
$sendEntry->bind('<Return>' => [\&addMsgToSend, undef, 1]);
@@ -827,6 +854,9 @@ $balloonhelp->attach($saveButton, -balloonmsg =>
"Save the content of Messages\n".
"area in a file. "
);
+$balloonhelp->attach($send_lab, -balloonmsg =>
+ "Click here to enlarge or shrink this frame"
+ );
#=================================================================================
#
@@ -1654,6 +1684,7 @@ sub clockstop {
sub clockswitch {
+
if ($clockbackwardflag == 1) {
&sendMsg("ClockBackward");
$clockbackCheckbutton->configure(-foreground => 'maroon',
@@ -2503,6 +2534,32 @@ sub replayTime {
#----------------------------------------------------------------------------------
# General functions
#----------------------------------------------------------------------------------
+sub enlarge {
+
+ @packinfo = ();
+ push(@packinfo, [$bindings_fm->packInfo]);
+ push(@packinfo, [$clients_fm->packInfo]);
+ push(@packinfo, [$send_fm->packInfo]);
+ push(@packinfo, [$searchandcontrol_fm->packInfo]);
+ $searchandcontrol_fm->packForget;
+ $clients_fm->packForget;
+ $bindings_fm->packForget;
+
+
+} # end expand
+
+
+sub shrink {
+
+ $send_fm->packForget;
+ $bindings_fm->pack(@{$packinfo[0]});
+ $clients_fm->pack(@{$packinfo[1]});
+ $send_fm->pack(@{$packinfo[2]});
+ $searchandcontrol_fm->pack(@{$packinfo[3]});
+
+} # end shrink
+
+
sub wheelmousebindings {
my $w = shift;
my $count = shift;
@@ -2665,6 +2722,7 @@ sub quit {
} # end quit
+
__END__
=head1 NAME