| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
####----------------------------------- |
|
2
|
|
|
|
|
|
|
### File : GclkSettings.pm |
|
3
|
|
|
|
|
|
|
### Author : Ch.Minc |
|
4
|
|
|
|
|
|
|
### Purpose : Settings for GameClock |
|
5
|
|
|
|
|
|
|
### Version : 1.0 2006/1/26 |
|
6
|
|
|
|
|
|
|
####----------------------------------- |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
package GclkSettings ; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.0' ; |
|
12
|
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use strict ; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
34
|
|
|
14
|
1
|
|
|
1
|
|
5
|
use warnings ; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
443
|
use Tk ; |
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use Tk::Radiobutton ; |
|
18
|
|
|
|
|
|
|
use Tk::ProgressBar; |
|
19
|
|
|
|
|
|
|
use Tk::Scale; |
|
20
|
|
|
|
|
|
|
require Exporter ; |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
use Chess::GameClock::GclkData qw(:tout) ; |
|
23
|
|
|
|
|
|
|
#use Chess::GameClock::GclkDisplay qw(hmnsec loupe) ; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# aliasing |
|
26
|
|
|
|
|
|
|
my @menu=@GclkData::menu ; |
|
27
|
|
|
|
|
|
|
my %sous_menu=%GclkData::sous_menu ; |
|
28
|
|
|
|
|
|
|
my %soussous=%GclkData::soussous ; |
|
29
|
|
|
|
|
|
|
my %aide=%GclkData::aide ; |
|
30
|
|
|
|
|
|
|
my @Mode=@GclkData::Mode ; |
|
31
|
|
|
|
|
|
|
my %cad=%GclkData::cad ; |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
#use Chess::GameClock::GclkDisplay qw(hmnsec loupe) ; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
our @ISA=qw(Exporter) ; |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
our @EXPORT_OK=qw (&menu ®lage $screensz) ; |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
our $varset ; |
|
40
|
|
|
|
|
|
|
our $screensz ; |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
my %sous_menuref ; |
|
43
|
|
|
|
|
|
|
my %soussous_ref ; |
|
44
|
|
|
|
|
|
|
my %rb ; |
|
45
|
|
|
|
|
|
|
my $wmv ; |
|
46
|
|
|
|
|
|
|
my $wmb ; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
our $whites ; |
|
49
|
|
|
|
|
|
|
our $blacks ; |
|
50
|
|
|
|
|
|
|
our $cadinit; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub menu { |
|
54
|
|
|
|
|
|
|
($whites,$blacks,$cadinit)=@_ ; |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
$varset= $cadinit || "Blitz Usuel 0" ; |
|
57
|
|
|
|
|
|
|
$screensz=$screensz || 2 ; |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# build main window menu |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $mw=MainWindow->new(-title=>qq(Réglages Pendule)) ; |
|
62
|
|
|
|
|
|
|
$mw->geometry("320x6") ; |
|
63
|
|
|
|
|
|
|
#$mw->grabGlobal ; |
|
64
|
|
|
|
|
|
|
my $top=$mw->toplevel; |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my $menubar =$top->Menu(-type => 'menubar'); |
|
67
|
|
|
|
|
|
|
$top->configure(-menu => $menubar); |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
foreach my $m (@menu) { |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
# creation des sous-menus en cascade |
|
72
|
|
|
|
|
|
|
$sous_menuref{$m} = $menubar->cascade(-label=>$m) ; |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# entrées des données des sous-menus |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
map($soussous_ref{$m}{$_}= $sous_menuref{$m}->cascade(-label=>$_),@{$sous_menu{$m}}); |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
foreach my $type (keys %soussous_ref) { |
|
81
|
|
|
|
|
|
|
for my $cadence (keys %{$soussous_ref{$type} }) { |
|
82
|
|
|
|
|
|
|
map {$rb{$type}{$cadence}[$_]=$soussous_ref{$type}{$cadence}->radiobutton( |
|
83
|
|
|
|
|
|
|
-indicatoron =>'1', |
|
84
|
|
|
|
|
|
|
-command=>[\®lage,$whites,$blacks,""], |
|
85
|
|
|
|
|
|
|
-label=>${$soussous{$type}{$cadence} }[$_], |
|
86
|
|
|
|
|
|
|
-variable=>\$varset, |
|
87
|
|
|
|
|
|
|
-value =>$type." ".$cadence . " ". $_) } ( 0..$#{$soussous{$type}{$cadence} } ) ; |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
for (qw/Cadence2 Cadence3 Cadence4/) { |
|
91
|
|
|
|
|
|
|
$rb{ReglagesManuels}{$_}[0]->configure (-state=>'disabled') ; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
#$soussous_ref{Aide}{Bref}= $sous_menuref{Aide}->cascade(-label=>'En Bref') ; |
|
96
|
|
|
|
|
|
|
#my $cmd=$soussous_ref{Aide}{Bref}->command(-label=>'voir',-command=>\&voir) ; |
|
97
|
|
|
|
|
|
|
$sous_menuref{Aide}->command(-label=>'En Bref',-command=>[\&voir,%aide]) ; |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
$soussous_ref{ReglagesManuels}{Options}->command(-label=>'Adjust',-command=>\&adjust) ; |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
map {$rb{ReglagesManuels}{Mode}[$_]=$soussous_ref{ReglagesManuels}{Mode}->radiobutton( |
|
102
|
|
|
|
|
|
|
-indicatoron =>'1', |
|
103
|
|
|
|
|
|
|
-command=>sub{ |
|
104
|
|
|
|
|
|
|
#0=>x0.5,1,=>x0.75 2=>x1.00 |
|
105
|
|
|
|
|
|
|
&GclkDisplay::loupe(0.5+$screensz*0.25)}, |
|
106
|
|
|
|
|
|
|
-label=>$Mode[$_], |
|
107
|
|
|
|
|
|
|
-variable=>\$screensz, |
|
108
|
|
|
|
|
|
|
-value =>$_) } ( 0..$#Mode ) ; |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
map {$rb{ReglagesManuels}{Mode}[$_]->configure (-state=>'disabled')} ( 0..$#Mode ) ; ; |
|
111
|
|
|
|
|
|
|
} |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub adjust{ |
|
114
|
|
|
|
|
|
|
use Tk::Spinbox ; |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
my $sbxctw=MainWindow->new(-title=>qq(Adjustement Temps Blancs)) |
|
117
|
|
|
|
|
|
|
->Spinbox(-from=>'0',-to=>'1E6',-increment=>'1.0',-width=>'40' ) ; |
|
118
|
|
|
|
|
|
|
my $parentctw=$sbxctw->parent ; |
|
119
|
|
|
|
|
|
|
$parentctw->geometry("300x20+500+0") ; |
|
120
|
|
|
|
|
|
|
# my $val =$sbxctw->cget(-validate); |
|
121
|
|
|
|
|
|
|
# $sbxctw->configure(-validate => $val); |
|
122
|
|
|
|
|
|
|
$sbxctw->set($whites->[0]{ct}) ; |
|
123
|
|
|
|
|
|
|
$sbxctw->configure(-validate => 'key', |
|
124
|
|
|
|
|
|
|
-command=> sub{ |
|
125
|
|
|
|
|
|
|
$whites->[0]{ct}=$sbxctw->get ; |
|
126
|
|
|
|
|
|
|
} |
|
127
|
|
|
|
|
|
|
); |
|
128
|
|
|
|
|
|
|
$sbxctw->pack ; |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
my $sbxctb=MainWindow->new(-title=>qq(Adjustement Temps Noirs)) |
|
131
|
|
|
|
|
|
|
->Spinbox(-from=>'0',-to=>'1E6',-increment=>'1.0',-width=>'40' ) ; |
|
132
|
|
|
|
|
|
|
my $parentctb=$sbxctb->parent ; |
|
133
|
|
|
|
|
|
|
$parentctb->geometry("300x20+500+50") ; |
|
134
|
|
|
|
|
|
|
$sbxctb->set($blacks->[0]{ct}) ; |
|
135
|
|
|
|
|
|
|
$sbxctb->configure(-validate => 'key', |
|
136
|
|
|
|
|
|
|
-command=> sub{ |
|
137
|
|
|
|
|
|
|
$blacks->[0]{ct}=$sbxctb->get ; |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
); |
|
140
|
|
|
|
|
|
|
$sbxctb->pack ; |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
my $sbxmvw=MainWindow->new(-title=>qq(Adjustement Coups Blancs)) |
|
143
|
|
|
|
|
|
|
->Spinbox(-from=>'0',-to=>'1E6',-increment=>'1.0',-width=>'40' ) ; |
|
144
|
|
|
|
|
|
|
my $parentmvw=$sbxmvw->parent ; |
|
145
|
|
|
|
|
|
|
$parentmvw->geometry("300x20+820+0") ; |
|
146
|
|
|
|
|
|
|
$sbxmvw->set($whites->[0]{mv}) ; |
|
147
|
|
|
|
|
|
|
$sbxmvw->configure(-validate => 'key', |
|
148
|
|
|
|
|
|
|
-command=> sub{ |
|
149
|
|
|
|
|
|
|
my $diff=$whites->[0]{mv}-$sbxmvw->get ; |
|
150
|
|
|
|
|
|
|
$whites->[0]{mv}-=$diff ; |
|
151
|
|
|
|
|
|
|
$whites->[0]{mvt}-=$diff ; |
|
152
|
|
|
|
|
|
|
} |
|
153
|
|
|
|
|
|
|
); |
|
154
|
|
|
|
|
|
|
$sbxmvw->pack ; |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
my $sbxmvb=MainWindow->new(-title=>qq(Adjustementcoups Noirs)) |
|
157
|
|
|
|
|
|
|
->Spinbox(-from=>'0',-to=>'1E6',-increment=>'1.0',-width=>'40' ) ; |
|
158
|
|
|
|
|
|
|
my $parentmvb=$sbxmvb->parent ; |
|
159
|
|
|
|
|
|
|
$parentmvb->geometry("300x20+820+50") ; |
|
160
|
|
|
|
|
|
|
$sbxmvb->set($blacks->[0]{mv}) ; |
|
161
|
|
|
|
|
|
|
$sbxmvb->configure(-validate => 'key', |
|
162
|
|
|
|
|
|
|
-command=> sub{ |
|
163
|
|
|
|
|
|
|
my $diff= $blacks->[0]{mv}-$sbxmvb->get ; |
|
164
|
|
|
|
|
|
|
$blacks->[0]{mv}-=$diff ; |
|
165
|
|
|
|
|
|
|
$blacks->[0]{mvt}-=$diff ; |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
); |
|
168
|
|
|
|
|
|
|
$sbxmvb->pack ; |
|
169
|
|
|
|
|
|
|
} |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub voir { |
|
172
|
|
|
|
|
|
|
my %aide=@_ ; |
|
173
|
|
|
|
|
|
|
my $mwaide=MainWindow->new(-title=>"Help") ; |
|
174
|
|
|
|
|
|
|
my $b=$mwaide->Button(-text=>$aide{Fr}.$aide{En}, |
|
175
|
|
|
|
|
|
|
-anchor=>'nw', |
|
176
|
|
|
|
|
|
|
-justify=>'left', |
|
177
|
|
|
|
|
|
|
-wraplength=>'250', # 0 par défaut |
|
178
|
|
|
|
|
|
|
-width=>'45')->pack(-fill=>'both') ; |
|
179
|
|
|
|
|
|
|
$b->configure(-text=>$aide{Fr}.$aide{En}, |
|
180
|
|
|
|
|
|
|
-anchor=>'nw', |
|
181
|
|
|
|
|
|
|
-justify=>'left', |
|
182
|
|
|
|
|
|
|
-wraplength=>'250', # 0 par défaut |
|
183
|
|
|
|
|
|
|
-width=>'45'); |
|
184
|
|
|
|
|
|
|
} |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub reglage { |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
($whites,$blacks, my $cadence)=@_ ; |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
# if $varset != Reglages Manuels init counter with $varset |
|
191
|
|
|
|
|
|
|
# note a call to menu before must call reglage as ($w,$b,"") |
|
192
|
|
|
|
|
|
|
# for not smashing $varset |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
$varset= $cadence || $varset; |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
print "reglage : $varset \n" ; |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
my @default= ({ ct=>'0', #cadence 1 |
|
200
|
|
|
|
|
|
|
mv=>'0', # if 0 means KO else number of moves |
|
201
|
|
|
|
|
|
|
b=>'0', # fisher ou bronstein |
|
202
|
|
|
|
|
|
|
f=>'0', |
|
203
|
|
|
|
|
|
|
byo=>'1'}, {qw/ct 0 mv 0 b 0 f 0 byo 1/}) ; |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
my @status_var_h ; |
|
206
|
|
|
|
|
|
|
my @status_var_m ; |
|
207
|
|
|
|
|
|
|
my @status_var_s ; |
|
208
|
|
|
|
|
|
|
my @status_var_mv ; |
|
209
|
|
|
|
|
|
|
my $status_var_both=0 ; |
|
210
|
|
|
|
|
|
|
my $status_var_byo=1 ; |
|
211
|
|
|
|
|
|
|
my @status_var_bf ; |
|
212
|
|
|
|
|
|
|
my $status_bf ; |
|
213
|
|
|
|
|
|
|
my @set_hour ; |
|
214
|
|
|
|
|
|
|
my @set_mn ; |
|
215
|
|
|
|
|
|
|
my @set_sec ; |
|
216
|
|
|
|
|
|
|
my @set_mv ; |
|
217
|
|
|
|
|
|
|
my @set_fb ; |
|
218
|
|
|
|
|
|
|
my %proch1 ; |
|
219
|
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
if ($varset =~ /ReglagesManuels/) { |
|
221
|
|
|
|
|
|
|
my $mw = MainWindow->new(-title=>'Reglages Manuels'); |
|
222
|
|
|
|
|
|
|
#$mw->configure(-background=>'blue') ; |
|
223
|
|
|
|
|
|
|
foreach (0,1) { |
|
224
|
|
|
|
|
|
|
$set_hour[$_]=$mw->Scale(-from =>0,-to =>12,-length=>'5c',-label=>"hrs ",-troughcolor=>'green', |
|
225
|
|
|
|
|
|
|
-background=>'yellow',-variable=>\$status_var_h[$_]) ->pack(-side=>'left'); |
|
226
|
|
|
|
|
|
|
$set_mn[$_]= $mw->Scale(-from =>0,-to =>60,-length=>'5c',-label=>"mns ",-variable=>\$status_var_m[$_]) ->pack(-side=>'left'); |
|
227
|
|
|
|
|
|
|
$set_sec[$_]= $mw->Scale(-from =>0,-to =>60,-length=>'5c',-label=>"secs",-variable=>\$status_var_s[$_]) ->pack(-side=>'left'); |
|
228
|
|
|
|
|
|
|
$set_mv[$_]= $mw->Scale(-from =>0,-to =>60,-length=>'5c',-label=>"coups",-variable=>\$status_var_mv[$_])->pack(-side=>'left'); |
|
229
|
|
|
|
|
|
|
$set_fb[$_]= $mw->Scale(-from =>0,-to =>60,-length=>'5c',-label=>"sec F/B",-variable=>\$status_var_bf[$_])->pack(-side=>'left'); |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
$set_fb[$_]->configure( # -wraplength =>'8', |
|
232
|
|
|
|
|
|
|
# -sliderlength=>'10', |
|
233
|
|
|
|
|
|
|
# -tickinterval=>'10', |
|
234
|
|
|
|
|
|
|
-width =>'10' ) ; |
|
235
|
|
|
|
|
|
|
} |
|
236
|
|
|
|
|
|
|
# backannotate |
|
237
|
|
|
|
|
|
|
my $t="ReglagesManuels" ; |
|
238
|
|
|
|
|
|
|
my @f=split(' ',$varset); |
|
239
|
|
|
|
|
|
|
my $c=$f[1] ; |
|
240
|
|
|
|
|
|
|
my $n=substr($c,7,1) ; |
|
241
|
|
|
|
|
|
|
my $i=0 ; # mais cadence =[%cad1,%cad2,%cad3,%cad4] |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
if (defined($whites->[$n]{ct})) { |
|
244
|
|
|
|
|
|
|
($status_var_h[0],$status_var_m[0],$status_var_s[0])=&GclkDisplay::hmnsec($whites->[$n]{ct}) ; |
|
245
|
|
|
|
|
|
|
$status_var_mv[0]=$whites->[$n]{mv} ; |
|
246
|
|
|
|
|
|
|
$status_var_bf[0]=$whites->[$n]{b} + $whites->[$n]{f} ; |
|
247
|
|
|
|
|
|
|
$status_bf=$whites->[$n]{b} ? 0 : 1 ; |
|
248
|
|
|
|
|
|
|
$status_var_byo=$whites->[$n]{byo} ; |
|
249
|
|
|
|
|
|
|
($status_var_h[1],$status_var_m[1],$status_var_s[1])=&GclkDisplay::hmnsec($blacks->[$n]{ct}) ; |
|
250
|
|
|
|
|
|
|
$status_var_mv[1]=$blacks->[$n]{mv} ; |
|
251
|
|
|
|
|
|
|
$status_var_bf[1]=$blacks->[$n]{b} + $blacks->[$n]{f} ; |
|
252
|
|
|
|
|
|
|
#$status_var_byo[1]=$blacks->[$n]{byo} ; unicity of type |
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
my $b=$mw->Button(-text=>'valider', |
|
255
|
|
|
|
|
|
|
-command=>sub{ |
|
256
|
|
|
|
|
|
|
foreach (0..1) { |
|
257
|
|
|
|
|
|
|
$default[$_]{byo}=$status_var_byo ? 0 : 1 ; |
|
258
|
|
|
|
|
|
|
my $j ; |
|
259
|
|
|
|
|
|
|
$j=$status_var_both ==1 ? 0 :$_ ; |
|
260
|
|
|
|
|
|
|
$default[$_]{ct}=60*($status_var_h[$j]*60+$status_var_m[$j])+$status_var_s[$j] ; |
|
261
|
|
|
|
|
|
|
$default[$_]{mv}=$status_var_mv[$j] ; |
|
262
|
|
|
|
|
|
|
$status_bf ? $default[$_]{f}=$status_var_bf[$j] : $default[$_]{b}=$status_var_bf[$j] ; |
|
263
|
|
|
|
|
|
|
} |
|
264
|
|
|
|
|
|
|
; |
|
265
|
|
|
|
|
|
|
# my $t="ReglagesManuels" ; |
|
266
|
|
|
|
|
|
|
# my $c="Cadence1" ; |
|
267
|
|
|
|
|
|
|
# my @f=split(' ',$varset); |
|
268
|
|
|
|
|
|
|
# my $c=$f[1] ; |
|
269
|
|
|
|
|
|
|
# my $i=0 ; # mais cadence =[%cad1,%cad2,%cad3,%cad4] |
|
270
|
|
|
|
|
|
|
map{ $cad{$t}{$c}[$i]{$_}=$default[0]{$_} } (qw/ct mv b f byo/) ; |
|
271
|
|
|
|
|
|
|
$whites->init($varset,'blancs') ; |
|
272
|
|
|
|
|
|
|
map {$cad{$t}{$c}[$i]{$_}=$default[1]{$_}} (qw/ct mv b f byo/) ; |
|
273
|
|
|
|
|
|
|
$blacks->init($varset,'noirs') ; |
|
274
|
|
|
|
|
|
|
# enable next cadence selection |
|
275
|
|
|
|
|
|
|
map {$proch1{"Cadence" . $_}="Cadence". ($_+1) } (0..4); |
|
276
|
|
|
|
|
|
|
$rb{ReglagesManuels}{$proch1{$c}}[0]->configure(-state=>'normal') if(defined($rb{ReglagesManuels}{$proch1{$c} }[0])) ; |
|
277
|
|
|
|
|
|
|
$mw->destroy ; })->pack(-side=>'bottom') ; |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
my $bb= $mw->Radiobutton(-text=>'Bronstein',-variable=>\$status_bf,-value=>'0')->pack(-side=>'bottom') ; |
|
280
|
|
|
|
|
|
|
my $bf= $mw->Radiobutton(-text=>'Fisher ',-variable=>\$status_bf,-value=>'1')->pack(-side=>'bottom') ; |
|
281
|
|
|
|
|
|
|
$status_bf ? $bf->select:$bb->select ; |
|
282
|
|
|
|
|
|
|
my $both=$mw->Checkbutton(-text=>'Jumelé ', |
|
283
|
|
|
|
|
|
|
-variable=>\$status_var_both, |
|
284
|
|
|
|
|
|
|
-command=>sub{ |
|
285
|
|
|
|
|
|
|
my $i=$status_var_both ? 0 : 1 ; |
|
286
|
|
|
|
|
|
|
$set_hour[1]->configure(-variable => \$status_var_h[$i]); |
|
287
|
|
|
|
|
|
|
$set_mn[1] ->configure(-variable => \$status_var_m[$i]); |
|
288
|
|
|
|
|
|
|
$set_sec[1] ->configure(-variable => \$status_var_s[$i]); |
|
289
|
|
|
|
|
|
|
$set_mv[1] ->configure(-variable => \$status_var_mv[$i]); |
|
290
|
|
|
|
|
|
|
$set_fb[1] ->configure(-variable => \$status_var_bf[$i]); |
|
291
|
|
|
|
|
|
|
} |
|
292
|
|
|
|
|
|
|
)->pack(-side=>'bottom') ; |
|
293
|
|
|
|
|
|
|
my $byoyomi=$mw->Checkbutton(-text=>'Byo-Yomi ', |
|
294
|
|
|
|
|
|
|
-variable=>\$status_var_byo |
|
295
|
|
|
|
|
|
|
)->pack(-side=>'bottom') ; |
|
296
|
|
|
|
|
|
|
$status_var_byo ? $byoyomi->deselect: $byoyomi->select ; |
|
297
|
|
|
|
|
|
|
$both->deselect ; |
|
298
|
|
|
|
|
|
|
#$both->invoke ; |
|
299
|
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
} else { |
|
301
|
|
|
|
|
|
|
$whites->init($varset,'blancs') ; |
|
302
|
|
|
|
|
|
|
$blacks->init($varset,'noirs') ; |
|
303
|
|
|
|
|
|
|
} |
|
304
|
|
|
|
|
|
|
} |
|
305
|
|
|
|
|
|
|
=head1 NAME |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
GclkSettings - For setting the parameters with a GUI. |
|
308
|
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=head1 VERSION |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
Version 1.0 |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=cut |
|
314
|
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
This module is a GUI to set the parameters of GameClock. |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=head1 EXPORT |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
&menu |
|
323
|
|
|
|
|
|
|
®lage |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=head1 FUNCTIONS |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=head2 menu |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
Generate the menu window of the GUI |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
=cut |
|
332
|
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
=head2 adjust |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
This routine is done to adjust the time and |
|
336
|
|
|
|
|
|
|
move number of each players, not for the initial setting. |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
The main reason is for correcting mistakes |
|
339
|
|
|
|
|
|
|
or for arbiters, when playing. |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
Of course, this must be done in halt mode, |
|
342
|
|
|
|
|
|
|
but there is no check. |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
Note: the return key does not validate, |
|
345
|
|
|
|
|
|
|
only the spin buttons can do that. |
|
346
|
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=head2 reglage |
|
348
|
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
This routine provides the interface for |
|
350
|
|
|
|
|
|
|
the manuel setting of data via ProgressBars |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=cut |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=head2 voir |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
A routine to show a hint in the menu |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=cut |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
=head1 AUTHOR |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
Charles Minc, C<< >> |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
=head1 BUGS |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
|
367
|
|
|
|
|
|
|
C, or through the web interface at |
|
368
|
|
|
|
|
|
|
L. |
|
369
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
|
370
|
|
|
|
|
|
|
your bug as I make changes. |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
=head1 SUPPORT |
|
373
|
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
perldoc GameClock |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
You can also look for information at: |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=over 4 |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
L |
|
385
|
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
=item * CPAN Ratings |
|
387
|
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
L |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
L |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
=item * Search CPAN |
|
395
|
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
L |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=back |
|
399
|
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
|
401
|
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
|
403
|
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
Copyright 2006 Charles Minc, all rights reserved. |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
407
|
|
|
|
|
|
|
under the same terms as Perl itself. |
|
408
|
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
=cut |
|
410
|
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
1; # End of GclkSettings |