Tk-HexEntry
view release on metacpan or search on metacpan
HexEntry.pm view on Meta::CPAN
);
$f->gridColumnconfigure(0, -weight => 1);
$f->gridColumnconfigure(1, -weight => 0);
$f->gridRowconfigure(0, -weight => 1);
$f->gridRowconfigure(1, -weight => 1);
if ($orient eq 'vertical') {
$binc->grid(-row => 0, -column => 1, -sticky => 'news');
$bdec->grid(-row => 1, -column => 1, -sticky => 'news');
} else {
$binc->grid(-row => 0, -column => 2, -sticky => 'news');
$bdec->grid(-row => 0, -column => 1, -sticky => 'news');
}
$e->grid(-row => 0, -column => 0, -rowspan => 2, -sticky => 'news');
$f->ConfigSpecs(
-borderwidth => ['SELF' => "borderWidth", "BorderWidth", 2 ],
-relief => ['SELF' => "relief", "Relief", "sunken" ],
-background => ['CHILDREN' => "background", "Background", Tk::NORMAL_BG ],
-foreground => ['CHILDREN' => "background", "Background", Tk::BLACK ],
-buttons => ['METHOD' => undef, undef, 1 ],
-state => ['CHILDREN' => "state", "State", "normal" ],
-repeatdelay => [[$binc,$bdec]
=> "repeatDelay", "RepeatDelay", 300 ],
-repeatinterval
=> [[$binc,$bdec]
=> "repeatInterval",
"RepeatInterval",
100 ],
-highlightthickness
=> [SELF => "highlightThickness",
"HighlightThickness",
2 ],
DEFAULT => [$e],
);
$f->Delegates(DEFAULT => $e);
$f;
}
sub HexEntryPlainWidget { "HexEntryPlain" }
sub FireButtonWidget { "FireButton" }
sub IncFireButtonWidget { shift->FireButtonWidget }
sub DecFireButtonWidget { shift->FireButtonWidget }
sub buttons {
my $f = shift;
my $var = \$f->{Configure}{'-buttons'};
my $old = $$var;
if(@_) {
my $val = shift;
$$var = $val ? 1 : 0;
my $e = $f->Subwidget('entry');
my %info = $e->gridInfo; $info{'-sticky'} = 'news';
delete $info{' -sticky'};
$e->grid(%info, -columnspan => $val ? 1 : 2);
$e->raise;
}
$old;
}
1;
__END__
=head1 NAME
Tk::HexEntry - A hexadecimal Entry widget with inc. & dec. Buttons
=head1 SYNOPSIS
S< >B<use Tk::HexEntry;>
S< >I<$parent>-E<gt>B<HexEntry>(?I<-option>=E<gt>I<value>, ...?);
=head1 ATTENTION
This is only a changed copy from Tk::NumEntry and Tk::NumEntryPlain
write from Graham Barr <F<gbarr@pobox.com>>. Thanks for this great Module!
=head1 DESCRIPTION
B<Tk::HexEntry> defines a widget for entering hexadecimal numbers. The widget
also contains buttons for increment and decrement.
B<Tk::HexEntry> supports all the options and methods that the plain
HexEntry widget provides (see L<Tk::HexEntryPlain>), plus the
following options
=head1 STANDARD OPTIONS
Besides the standard options of the L<Entry|Tk::Entry> widget
HexEntry supports:
B<-orient> B<-repeatdelay> B<-repeatinterval>
The B<-orient> option specifies the packing order of the increment and
decrement buttons. This option can only be set at creation time.
=head1 WIDGET-SPECIFIC OPTIONS
=over 4
=item Name: B<buttons>
=item Class: B<Buttons>
=item Switch: B<-buttons>
=item Fallback: B<1>
Boolean that defines if the inc and dec buttons are visible.
=item Switch: B<-readonly>
( run in 1.118 second using v1.01-cache-2.11-cpan-39bf76dae61 )