line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: TDEntry.pm,v 1.7 2005/01/05 22:58:44 reid Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# TDEntry: find players in TDLIST and enter them into |
4
|
|
|
|
|
|
|
# an appropriate .tde file. The most recent |
5
|
|
|
|
|
|
|
# TDLIST is available from the AGA at: |
6
|
|
|
|
|
|
|
# http:www.usgo.org |
7
|
|
|
|
|
|
|
# Copyright (C) 2004, 2005 Reid Augustin reid@netchip.com |
8
|
|
|
|
|
|
|
# 1000 San Mateo Dr. |
9
|
|
|
|
|
|
|
# Menlo Park, CA 94025 USA |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# This library is free software; you can redistribute it and/or modify it |
12
|
|
|
|
|
|
|
# under the same terms as Perl itself, either Perl version 5.8.5 or, at your |
13
|
|
|
|
|
|
|
# option, any later version of Perl 5 you may have available. |
14
|
|
|
|
|
|
|
# |
15
|
|
|
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT |
16
|
|
|
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
17
|
|
|
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. |
18
|
|
|
|
|
|
|
# |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# |
22
|
|
|
|
|
|
|
# ToDo: |
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
TDEntry - small widget to support the search key entry part of a TDFinder widget |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 SYNOPSIS |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
my $tdEntry = $parent->TDEntry( ?options? ); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
This is just a collection of an Entry widget, a Label, and a Checkbutton. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
package Games::Go::TDEntry; # composite widget for entering search terms for TDFinder |
40
|
|
|
|
|
|
|
|
41
|
1
|
|
|
1
|
|
20576
|
use 5.005; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
32
|
|
42
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
39
|
|
43
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
48
|
|
44
|
1
|
|
|
1
|
|
444
|
use Tk; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
use Tk::widgets qw/ Label Entry Checkbutton /; |
46
|
|
|
|
|
|
|
use base qw(Tk::Frame); # TDEntry is a composite widget |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Construct Tk::Widget 'TDEntry'; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
BEGIN { |
51
|
|
|
|
|
|
|
our $VERSION = sprintf "%d.%03d", '$Revision: 1.7 $' =~ /(\d+)/g; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# class variables: |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
###################################################### |
57
|
|
|
|
|
|
|
# |
58
|
|
|
|
|
|
|
# methods |
59
|
|
|
|
|
|
|
# |
60
|
|
|
|
|
|
|
##################################################### |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub ClassInit { |
63
|
|
|
|
|
|
|
my ($class, $mw) = @_; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$class->SUPER::ClassInit($mw); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub Populate { |
69
|
|
|
|
|
|
|
my ($self, $args) = @_; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
$self->SUPER::Populate($args); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
$self->initTDEntry(); |
74
|
|
|
|
|
|
|
$self->ConfigSpecs( |
75
|
|
|
|
|
|
|
-text => [$self->{label}, 'text', 'Text', 'Search:'], |
76
|
|
|
|
|
|
|
DEFAULT => [$self->{entry}],); |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 OPTIONS |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=over 4 |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=item B<-text> 'string' |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Text to put into the Label part of the TDEntry widget. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Default: 'Search' |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=back |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=cut |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
$self->Delegates(DEFAULT => $self->{entry}); # all unknown methods |
93
|
|
|
|
|
|
|
$self->Advertise(entry => $self->{entry}); |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 ADVERTISED SUBWIDGETS |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=over 4 |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item B |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
The Entry widget. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=back |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=cut |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
return($self); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
sub initTDEntry { |
111
|
|
|
|
|
|
|
my $self = shift; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# a label widget on the far left |
114
|
|
|
|
|
|
|
$self->{label} = $self->Label( |
115
|
|
|
|
|
|
|
-text => 'Search:'); |
116
|
|
|
|
|
|
|
$self->{label}->pack( |
117
|
|
|
|
|
|
|
-side => 'left', |
118
|
|
|
|
|
|
|
-expand => 'false', |
119
|
|
|
|
|
|
|
); |
120
|
|
|
|
|
|
|
$self->{entry} = $self->Entry(); |
121
|
|
|
|
|
|
|
$self->{entry}->pack( |
122
|
|
|
|
|
|
|
-side => 'left', |
123
|
|
|
|
|
|
|
-expand => 'true', |
124
|
|
|
|
|
|
|
-fill => 'x'); |
125
|
|
|
|
|
|
|
$self->{checkbutton} = $self->Checkbutton(-text => 'Case sensitive', |
126
|
|
|
|
|
|
|
-variable => \$self->{caseSensitive}); |
127
|
|
|
|
|
|
|
$self->{checkbutton}->invoke; # default to case sensitive true |
128
|
|
|
|
|
|
|
$self->{checkbutton}->pack( |
129
|
|
|
|
|
|
|
-side => 'left', |
130
|
|
|
|
|
|
|
-expand => 'false', |
131
|
|
|
|
|
|
|
-fill => 'x'); |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=head2 METHODS |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=over 4 |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item B |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Returns the current value of the caseSensitive checkbutton. |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=back |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
sub case { |
147
|
|
|
|
|
|
|
my $self = shift; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
return($self->{caseSensitive}); |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
1; |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
__END__ |