Hello,

Here is a simple wxperl window with four textctrls. I cannot build a function 
which could catch keybord event (like pressing F8 or PgDn or 'a' keys) when I 
am focusing on textctrl. When I have TreeCtrl object I can do that: it's enough 
to use the following structure, where $this means treectrl object.

use Wx::Event qw( EVT_TREE_KEY_DOWN );
EVT_TREE_KEY_DOWN         ( $this, $this, \&Onkeydown   );

However how to get this in textctrl case? In the treectrl I have 
EVT_TREE_KEY_DOWN event but I cannot find this kind of event: EVT_TEXT_KEY_DOWN.
In the attached example I'd like to move among these four fields using Tab, 
ShiftTab, Down and Up keys. Is that possible? Could someone direct me?

Regards
Waldemar


In Windows I have a version of the Wx where the Wx::SimpleApp does not exist. I 
have to change Wx::SimpleApp into Wx::App and exchange the return value of the 
function OnInit to 1 (only to run the example). In linux it runs.

##################################################################
use Wx qw ( wxDEFAULT_FRAME_STYLE );

use vars qw(@ISA);
@ISA = qw(Wx::Frame);

#---------------------------------------------------------------------------------------------------
my $app = Wx::SimpleApp->new;
my $frame = Wx::Frame->new( undef, -1, "4 fields", [ 100, 100 ], [ 250, 120 ], 
wxDEFAULT_FRAME_STYLE );
my $fga = new Wx::Colour( 0, 100, 0 );
$frame->SetBackgroundColour( $fga );

my $text11 = Wx::TextCtrl->new( $frame, -1, 11, [ 10 , 10 ], [ 100, 20], 
2097680 );
my $text12 = Wx::TextCtrl->new( $frame, -1, 12, [111 , 10 ], [ 100, 20], 
2097680 );
my $text21 = Wx::TextCtrl->new( $frame, -1, 21, [ 10 , 31 ], [ 100, 20], 
2097680 );
my $text22 = Wx::TextCtrl->new( $frame, -1, 22, [111 , 31 ], [ 100, 20], 
2097680 );

$frame->Show( 1 );
$app->MainLoop;
###########################################

Reply via email to