- labels: --> Win32::GUI Core
Hi,
it seems, that WM-COMMAND-messages for TabStrip (and
maybe other) child controls aren't handled correctly.
The attached example demonstrates the problem:
-------------------------------------------------------
-----------------
#!perl -w
use Win32::GUI ();
my $mw = new Win32::GUI::Window
( -name => 'mw',
-left => 100,
-top => 100,
-width => 150,
-height => 100,
-title => 'PopupTest',
-onMouseRightDown => \&popup,
);
my $ml = $mw ->AddLabel
( -name => 'ml',
-left => 50,
-top => 38,
-width => 90,
-height => 20,
);
my $ts = $mw -> AddTabStrip
( -name => 'ts',
-left => 0,
-top => 0,
-width => $mw -> ScaleWidth (),
-height => 21,
-onMouseRightDown => \&popup,
);
( $ts -> InsertItem
( -index => $_,
-text => "Test_0$_",
)
) for ( 0 .. 1 );
my $pm = Win32::GUI::MakeMenu
( 'tabstrip_menu' => 'tabstrip_menu',
'> Test_00'
=> { -name => 'menu_item_00000',
-onClick => sub { $ml -> Text
( 'Test_00' ) },
},
'> Test_01'
=> { -name => 'menu_item_00001',
-onClick => sub { $ml -> Text
( 'Test_01' ) },
},
);
$mw -> Show ();
Win32::GUI::Dialog ();
sub popup
{
my $self = shift ();
$self -> TrackPopupMenu ( $pm ->
{ 'tabstrip_menu' },
Win32::GUI::GetCursorPos
()
);
return ( 0 );
}
-------------------------------------------------------
-----------------