line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
### $Source: FcyEntry.pm $ $Revision: 1.3 $ |
2
|
|
|
|
|
|
|
### |
3
|
|
|
|
|
|
|
### Entry with bg color depending on state. POD after __END__ |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
8626
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
276
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
package Tk::FcyEntry; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
require Tk; |
10
|
|
|
|
|
|
|
require Tk::Widget; |
11
|
|
|
|
|
|
|
require Tk::Derived; |
12
|
|
|
|
|
|
|
require Tk::Entry; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
6
|
use vars qw(@ISA $VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
504
|
|
15
|
|
|
|
|
|
|
@ISA = qw(Tk::Derived Tk::Entry); |
16
|
|
|
|
|
|
|
$VERSION = substr q$Revision: 1.3 $, 10; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
local($^W)=0; # suppress Entry overriden warning |
20
|
|
|
|
|
|
|
Construct Tk::Widget 'Entry'; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub Populate |
24
|
|
|
|
|
|
|
{ |
25
|
0
|
|
|
0
|
|
|
my ($w,$args) = @_; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
$w->ConfigSpecs( |
28
|
|
|
|
|
|
|
'-state', => ['METHOD', qw(state State normal) ], |
29
|
|
|
|
|
|
|
'-editcolor' => ['PASSIVE', qw(editColor EditColor), Tk::WHITE()], |
30
|
|
|
|
|
|
|
'-background' => ['PASSIVE', qw(background Background), Tk::NORMAL_BG()], |
31
|
|
|
|
|
|
|
'-foreground' => ['PASSIVE', qw(foreground Foreground), Tk::BLACK()], |
32
|
|
|
|
|
|
|
'DEFAULT' => ['SELF'], |
33
|
|
|
|
|
|
|
); |
34
|
0
|
|
|
|
|
|
$w; |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub state { |
38
|
0
|
|
|
0
|
|
|
my ($w) = shift; |
39
|
0
|
0
|
|
|
|
|
if (@_) { |
40
|
0
|
|
|
|
|
|
my $state = shift; |
41
|
0
|
0
|
|
|
|
|
if ($state eq 'normal') { |
42
|
0
|
|
|
|
|
|
$w->Tk::Entry::configure(-background => $w->{Configure}{-editcolor}); |
43
|
0
|
|
|
|
|
|
$w->Tk::Entry::configure(-foreground => $w->{Configure}{-foreground}); |
44
|
|
|
|
|
|
|
} else { |
45
|
0
|
|
|
|
|
|
$w->Tk::Entry::configure(-background => $w->{Configure}{-background}); |
46
|
0
|
|
|
|
|
|
$w->Tk::Entry::configure(-foreground => Tk::DISABLED()); |
47
|
|
|
|
|
|
|
} |
48
|
0
|
|
|
|
|
|
$w->Tk::Entry::configure(-state => $state); |
49
|
|
|
|
|
|
|
} else { |
50
|
0
|
|
|
|
|
|
$w->Tk::Entry::cget('-state'); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
}; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |