Hi,
wxTAB_TRAVERSAL is the default style setting for Wx::Panel. I only need
to be explicit about it as I'm setting other style flags in the constructor.
It is possible to have a Wx::Panel get the focus, and if you don't have
the wxTAB_TRAVERSAL set, navigation may not work as expected. (The panel
will receive your key events rather than the child controls).
Unless you are setting some flags explicitly yourself in the
constructor, Wx::Panel will have the syle wxTAB_TRAVERSAL set by default.
Rgds
Mark
On 06/06/2011 16:59, Octavian Rasnita wrote:
Hi Mark,
Why is wxTAB_TRAVERSAL needed in a panel?
Tabbing from a field to the previous/next by using the shift+tab/tab keys were
possible in non-dialog windows when using a panel.
Should the wxTAB_TRAVERSAL style be used for beeing able to do this, and the
previous way was just a helpful bug?
Or wxTAB_TRAVERSAL should be used for another efect?
Thanks.
Octavian
----- Original Message -----
From: "Mark Dootson"<mark.doot...@znix.com>
To:<wxperl-users@perl.org>
Sent: Monday, June 06, 2011 5:50 PM
Subject: Re: What good is a Wx::Panel?
On 06/06/2011 15:43, Shawn H Corey wrote:
On 11-06-06 10:25 AM, Mark Dootson wrote:
My tip would be to always use a Wx::Panel within the Wx::Frame. If you
don't, you will get unexpected and annoying differences in background
drawing between different platforms.
OK, it the anything I _should_ do with the panel?
My standard frame creations look something like:
my $frame = Wx::Frame->new(undef, -1, 'Frame Title');
my $mainpanel = Wx::Panel->new($frame, -1, [-1,-1], [-1,-1],
wxTAB_TRAVERSAL|wxBORDER_NONE);
...
my $childcontrol = Wx::SomeControl->new($mainpanel, ......
my $framesizer = Wx::BoxSizer->new(wxVERTICAL);
$framesizer->Add($mainpanel, 1, wxEXPAND|wxALL, 0);
my $mainsizer = Wx::BoxSizer->new(wxVERTICAL);
$mainsizer->Add($childcontrol, ........
$mainpanel->SetSizer($mainsizer);
$frame->SetSizer( $framesizer );
I'm trying to write a simple todo app (like the world needs another one)
because it should be simple enough to help me learn WxPerl but complex
enough so I learn something useful.
I think I put my endeavours on the wiki. :)
Excellent idea.