# Tranlation of FloatEnt.tcl in Tix4.1
# o extract a widget (SimpleEntry?) without post/unpost methods
# and derive FloatEntry fron this widget.
$DEBUG = (defined($ENV{USER
}) and $ENV{USER
} eq 'achx') ?
1 : 0;
print STDERR
"tixGrid: debug = $DEBUG\n" if $DEBUG;
$VERSION = '3.006'; # $Id: //depot/Tk8/TixGrid/FloatEntry.pm#6 $
use base qw(Tk::Derived Tk::Entry);
Construct Tk
::Widget
'FloatEntry';
$class->SUPER::ClassInit
($mw);
$mw->bind($class, '<Return>', 'invoke');
$mw->bind($class, '<FocusIn>', 'FocusIn');
-value
=> ['METHOD', 'value', 'Value', undef],
-highlightthickness
=> [$e, 'highlightThickness', 'HighlightThickness', 0 ],
-command
=> ['CALLBACK', 'command', 'Command', undef],
print "FloatEntry Init: $e\n" if $DEBUG;
$e->selection('from', 0);
$e->selection('to', 'end');
$e->Callback('-command', $e->get);
my ($e, $x, $y, $dx, $dy) = @_;
$dx = $e->reqwidth unless defined $dx;
$dy = $e->reqheight unless defined $dy;
$e->place('-x'=>$x, '-y'=>$y, -width
=>$dx, -height
=>$dy, -bordermode
=>'ignore');
# FIX: xxx only if entry has not already focus
$e->selection('from', 0);
$e->selection('to', 'end');