You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(31) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
|
Mar
(17) |
Apr
(17) |
May
(27) |
Jun
(67) |
Jul
(26) |
Aug
(15) |
Sep
(2) |
Oct
(24) |
Nov
(6) |
Dec
|
2007 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(28) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
(21) |
Feb
(45) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(3) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
11
(5) |
12
(1) |
13
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
31
|
|
|
|
|
From: Robert M. <rob...@us...> - 2006-01-12 22:23:35
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5523 Modified Files: GUI.h Log Message: Add NOTIFYICONDATA_V1_SIZE macro for MinGW Index: GUI.h =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** GUI.h 11 Jan 2006 21:26:14 -0000 1.24 --- GUI.h 12 Jan 2006 22:23:27 -0000 1.25 *************** *** 780,783 **** --- 780,788 ---- #endif #endif + + #ifndef NOTIFYICONDATA_V1_SIZE + # define NOTIFYICONDATA_V1_SIZE CCSIZEOF_STRUCT(NOTIFYICONDATA, szTip[63]) + #endif + #else #define WNDPROC_CAST FARPROC |
From: Robert M. <rob...@us...> - 2006-01-11 21:39:49
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/docs/GUI/Tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8989/docs/GUI/Tutorial Modified Files: Part4.pod Log Message: Fix NotifyIcon description Index: Part4.pod =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/docs/GUI/Tutorial/Part4.pod,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Part4.pod 13 Nov 2005 18:57:52 -0000 1.3 --- Part4.pod 11 Jan 2006 21:39:41 -0000 1.4 *************** *** 156,160 **** you can use this line: ! $main->NI->Delete(-id => 1); =back --- 156,160 ---- you can use this line: ! $main->NI->Remove(); =back |
From: Robert M. <rob...@us...> - 2006-01-11 21:26:30
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/docs/GUI/Tutorial In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5945/docs/GUI/Tutorial Modified Files: Part3.pod Log Message: Add Notify Icon Balloon Tooltips; Re-work splitter class; bug fixes Index: Part3.pod =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/docs/GUI/Tutorial/Part3.pod,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Part3.pod 5 Oct 2005 22:20:49 -0000 1.2 --- Part3.pod 11 Jan 2006 21:26:16 -0000 1.3 *************** *** 96,100 **** Recent versions of Win32::GUI have a C<-dialogui> option that controls the ! special keyboard handling. Setting this option to C<1> on a basic Window add the special key handling to the window; setting it to C<0> on a DialogBox removes the special key handling. --- 96,100 ---- Recent versions of Win32::GUI have a C<-dialogui> option that controls the ! special keyboard handling. Setting this option to C<1> on a basic Window adds the special key handling to the window; setting it to C<0> on a DialogBox removes the special key handling. |
Update of /cvsroot/perl-win32-gui/Win32-GUI/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5945/t Added Files: 05_NotifyIcon_01_Constructor.t 05_NotifyIcon_02_Change.t 05_NotifyIcon_03_OtherMethods.t 05_NotifyIcon_04_Remove.t 05_NotifyIcon_05_DESTROY.t Log Message: Add Notify Icon Balloon Tooltips; Re-work splitter class; bug fixes --- NEW FILE: 05_NotifyIcon_04_Remove.t --- #!perl -wT # Win32::GUI test suite. # $Id: 05_NotifyIcon_04_Remove.t,v 1.1 2006/01/11 21:26:16 robertemay Exp $ # # test coverage of Notify Icons use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More tests => 9; use Win32::GUI(); use Win32::GUI::BitmapInline(); my $icon = geticon(); my $ctrl = "NotifyIcon"; my $class = "Test::$ctrl"; # Testing Remove() my $W = new Win32::GUI::Window( -name => "TestWindow", ); my $C = Test::NotifyIcon->new( $W, -name => "NI", -icon => $icon ); isa_ok($C,$class, "\$W->AddNotifyIcon creates $class object"); isa_ok($W->NI, $class, "\$W->NI contains a $class object"); my $id = $C->{-id}; ok(($id > 0), "NI's -id > 0"); ok(defined $W->{-notifyicons}->{$id}, "NI's id is stored in parent"); is($W->{-notifyicons}->{$id}, 'NI', "Timer's name is stored in parent"); # Remove tests is($Test::NotifyIcon::x, 0, "DESTROY not called yet"); $C->Remove(); ok(!defined $W->{-notifyicons}->{$id}, "NI's id is removed from parent"); ok(!defined $W->{NI}, "object reference removed from parent"); is($Test::NotifyIcon::x, 1, "DESTROY called by Remove"); exit(0); ### -- helper functions -- sub geticon { return newIcon Win32::GUI::BitmapInline( q( AAABAAIAICAQAAAAAADoAgAAJgAAACAgAAAAAAAAqAgAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAA AIACAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAA AAD/AAD/AAAA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aGhgB6 enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ AAAA//8A/wAAAP8A/wD//wAA////AOnp6enp6enp6enp6enp6enp6enp6enp6enp6enp6enr5+T/ //////8AAAAA6+sAAAcHBwAAAOvr6///////5Ovn5P///////wAAAOsAB+sA6wcAAADrAOvr//// ///k6+fk////////AAAA6wDr6+vrAAAAAAAA6wD//////+Tr5+T///////8AAAAAAOvr6wAAAAAA AAAAAP//////5Ovn5P///////wAA6+sAB+vrAAAAAAAAAAAA///////k6+fk////////AADr6wAH BwcAAADrAAAAAAD//////+Tr5+T///////8AAADr6wAHB+sAAAAAAAAAAOv/////5Ovn5P////// /wAAAAAA6+sA6+vrAAAAAAAAAP/////k6+fk////////AAAAAAAAAAAAAOvrAOvrAOsA/////+Tr 5+T/////////AAAAAAAAAAAAAAfr6+vrAAAA////5Ovn5P////////8AAAAA6+sA6wAAAOvrAOvr AAD////k6+fk//////////8AAAAA6wcHAAAAAADrAAAAAP///+Tr5+T//////////+sAAAAAAAAH AAAAAAAAAAAA////5Ovn5P///////////wAA6wDrBwcAAAAAAAAAAAD////k6+fk//////////// AADrAAAHBwcABwAAAADr6+v//+Tr5+T/////////6wAAAOvr6wcHB+sA6wAAAOsAB///5Ovn5P// /wAAAAAAAOvrAAAHBwcH6wAA6wAAAAAH///k6+fk////AAAA6wcHBwcHBwfr6+vrAAAAAAAAAOv/ /+Tr5+T//+sHBwfrBwcHBwcHAAAAAOvrAAAAAADr////5Ovn5P/rAOsHBwcHBwcHBwAAAAAABwfr AAAAAP/////k6+fk//8AAOvrAOsHBwcHAADr6wAAAOsA6wfr/////+Tr5+T////r6+vrBwAABwAA AOsHB+sAAOsABwD/////5Ovn5P///+sAAP/r6wAAAADrAAfr6+sA6wDr///////k6+fk//////// //////8AAADr6wcAAOvrAP///////+Tr5+T/////////////////AAAAAAAA6+vr////////5Ovn 5P//////////////////6wAAAADr6//////////k6+fn5+fn5+fn5+fn5+fn5+fn6+sA6+fn5+fn 5+fn5wfr5wcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHB+vnZxFnZ2dnZ2dnZ2dnZ2dnZ2dn Z2dnZ2dn6+vr6+tn6+dnDmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cH6gfqB2fr5+vr6+vr6+vr6+vr 6+vr6+vr6+vr6+vr6+vr6+vr6+sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== ) ); } package Test::NotifyIcon; our (@ISA, $x); BEGIN { @ISA = qw(Win32::GUI::NotifyIcon); $x = 0; } sub DESTROY { ++$x; shift->SUPER::DESTROY(); } --- NEW FILE: 05_NotifyIcon_02_Change.t --- #!perl -wT # Win32::GUI test suite. # $Id: 05_NotifyIcon_02_Change.t,v 1.1 2006/01/11 21:26:16 robertemay Exp $ # # test coverage of Notify Icons use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More tests => 16; use Win32::GUI(); use Win32::GUI::BitmapInline(); my $icon = geticon(); my $ctrl = "NotifyIcon"; my $class = "Win32::GUI::$ctrl"; # Test the basic Change() method my $W = new Win32::GUI::Window( -name => "TestWindow", ); isa_ok($W, "Win32::GUI::Window", "\$W"); my $C = $W->AddNotifyIcon( -name => "NI", -icon => $icon, -tip => "Win32::GUI NotifyIcon Test", -balloon_tip => "Win32::GUI NotifyIcon Test Balloon Tip", -balloon_title => "Win32::GUI NotifyIcon Title", -balloon_icon => 'error', -balloon_timeout => 20000, ); isa_ok($C,$class, "\$W->AddNotifyIcon creates $class object"); isa_ok($W->NI, $class, "\$W->NI contains a $class object"); is($C, $W->NI, "Parent references $ctrl"); # TODO: how to test the -icon option? TODO: { local $TODO = "Win32::GUI::NotifyIcon - Don't know how to test -icon option"; fail("Can't test -icon option"); } # TODO: how to test the -tip option? TODO: { local $TODO = "Win32::GUI::NotifyIcon - Don't know how to test -tip option"; fail("Can't test -tip option"); } is($C->{-balloon_tip}, "Win32::GUI NotifyIcon Test Balloon Tip", "-balloon_tip stored in object"); is($C->{-balloon_title}, "Win32::GUI NotifyIcon Title", "-balloon_title stored in object"); is($C->{-balloon_icon}, "error", "-balloon_icon stored in object"); is($C->{-balloon_timeout}, 20000, "-balloon_timeout stored in object"); ## Change() method tests $C->Change(-icon => 0); # TODO: how to test the -icon option? TODO: { local $TODO = "Win32::GUI::NotifyIcon - Don't know how to test -icon option"; fail("Don't know if icon has changed"); } $C->Change(-tip => "Changed Tip"); # TODO: how to test the -tip option? TODO: { local $TODO = "Win32::GUI::NotifyIcon - Don't know how to test -tip option"; fail("Don't know if tip has changed"); } $C->Change(-balloon_tip => "Changed Tip"); is($C->{-balloon_tip}, "Changed Tip", "-balloon_tip has been changed"); $C->Change(-balloon_title => "Changed Title"); is($C->{-balloon_title}, "Changed Title", "-balloon_title has been changed"); $C->Change(-balloon_icon => "none"); is($C->{-balloon_icon}, "none", "-balloon_icon has been changed"); $C->Change(-balloon_timeout => 10000); is($C->{-balloon_timeout}, 10000, "-balloon_timeout has been changed"); ### -- helper functions -- sub geticon { return newIcon Win32::GUI::BitmapInline( q( AAABAAIAICAQAAAAAADoAgAAJgAAACAgAAAAAAAAqAgAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAA AIACAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAA AAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAd3AAiIAAAAAAAAAAAAgHgIcACAiAAAAAAAAAAAAI CIiAAAAIAAAAAAAAAAAA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AAcHBwAAAOvr6///////5Ovn5P///////wAAAOsAB+sA6wcAAADrAOvr//// ///k6+fk////////AAAA6wDr6+vrAAAAAAAA6wD//////+Tr5+T///////8AAAAAAOvr6wAAAAAA AAAAAP//////5Ovn5P///////wAA6+sAB+vrAAAAAAAAAAAA///////k6+fk////////AADr6wAH BwcAAADrAAAAAAD//////+Tr5+T///////8AAADr6wAHB+sAAAAAAAAAAOv/////5Ovn5P////// /wAAAAAA6+sA6+vrAAAAAAAAAP/////k6+fk////////AAAAAAAAAAAAAOvrAOvrAOsA/////+Tr 5+T/////////AAAAAAAAAAAAAAfr6+vrAAAA////5Ovn5P////////8AAAAA6+sA6wAAAOvrAOvr AAD////k6+fk//////////8AAAAA6wcHAAAAAADrAAAAAP///+Tr5+T//////////+sAAAAAAAAH AAAAAAAAAAAA////5Ovn5P///////////wAA6wDrBwcAAAAAAAAAAAD////k6+fk//////////// AADrAAAHBwcABwAAAADr6+v//+Tr5+T/////////6wAAAOvr6wcHB+sA6wAAAOsAB///5Ovn5P// /wAAAAAAAOvrAAAHBwcH6wAA6wAAAAAH///k6+fk////AAAA6wcHBwcHBwfr6+vrAAAAAAAAAOv/ /+Tr5+T//+sHBwfrBwcHBwcHAAAAAOvrAAAAAADr////5Ovn5P/rAOsHBwcHBwcHBwAAAAAABwfr AAAAAP/////k6+fk//8AAOvrAOsHBwcHAADr6wAAAOsA6wfr/////+Tr5+T////r6+vrBwAABwAA AOsHB+sAAOsABwD/////5Ovn5P///+sAAP/r6wAAAADrAAfr6+sA6wDr///////k6+fk//////// //////8AAADr6wcAAOvrAP///////+Tr5+T/////////////////AAAAAAAA6+vr////////5Ovn 5P//////////////////6wAAAADr6//////////k6+fn5+fn5+fn5+fn5+fn5+fn6+sA6+fn5+fn 5+fn5wfr5wcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHB+vnZxFnZ2dnZ2dnZ2dnZ2dnZ2dn Z2dnZ2dn6+vr6+tn6+dnDmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cH6gfqB2fr5+vr6+vr6+vr6+vr 6+vr6+vr6+vr6+vr6+vr6+vr6+sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== ) ); } --- NEW FILE: 05_NotifyIcon_05_DESTROY.t --- #!perl -wT # Win32::GUI test suite. # $Id: 05_NotifyIcon_05_DESTROY.t,v 1.1 2006/01/11 21:26:16 robertemay Exp $ # # test coverage of Notify Icons use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More tests => 13; use Win32::GUI(); use Win32::GUI::BitmapInline(); my $icon = geticon(); my $ctrl = "NotifyIcon"; my $class = "Test::$ctrl"; # Test DESTRUCTION { my $W = new Win32::GUI::Window( -name => "TestWindow", ); my $C = Test::NotifyIcon->new( $W, -name => "NI", -icon => $icon ); isa_ok($C,$class, "\$W->AddNotifyIcon creates $class object"); isa_ok($W->NI, $class, "\$W->NI contains a $class object"); # DESTROY tests is($Test::NotifyIcon::x, 0, "DESTROY not called yet"); undef $C; # should still be a reference from the parent object is($Test::NotifyIcon::x, 0, "DESTROY not called yet"); undef $W; # should reduce ref count to parent to zero, and in turn Timer is($Test::NotifyIcon::x, 1, "DESTROY called when parent destroyed"); } { my $W = new Win32::GUI::Window( -name => "TestWindow", ); my $C = Test::NotifyIcon->new( $W, -name => "NI", -icon => $icon ); my $id = $C->{-id}; ok(defined $W->{-notifyicons}->{$id}, "Timer's id is stored in parent"); is($C, $W->NI, "Reference sotered in Parent"); # DESTROY tests $Test::NotifyIcon::x = 0; is($Test::NotifyIcon::x, 0, "DESTROY not called yet"); undef $C; # should still be a reference from the parent object is($Test::NotifyIcon::x, 0, "DESTROY not called yet"); $W->{NI} = undef; # naughty way to remove timer is($Test::NotifyIcon::x, 1, "DESTROY called when parent reference removed"); ok(!defined $W->{-notifyicons}->{$id}, "DESTROY() tidies parent"); ok(!defined $W->{NI}, "DESTROY() tidies parent"); undef $W; is($Test::NotifyIcon::x, 1, "DESTROY not called when parent destroyed"); } exit(0); ### -- helper functions -- sub geticon { return newIcon Win32::GUI::BitmapInline( q( AAABAAIAICAQAAAAAADoAgAAJgAAACAgAAAAAAAAqAgAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAA AIACAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAA AAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAd3AAiIAAAAAAAAAAAAgHgIcACAiAAAAAAAAAAAAI CIiAAAAIAAAAAAAAAAAAAAiIAAAAAAAAAAAAAAAAAIgHiAAAAAAAAAAAAAAAAACIB3cACAAAAAAA AAAAAAAACIB3gAAAAAgAAAAAAAAAAAAIgIiAAAAAAAAAAAAAAAAAAAAAiAiAgAAAAAAAAAAAAAAA AAeIiAAAAAAAAAAAAAAIgIAAiAiAAAAAAAAAAAAAAIdwAACAAAAAAAAAAAAAgAAABwAAAAAAAAAA AAAAAAAICHcAAAAAAAAAAAAAAAAACAB3cHAACIgAAAAAAAAIAAiId3gIAAgHAAAAAAAAAAiAB3d4 AIAABwAAAAAAAId3d3eIiAAAAAgAAAAAh3eHd3dwAAiAAACAAAAACAh3d3d3AAAHeAAAAAAAAAAA iAh3dwCIAAgIeAAAAAAACIiHAHAAh3gAgHAAAAAAAAgACIAACAeIgICAAAAAAAAAAAAAAACIcAiA AAAAAAAAAAAAAAAAAAAIiAAAAAAAAAAAAAAAAIAACIAAAAAAAAAAAAAAAAAIgIAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////w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/+OAI//awBz/0gAV/8lAFX/AABJ3AAAPbkAADGWAAAlcwAAGVAAANT/1ACx /7EAjv+OAGv/awBI/0gAJf8lAAD+AAAA3AAAALkAAACWAAAAcwAAAFAAANT/4wCx/8cAjv+rAGv/ jwBI/3MAJf9XAAD/VQAA3EkAALk9AACWMQAAcyUAAFAZANT/8ACx/+IAjv/UAGv/xgBI/7gAJf+q AAD/qgAA3JIAALl6AACWYgAAc0oAAFAyANT//wCx//8Ajv//AGv//wBI//8AJf//AAD+/gAA3NwA ALm5AACWlgAAc3MAAFBQAPLy8gDm5uYA2traAM7OzgDCwsIAtra2AKqqqgCenp4AkpKSAIaGhgB6 enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ AAAA//8A/wAAAP8A/wD//wAA////AOnp6enp6enp6enp6enp6enp6enp6enp6enp6enp6enr5+T/ //////8AAAAA6+sAAAcHBwAAAOvr6///////5Ovn5P///////wAAAOsAB+sA6wcAAADrAOvr//// ///k6+fk////////AAAA6wDr6+vrAAAAAAAA6wD//////+Tr5+T///////8AAAAAAOvr6wAAAAAA AAAAAP//////5Ovn5P///////wAA6+sAB+vrAAAAAAAAAAAA///////k6+fk////////AADr6wAH BwcAAADrAAAAAAD//////+Tr5+T///////8AAADr6wAHB+sAAAAAAAAAAOv/////5Ovn5P////// /wAAAAAA6+sA6+vrAAAAAAAAAP/////k6+fk////////AAAAAAAAAAAAAOvrAOvrAOsA/////+Tr 5+T/////////AAAAAAAAAAAAAAfr6+vrAAAA////5Ovn5P////////8AAAAA6+sA6wAAAOvrAOvr AAD////k6+fk//////////8AAAAA6wcHAAAAAADrAAAAAP///+Tr5+T//////////+sAAAAAAAAH AAAAAAAAAAAA////5Ovn5P///////////wAA6wDrBwcAAAAAAAAAAAD////k6+fk//////////// AADrAAAHBwcABwAAAADr6+v//+Tr5+T/////////6wAAAOvr6wcHB+sA6wAAAOsAB///5Ovn5P// /wAAAAAAAOvrAAAHBwcH6wAA6wAAAAAH///k6+fk////AAAA6wcHBwcHBwfr6+vrAAAAAAAAAOv/ /+Tr5+T//+sHBwfrBwcHBwcHAAAAAOvrAAAAAADr////5Ovn5P/rAOsHBwcHBwcHBwAAAAAABwfr AAAAAP/////k6+fk//8AAOvrAOsHBwcHAADr6wAAAOsA6wfr/////+Tr5+T////r6+vrBwAABwAA AOsHB+sAAOsABwD/////5Ovn5P///+sAAP/r6wAAAADrAAfr6+sA6wDr///////k6+fk//////// //////8AAADr6wcAAOvrAP///////+Tr5+T/////////////////AAAAAAAA6+vr////////5Ovn 5P//////////////////6wAAAADr6//////////k6+fn5+fn5+fn5+fn5+fn5+fn6+sA6+fn5+fn 5+fn5wfr5wcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHB+vnZxFnZ2dnZ2dnZ2dnZ2dnZ2dn Z2dnZ2dn6+vr6+tn6+dnDmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cH6gfqB2fr5+vr6+vr6+vr6+vr 6+vr6+vr6+vr6+vr6+vr6+vr6+sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== ) ); } package Test::NotifyIcon; our (@ISA, $x); BEGIN { @ISA = qw(Win32::GUI::NotifyIcon); $x = 0; } sub DESTROY { ++$x; shift->SUPER::DESTROY(); } --- NEW FILE: 05_NotifyIcon_03_OtherMethods.t --- #!perl -wT # Win32::GUI test suite. # $Id: 05_NotifyIcon_03_OtherMethods.t,v 1.1 2006/01/11 21:26:16 robertemay Exp $ # # test coverage of Notify Icons use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More tests => 9; use Win32::GUI(); use Win32::GUI::BitmapInline(); my $icon = geticon(); my $ctrl = "NotifyIcon"; my $class = "Win32::GUI::$ctrl"; # Test these methods: # SetFocus, SetBehaviour, ShowBalloon, HideBalloon my $W = new Win32::GUI::Window( -name => "TestWindow", ); isa_ok($W, "Win32::GUI::Window", "\$W"); my $C = $W->AddNotifyIcon( -name => "NI", -icon => $icon, -tip => "Win32::GUI NotifyIcon Test", -balloon_tip => "Win32::GUI NotifyIcon Test Balloon Tip", -balloon_title => "Win32::GUI NotifyIcon Title", -balloon_icon => 'error', -balloon_timeout => 20000, ); isa_ok($C,$class, "\$W->AddNotifyIcon creates $class object"); isa_ok($W->NI, $class, "\$W->NI contains a $class object"); is($C, $W->NI, "Parent references $ctrl"); TODO: { local $TODO = q(Win32::GUI::NotifyIcon Don't know how to test $SHELLDLL_VERSION); fail(q(Can't test $SHELLDLL_VERSION)); } ## test methods: ShowBalloon, HideBalloon, SetFocus, SetBehaviour my $result = undef; ## ShowBalloon() $result = $C->ShowBalloon(); if($Win32::GUI::NotifyIcon::SHELLDLL_VERSION < 5) { ok(!defined $result, "ShowBalloon() returns undef for older shell.dll"); } else { TODO: { local $TODO = "Win32::GUI::NotifyIcon don't know how to test ShowBalloon()"; fail("Can't test ShowBalloon"); } } $result = undef; ## HideBalloon() $result = $C->HideBalloon(); if($Win32::GUI::NotifyIcon::SHELLDLL_VERSION < 5) { ok(!defined $result, "HideBalloon() returns undef for older shell.dll"); } else { TODO: { local $TODO = "Win32::GUI::NotifyIcon don't know how to test HideBalloon()"; fail("Can't test HideBalloon"); } } $result = undef; ## SetFocus() $result = $C->SetFocus(); if($Win32::GUI::NotifyIcon::SHELLDLL_VERSION < 5) { ok(!defined $result, "SetFocus() returns undef for older shell.dll"); } else { TODO: { local $TODO = "Win32::GUI::NotifyIcon don't know how to test SetFocus()"; fail("Can't test SetFocus"); } } $result = undef; ## SetBehaviour() $result = $C->SetBehaviour(); if($Win32::GUI::NotifyIcon::SHELLDLL_VERSION < 5) { ok(!defined $result, "SetBehaviour() returns undef for older shell.dll"); } else { TODO: { local $TODO = "Win32::GUI::NotifyIcon don't know how to test SetBehaviour()"; fail("Can't test SetBehaviour"); } } $result = undef; ### -- helper functions -- sub geticon { return newIcon Win32::GUI::BitmapInline( q( AAABAAIAICAQAAAAAADoAgAAJgAAACAgAAAAAAAAqAgAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAA AIACAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAA AAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAd3AAiIAAAAAAAAAAAAgHgIcACAiAAAAAAAAAAAAI CIiAAAAIAAAAAAAAAAAAAAiIAAAAAAAAAAAAAAAAAIgHiAAAAAAAAAAAAAAAAACIB3cACAAAAAAA AAAAAAAACIB3gAAAAAgAAAAAAAAAAAAIgIiAAAAAAAAAAAAAAAAAAAAAiAiAgAAAAAAAAAAAAAAA AAeIiAAAAAAAAAAAAAAIgIAAiAiAAAAAAAAAAAAAAIdwAACAAAAAAAAAAAAAgAAABwAAAAAAAAAA AAAAAAAICHcAAAAAAAAAAAAAAAAACAB3cHAACIgAAAAAAAAIAAiId3gIAAgHAAAAAAAAAAiAB3d4 AIAABwAAAAAAAId3d3eIiAAAAAgAAAAAh3eHd3dwAAiAAACAAAAACAh3d3d3AAAHeAAAAAAAAAAA iAh3dwCIAAgIeAAAAAAACIiHAHAAh3gAgHAAAAAAAAgACIAACAeIgICAAAAAAAAAAAAAAACIcAiA AAAAAAAAAAAAAAAAAAAIiAAAAAAAAAAAAAAAAIAACIAAAAAAAAAAAAAAAAAIgIAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////wAAf/8AAH//AAB//wAAf/8A AH//AAB//wAAP/8AAD//AAA//4AAH/+AAB//wAAf/8AAH//gAB//4AAP/4AA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AJf8lAAD+AAAA3AAAALkAAACWAAAAcwAAAFAAANT/4wCx/8cAjv+rAGv/ jwBI/3MAJf9XAAD/VQAA3EkAALk9AACWMQAAcyUAAFAZANT/8ACx/+IAjv/UAGv/xgBI/7gAJf+q AAD/qgAA3JIAALl6AACWYgAAc0oAAFAyANT//wCx//8Ajv//AGv//wBI//8AJf//AAD+/gAA3NwA ALm5AACWlgAAc3MAAFBQAPLy8gDm5uYA2traAM7OzgDCwsIAtra2AKqqqgCenp4AkpKSAIaGhgB6 enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ AAAA//8A/wAAAP8A/wD//wAA////AOnp6enp6enp6enp6enp6enp6enp6enp6enp6enp6enr5+T/ //////8AAAAA6+sAAAcHBwAAAOvr6///////5Ovn5P///////wAAAOsAB+sA6wcAAADrAOvr//// ///k6+fk////////AAAA6wDr6+vrAAAAAAAA6wD//////+Tr5+T///////8AAAAAAOvr6wAAAAAA AAAAAP//////5Ovn5P///////wAA6+sAB+vrAAAAAAAAAAAA///////k6+fk////////AADr6wAH BwcAAADrAAAAAAD//////+Tr5+T///////8AAADr6wAHB+sAAAAAAAAAAOv/////5Ovn5P////// /wAAAAAA6+sA6+vrAAAAAAAAAP/////k6+fk////////AAAAAAAAAAAAAOvrAOvrAOsA/////+Tr 5+T/////////AAAAAAAAAAAAAAfr6+vrAAAA////5Ovn5P////////8AAAAA6+sA6wAAAOvrAOvr AAD////k6+fk//////////8AAAAA6wcHAAAAAADrAAAAAP///+Tr5+T//////////+sAAAAAAAAH AAAAAAAAAAAA////5Ovn5P///////////wAA6wDrBwcAAAAAAAAAAAD////k6+fk//////////// AADrAAAHBwcABwAAAADr6+v//+Tr5+T/////////6wAAAOvr6wcHB+sA6wAAAOsAB///5Ovn5P// /wAAAAAAAOvrAAAHBwcH6wAA6wAAAAAH///k6+fk////AAAA6wcHBwcHBwfr6+vrAAAAAAAAAOv/ /+Tr5+T//+sHBwfrBwcHBwcHAAAAAOvrAAAAAADr////5Ovn5P/rAOsHBwcHBwcHBwAAAAAABwfr AAAAAP/////k6+fk//8AAOvrAOsHBwcHAADr6wAAAOsA6wfr/////+Tr5+T////r6+vrBwAABwAA AOsHB+sAAOsABwD/////5Ovn5P///+sAAP/r6wAAAADrAAfr6+sA6wDr///////k6+fk//////// //////8AAADr6wcAAOvrAP///////+Tr5+T/////////////////AAAAAAAA6+vr////////5Ovn 5P//////////////////6wAAAADr6//////////k6+fn5+fn5+fn5+fn5+fn5+fn6+sA6+fn5+fn 5+fn5wfr5wcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHB+vnZxFnZ2dnZ2dnZ2dnZ2dnZ2dn Z2dnZ2dn6+vr6+tn6+dnDmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cH6gfqB2fr5+vr6+vr6+vr6+vr 6+vr6+vr6+vr6+vr6+vr6+vr6+sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== ) ); } --- NEW FILE: 05_NotifyIcon_01_Constructor.t --- #!perl -wT # Win32::GUI test suite. # $Id: 05_NotifyIcon_01_Constructor.t,v 1.1 2006/01/11 21:26:16 robertemay Exp $ # # test coverage of Notify Icons use strict; use warnings; BEGIN { $| = 1 } # Autoflush use Test::More tests => 15; use Win32::GUI(); use Win32::GUI::BitmapInline(); my $icon = geticon(); my $ctrl = "NotifyIcon"; my $class = "Win32::GUI::$ctrl"; # Test the basic construction my $W = new Win32::GUI::Window( -name => "TestWindow", ); isa_ok($W, "Win32::GUI::Window", "\$W"); my $C = $W->AddNotifyIcon( -name => "NI", -icon => $icon, -tip => "Win32::GUI NotifyIcon Test", -balloon_tip => "Win32::GUI NotifyIcon Test Balloon Tip", -balloon_title => "Win32::GUI NotifyIcon Title", -balloon_icon => 'error', -balloon_timeout => 20000, ); isa_ok($C,$class, "\$W->AddNotifyIcon creates $class object"); isa_ok($W->NI, $class, "\$W->NI contains a $class object"); is($C, $W->NI, "Parent references $ctrl"); my $id = $C->{-id}; ok(($id > 0), "NI's -id > 0"); ok(defined $W->{-notifyicons}->{$id}, "NI's id is stored in parent"); is($W->{-notifyicons}->{$id}, 'NI', "Timer's name is stored in parent"); is($C->{-name}, 'NI', "NI's name is stored in timer object"); is($C->{-handle}, $W->{-handle}, "Parent's handle is stored in NI object"); # TODO: how to test the -icon option? TODO: { local $TODO = "Win32::GUI::NotifyIcon - Don't know how to test -icon option"; fail("Can't test -icon option"); } # TODO: how to test the -tip option? TODO: { local $TODO = "Win32::GUI::NotifyIcon - Don't know how to test -tip option"; fail("Can't test -tip option"); } is($C->{-balloon_tip}, "Win32::GUI NotifyIcon Test Balloon Tip", "-balloon_tip stored in object"); is($C->{-balloon_title}, "Win32::GUI NotifyIcon Title", "-balloon_title stored in object"); is($C->{-balloon_icon}, "error", "-balloon_icon stored in object"); is($C->{-balloon_timeout}, 20000, "-balloon_timeout stored in object"); ### -- helper functions -- sub geticon { return newIcon Win32::GUI::BitmapInline( q( AAABAAIAICAQAAAAAADoAgAAJgAAACAgAAAAAAAAqAgAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAA AIACAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAA AAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAd3AAiIAAAAAAAAAAAAgHgIcACAiAAAAAAAAAAAAI CIiAAAAIAAAAAAAAAAAAAAiIAAAAAAAAAAAAAAAAAIgHiAAAAAAAAAAAAAAAAACIB3cACAAAAAAA A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8A/47/AP9r/wD/SP8A/yX/AP4A/gDcANwAuQC5AJYA lgBzAHMAUABQAP/U8AD/seIA/47UAP9rxgD/SLgA/yWqAP8AqgDcAJIAuQB6AJYAYgBzAEoAUAAy AP/U4wD/sccA/46rAP9rjwD/SHMA/yVXAP8AVQDcAEkAuQA9AJYAMQBzACUAUAAZAP/U1AD/sbEA /46OAP9rawD/SEgA/yUlAP4AAADcAAAAuQAAAJYAAABzAAAAUAAAAP/j1AD/x7EA/6uOAP+PawD/ c0gA/1clAP9VAADcSQAAuT0AAJYxAABzJQAAUBkAAP/w1AD/4rEA/9SOAP/GawD/uEgA/6olAP+q AADckgAAuXoAAJZiAABzSgAAUDIAAP//1AD//7EA//+OAP//awD//0gA//8lAP7+AADc3AAAubkA AJaWAABzcwAAUFAAAPD/1ADi/7EA1P+OAMb/awC4/0gAqv8lAKr/AACS3AAAerkAAGKWAABKcwAA MlAAAOP/1ADH/7EAq/+OAI//awBz/0gAV/8lAFX/AABJ3AAAPbkAADGWAAAlcwAAGVAAANT/1ACx /7EAjv+OAGv/awBI/0gAJf8lAAD+AAAA3AAAALkAAACWAAAAcwAAAFAAANT/4wCx/8cAjv+rAGv/ jwBI/3MAJf9XAAD/VQAA3EkAALk9AACWMQAAcyUAAFAZANT/8ACx/+IAjv/UAGv/xgBI/7gAJf+q AAD/qgAA3JIAALl6AACWYgAAc0oAAFAyANT//wCx//8Ajv//AGv//wBI//8AJf//AAD+/gAA3NwA ALm5AACWlgAAc3MAAFBQAPLy8gDm5uYA2traAM7OzgDCwsIAtra2AKqqqgCenp4AkpKSAIaGhgB6 enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ AAAA//8A/wAAAP8A/wD//wAA////AOnp6enp6enp6enp6enp6enp6enp6enp6enp6enp6enr5+T/ //////8AAAAA6+sAAAcHBwAAAOvr6///////5Ovn5P///////wAAAOsAB+sA6wcAAADrAOvr//// ///k6+fk////////AAAA6wDr6+vrAAAAAAAA6wD//////+Tr5+T///////8AAAAAAOvr6wAAAAAA AAAAAP//////5Ovn5P///////wAA6+sAB+vrAAAAAAAAAAAA///////k6+fk////////AADr6wAH BwcAAADrAAAAAAD//////+Tr5+T///////8AAADr6wAHB+sAAAAAAAAAAOv/////5Ovn5P////// /wAAAAAA6+sA6+vrAAAAAAAAAP/////k6+fk////////AAAAAAAAAAAAAOvrAOvrAOsA/////+Tr 5+T/////////AAAAAAAAAAAAAAfr6+vrAAAA////5Ovn5P////////8AAAAA6+sA6wAAAOvrAOvr AAD////k6+fk//////////8AAAAA6wcHAAAAAADrAAAAAP///+Tr5+T//////////+sAAAAAAAAH AAAAAAAAAAAA////5Ovn5P///////////wAA6wDrBwcAAAAAAAAAAAD////k6+fk//////////// AADrAAAHBwcABwAAAADr6+v//+Tr5+T/////////6wAAAOvr6wcHB+sA6wAAAOsAB///5Ovn5P// /wAAAAAAAOvrAAAHBwcH6wAA6wAAAAAH///k6+fk////AAAA6wcHBwcHBwfr6+vrAAAAAAAAAOv/ /+Tr5+T//+sHBwfrBwcHBwcHAAAAAOvrAAAAAADr////5Ovn5P/rAOsHBwcHBwcHBwAAAAAABwfr AAAAAP/////k6+fk//8AAOvrAOsHBwcHAADr6wAAAOsA6wfr/////+Tr5+T////r6+vrBwAABwAA AOsHB+sAAOsABwD/////5Ovn5P///+sAAP/r6wAAAADrAAfr6+sA6wDr///////k6+fk//////// //////8AAADr6wcAAOvrAP///////+Tr5+T/////////////////AAAAAAAA6+vr////////5Ovn 5P//////////////////6wAAAADr6//////////k6+fn5+fn5+fn5+fn5+fn5+fn6+sA6+fn5+fn 5+fn5wfr5wcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHB+vnZxFnZ2dnZ2dnZ2dnZ2dnZ2dn Z2dnZ2dn6+vr6+tn6+dnDmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cH6gfqB2fr5+vr6+vr6+vr6+vr 6+vr6+vr6+vr6+vr6+vr6+vr6+sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== ) ); } |
From: Robert M. <rob...@us...> - 2006-01-11 21:26:26
|
Update of /cvsroot/perl-win32-gui/Win32-GUI/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5945/samples Added Files: NotifyIcon.pl Log Message: Add Notify Icon Balloon Tooltips; Re-work splitter class; bug fixes --- NEW FILE: NotifyIcon.pl --- #!perl w # Notify Icon Tester # A Win32::GUI program to show off the capabilities of # the Windows Taskbar notification icons. # Really written to prove the functionality added to # Win32::GUI, but also an interesting demo. # (c) 2005 Robert May # See the Help Menu in the program or embedded POD # for further information # TODO: # Add tooltip to icon filename when it is truncated use strict; use warnings; use Win32; use Win32::GUI 1.03_02, qw(MB_OK MB_ICONHAND ES_WANTRETURN WS_CLIPCHILDREN WS_EX_TOPMOST); use Win32::GUI::BitmapInline(); sub CW_USEDEFAULT() {0x80000000}; sub WM_NOTIFYICON() {32768 + 2}; # WM_APP + 2 my $VERSION = "1.00"; my %event_lookup = ( 512 => "MouseEvent(WM_MOUSEMOVE)", # WM_MOUSEMOVE 513 => "Click()", # WM_LBUTTONDOWN 514 => "MouseEvent(WM_LBUTTONUP)", # WM_LBUTTONUP 515 => "DblClick()", # WM_LBUTTONDBLCLICK 516 => "RightClick()", # WM_RBUTTONDOWN 517 => "MouseEvent(WM_RBUTTONUP)", # WM_RBUTTONUP 518 => "RightDblClick()", # WM_RBUTTONDBLCLICK 519 => "MiddleClick()", # WM_MBUTTONDOWN 520 => "MouseEvent(WM_MBUTTONUP)", # WM_MBUTTONUP 521 => "MiddleDlbClick()", # WM_MBUTTONDBLCLICK 1024 => "MouseEvent(NIN_SELECT)", # NIN_SELECT v5+ 1025 => "MouseEvent(NIN_KEYSELECT)", # NIN_KEYSELECT v5+ 1026 => "MouseEvent(NIN_BALLOONSHOW)", # NIN_BALLOONSHOW v6+ 1027 => "MouseEvent(NIN_BALLOONHIDE)", # NIN_BALLOONSHOW v6+ 1028 => "MouseEvent(NIN_BALLOONTIMEOUT)", # NIN_BALLOONTIMEOUT v6+ 1029 => "MouseEvent(NIN_BALLOONUSERCLICK)", # NINBALLOONUSERCLICK v6+ ); my %cfg = ( defaulticon => get_defaulticon(), iconfile => undef, icon => undef, ni => undef, v5 => ($Win32::GUI::NotifyIcon::SHELLDLL_VERSION >= 5), events => [], max_events => 100, ); $cfg{icon} = $cfg{defaulticon}; ###################################################################### # Main menu ###################################################################### my $menu = Win32::GUI::Menu->new( "&File" => "File", ">&Change Icon ..." => { -name => "File_Chan", -onClick => \&change_icon }, "> -" => 0, "> E&xit" => { -name => "File_Exit", -onClick => sub{-1} }, "&Help" => "Help", "> &Help" => { -name => "Help_Help", -onClick => \&OnHelp }, "> &About" => { -name => "Help_About", -onClick => \&OnAbout }, ); ###################################################################### # Main window ###################################################################### my $mw = Win32::GUI::Window->new( -title => "Notify Icon Tester", -left => CW_USEDEFAULT, -size => [100,100], -resizable => 0, -maximizebox => 0, -menu => $menu, -dialogui => 1, ); $mw->Hook(WM_NOTIFYICON, \&record_event); ###################################################################### # Layout ###################################################################### # Primarily a 2 column layout: my $col1_width = 235; my $col2_width = 255; my $padding = 10; my $margin = 10; my $col1_left = 0; my $col1_gb_left = $col1_left + $padding; my $col1_ctrl_left = $col1_gb_left + $padding; my $col1_gb_right = $col1_left + $col1_width - ($padding/2); # collapse padding between columns my $col1_ctrl_right = $col1_gb_right - $padding; my $col2_left = $col1_width; my $col2_gb_left = $col2_left + ($padding/2); my $col2_ctrl_left = $col2_gb_left + $padding; my $col2_gb_right = $col2_left + $col2_width - $padding; my $col2_ctrl_right = $col2_gb_right - $padding; my $row1_gb_top = 0; # no padding at top ###################################################################### # Version Information group ###################################################################### $mw->AddGroupbox( -name => "VGB", -title => "Version Information", -left => $col1_gb_left, -top => $row1_gb_top, -width => $col1_gb_right - $col1_gb_left, ); $mw->AddLabel( -text => "Win32::GUI\t\t$Win32::GUI::VERSION", -left => $col1_ctrl_left, -top => $row1_gb_top + (2 * $padding), -width => $mw->VGB->Width() - (2 * $padding), ); $mw->AddLabel( -text => "shell32.dll\t\t" . Win32::GetFileVersion("shell32"), -left => $col1_ctrl_left, -top => $row1_gb_top + (4 * $padding), -width => $mw->VGB->Width() - (2 * $padding), ); $mw->AddLabel( -name => "VL3", -text => "Notify Icon Tester\t$VERSION", -left => $col1_ctrl_left, -top => $row1_gb_top + (6 * $padding), -width => $mw->VGB->Width() - (2 * $padding), ); my $row1_gb_bottom = $mw->VL3->Top() + $mw->VL3->Height() + $padding; $mw->VGB->Height($row1_gb_bottom - $row1_gb_top); my$row2_gb_top = $row1_gb_bottom + $padding; ###################################################################### # Icon selection group ###################################################################### $mw->AddGroupbox( -name => "IGB", -title => "Tray &Icon", -left => $col1_gb_left, -top => $row2_gb_top, -width => $col1_gb_right - $col1_gb_left, -group => 1, ); $mw->AddCheckbox( -name => "ICB", -text => "Use Default Icon", -left => $col1_ctrl_left, -top => $row2_gb_top + 20, -onClick => \&toggle_icon, -tabstop => 1, ); $mw->AddLabel( -name => "IL", -text => "Placeholder", -truncate => "path", # only Win NT and higher - see update_ui() -left => $col1_ctrl_left, -top => $mw->ICB->Top() + $mw->ICB->Height() + 4, -width => $col1_ctrl_right - $col1_ctrl_left, ); $mw->AddButton( -name => "IB", -text => "Change Icon ...", -top => $row2_gb_top + 20, -onClick => \&change_icon, -tabstop => 1, ); $mw->IB->Left($col1_ctrl_right - $mw->IB->Width()); my $row2_gb_bottom = $mw->IL->Top() + $mw->IL->Height() + $margin; $mw->IGB->Height($row2_gb_bottom - $row2_gb_top); ###################################################################### # Events groupbox ###################################################################### $mw->AddGroupbox( -title => "&Events", -left => $col2_gb_left, -top => $row1_gb_top, -width => $col2_gb_right - $col2_gb_left, -height => $row2_gb_bottom - $row1_gb_top, -group => 1, ); $mw->AddRadioButton( -name => "ERB1", -text => "Win95", -checked => 1, -left => $col2_ctrl_left, -top => $row1_gb_top + 20, -onClick => sub { $cfg{ni}->SetBehaviour(0) if $cfg{ni}; 1;}, -tabstop => 1, -group => 1, ); $mw->AddRadioButton( -name => "ERB2", -text => "Win2k", -left => $col2_ctrl_left + $mw->ERB1->Width() + 4, -top => $row1_gb_top + 20, -onClick => sub { $cfg{ni}->SetBehaviour(1) if $cfg{ni}; 1;}, ); $mw->AddTextfield( -name => "ETF", -multiline => 1, -vscroll => 1, -readonly => 1, -background => 0xFFFFFF, -left => $col2_ctrl_left, -top => $mw->ERB1->Top() + $mw->ERB1->Height() + 4, -width => $col2_ctrl_right - $col2_ctrl_left, -height => $row2_gb_bottom - $margin - ($mw->ERB1->Top() + $mw->ERB1->Height() + 4), -tabstop => 1, -group => 1, ); my$row3gb_top = $row2_gb_bottom + $padding; ###################################################################### # Simple Tooltip groupbox ###################################################################### $mw->AddGroupbox( -name => "TGB", -title => "&Tooltip", -left => $col1_gb_left, -top => $row3gb_top, -width => $col2_gb_right - $col1_gb_left, -group => 1, ); $mw->AddTextfield( -name => "TTF", -text => "Simple Tooltip Text", -prompt => [ "Text", 30 ], -left => $col1_ctrl_left, -top => $row3gb_top + 20, -height => 20, -width => $col2_ctrl_right - $col1_ctrl_left - 30, -onChange => sub { $cfg{ni}->Change(-tip => $_[0]->Text()) if $cfg{ni}; 0;}, -tabstop => 1, ); $mw->TTF->LimitText($cfg{v5} ? 127 : 63); my $row3_gb_bottom = $mw->TTF->Top() + $mw->TTF->Height() + $margin; $mw->TGB->Height($row3_gb_bottom - $row3gb_top); my $row4_gb_top = $row3_gb_bottom + $padding; ###################################################################### # Balloon Tooltip groupbox ###################################################################### $mw->AddGroupbox( -name => "BGB", -title => "&Balloon Tooltip", -left => $col1_gb_left, -top => $row4_gb_top, -width => $col2_gb_right - $col1_gb_left, -group => 1, ); $mw->AddTextfield( -name => "BTF1", -text => "Balloon Title", -prompt => [ "Title", 30 ], -left => $col1_ctrl_left, -top => $row4_gb_top + 20, -width => $col1_gb_right - $col1_ctrl_left + 70, -height => 20, -onChange => sub { change_balloon("title" => $_[0]->Text()); }, -tabstop => 1, ); $mw->BTF1->LimitText(63); $mw->AddTextfield( -name => "BTF2", -text => "Balloon tip text.", -prompt => [ "Body", 30 ], -multiline => 1, -vscroll => 1, -pushstyle => ES_WANTRETURN, -left => $col1_ctrl_left, -top => $mw->BTF1->Top() + $mw->BTF1->Height() + 4, -height => 100, -width => $col1_gb_right - $col1_ctrl_left + 70, -onChange => sub { change_balloon("tip" => $_[0]->Text()); }, -tabstop => 1, ); $mw->BTF2->LimitText(254); my $row4_gb_bottom = $mw->BTF2->Top() + $mw->BTF2->Height() + $margin; $mw->BGB->Height($row4_gb_bottom - $row4_gb_top); $mw->AddTextfield( -name => "BTF3", -text => "10000", -prompt => [ "Timeout", -45 ], -number => 1, -left => $col2_ctrl_right - 65, -top => $row4_gb_top + 20, -height => 20, -width => 45, -onChange => sub { change_balloon("timeout" => $_[0]->Text()); }, -tabstop => 1, ); $mw->BTF3->LimitText(5); $mw->AddLabel( -name => "BL1", -text => "ms", -left => $mw->BTF3->Left() + $mw->BTF3->Width() + 4, -top => $mw->BTF3->Top(), ); $mw->AddLabel( -name => "BL2", -text => "Icon", -left => $mw->BTF3_Prompt->Left(), -top => $mw->BTF3->Top() + $mw->BTF3->Height() + 7, ); $mw->AddCombobox( -name => "BCB", -dropdownlist => 1, -left => $col2_ctrl_right - 65, -top => $mw->BTF3->Top() + $mw->BTF3->Height() + 4, -height => 80, -width => 65, -onChange => sub { change_balloon("icon" => $_[0]->Text()); }, -tabstop => 1, ); $mw->BCB->Add('none', 'info', 'warning', 'error'); $mw->BCB->SetCurSel(0); $mw->AddCheckbox( -name => "BCBB", -text => "Show while editing", -left => $mw->BTF3_Prompt->Left(), -top => $mw->BCB->Top() + $mw->BCB->Height() + 4, -tabstop => 1, ); $mw->AddButton( -name => "BB1", -text => "Show Balloon", -left => $col2_ctrl_right - 81, -top => $row4_gb_bottom - $margin - 4 - (2 * 21), -width => 81, -height => 21, -onClick => sub { $cfg{ni}->ShowBalloon(0),$cfg{ni}->ShowBalloon(1) if $cfg{ni}; 1;}, -tabstop => 1, -group => 1, ); $mw->AddButton( -name => "BB2", -text => "Hide Balloon", -left => $col2_ctrl_right - 81, -top => $row4_gb_bottom - $margin - (1 * 21), -width => 81, -height => 21, -onClick => sub { $cfg{ni}->ShowBalloon(0) if $cfg{ni}; 1;}, -tabstop => 1, ); ###################################################################### # Show/Remove Notify Icon Button ###################################################################### $mw->AddButton( -name => "SB", -top => $row4_gb_bottom + $padding, -size => [110,21], -onClick => \&toggle_ni_state, -tabstop => 1, -group => 1, ); $mw->SB->Left($col2_gb_right - $mw->SB->Width()); my $ncw = $mw->Width() - $mw->ScaleWidth(); my $nch = $mw->Height() - $mw->ScaleHeight(); $mw->Resize($ncw + $col1_width + $col2_width, $nch + $mw->SB->Top() + $mw->SB->Height() + $padding); update_ui(); $mw->Show(); Win32::GUI::Dialog(); $mw->Hide(); exit(0); sub toggle_icon { if($cfg{icon} == $cfg{defaulticon}) { my $icon; $icon = Win32::GUI::Icon->new($cfg{iconfile}) if ($cfg{iconfile}); if($icon) { $cfg{icon} = $icon; } else { $cfg{iconfile} = undef; } } else { $cfg{icon} = $cfg{defaulticon}; } $cfg{ni}->Change(-icon => $cfg{icon}) if $cfg{ni}; update_ui(); return; } sub change_icon { my $win = shift; my $file = Win32::GUI::GetOpenFileName ( -owner => $win, -filter => [ 'Icon files (*.ico)', '*.ico', 'All Files', '*' ], -title => 'Select a new icon', -defaultfilter => 0, -filemustexist => 1, -pathmustexist => 1, ); my $icon; $icon = Win32::GUI::Icon->new($file) if ($file); if($icon) { $cfg{icon} = $icon; $cfg{iconfile} = $file; } else { $win->MessageBox( "$file does not appear to be valid icon format", "Notify Icon Tester error", MB_OK|MB_ICONHAND, ) if $file; } $cfg{ni}->Change(-icon => $cfg{icon}) if $cfg{ni}; update_ui(); return; } sub toggle_ni_state { my $win = $_[0]->GetParent(); if($cfg{ni}) { $cfg{ni}->Remove(); undef $cfg{ni}; } else { $cfg{ni} = $win->AddNotifyIcon( -icon => $cfg{icon}, -tip => $win->TTF->Text(), -balloon => 0, -balloon_tip => $win->BTF2->Text(), -balloon_title => $win->BTF1->Text(), -balloon_timeout => $win->BTF3->Text(), -balloon_icon => $win->BCB->Text(), ); } update_ui(); return; } sub change_balloon { my $item = shift; my $value = shift; if($cfg{ni}) { $cfg{ni}->Change("-balloon_$item" => $value); if($mw->BCBB->Checked()) { $cfg{ni}->ShowBalloon(0); $cfg{ni}->ShowBalloon(1); } } update_ui(); return 0; } sub update_ui { $mw->ICB->Checked($cfg{defaulticon} == $cfg{icon}); $mw->ICB->Enable(defined $cfg{iconfile} || ($cfg{defaulticon} != $cfg{icon})); { my $text = "Icon file: " . ($cfg{iconfile} ? $cfg{iconfile} : " - Not Set -"); if(Win32::GetOSVersion() < 2) { # implement -truncate => 'path' for Win9X/ME my $font = $mw->IL->GetFont(); my $width = $mw->IL->Width(); if(($mw->IL->GetTextExtentPoint32($text,$font))[0] > $width) { my($trunc, $keep); if($text =~ m/^(.*)(\\[^\\]*)$/) { $trunc = $1; $keep = $2; } else { $trunc = ''; $keep = $text; } while(($mw->IL->GetTextExtentPoint32($trunc."...".$keep,$font))[0] > $width) { $trunc = substr($trunc,0,-1), next if length $trunc; $keep = substr($keep,1), next if length $keep; last; # ensure we exit this loop } $text=$trunc."...".$keep; } } $mw->IL->Text($text); } $mw->IL->Enable($cfg{defaulticon} != $cfg{icon}); $mw->ERB1->Enable($cfg{v5}); $mw->ERB2->Enable($cfg{v5}); $mw->BGB->Enable ($cfg{v5}); $mw->BTF1_Prompt->Enable($cfg{v5}); $mw->BTF1->Enable($cfg{v5}); $mw->BTF2_Prompt->Enable($cfg{v5}); $mw->BTF2->Enable($cfg{v5}); $mw->BTF3_Prompt->Enable($cfg{v5}); $mw->BTF3->Enable($cfg{v5}); $mw->BL1->Enable ($cfg{v5}); $mw->BCB->Enable ($cfg{v5} && (length $mw->BTF1->Text() > 0)); $mw->BL2->Enable ($cfg{v5} && (length $mw->BTF1->Text() > 0)); $mw->BCBB->Enable($cfg{v5}); $mw->BB1->Enable ($cfg{v5} && defined($cfg{ni}) && (length $mw->BTF2->Text() > 0)); $mw->BB2->Enable ($cfg{v5} && defined($cfg{ni})); $mw->SB->Text(($cfg{ni} ? "Remove" : "Show") . " Notify Icon"); return; } sub record_event { my ($win, $id, $lParam, $type, $msgcode) = @_; return unless $msgcode == WM_NOTIFYICON; return unless $type == 0; # Event numbers are in lParam # decode event my $event; $event = $event_lookup{$lParam} if exists $event_lookup{$lParam}; $event = "$lParam (unknown)" unless $event; push @{$cfg{events}}, $event; while (@{$cfg{events}} > $cfg{max_events}) { shift @{$cfg{events}} } { my $text=''; for my $e (@{$cfg{events}}) { $text .= "$e\r\n"; } $win->ETF->SetSel(0,-1); $win->ETF->ReplaceSel($text); } return; } sub get_defaulticon { return newIcon Win32::GUI::BitmapInline( q( AAABAAIAICAQAAAAAADoAgAAJgAAACAgAAAAAAAAqAgAAA4DAAAoAAAAIAAAAEAAAAABAAQAAAAA AIACAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAgAAAgAAAAICAAIAAAACAAIAAgIAAAMDAwACAgIAA AAD/AAD/AAAA//8A/wAAAP8A/wD//wAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIgAd3AAiIAAAAAAAAAAAAgHgIcACAiAAAAAAAAAAAAI CIiAAAAIAAAAAAAAAAAAAAiIAAAAAAAAAAAAAAAAAIgHiAAAAAAAAAAAAAAAAACIB3cACAAAAAAA AAAAAAAACIB3gAAAAAgAAAAAAAAAAAAIgIiAAAAAAAAAAAAAAAAAAAAAiAiAgAAAAAAAAAAAAAAA AAeIiA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qAP8AqgDcAJIAuQB6AJYAYgBzAEoAUAAy AP/U4wD/sccA/46rAP9rjwD/SHMA/yVXAP8AVQDcAEkAuQA9AJYAMQBzACUAUAAZAP/U1AD/sbEA /46OAP9rawD/SEgA/yUlAP4AAADcAAAAuQAAAJYAAABzAAAAUAAAAP/j1AD/x7EA/6uOAP+PawD/ c0gA/1clAP9VAADcSQAAuT0AAJYxAABzJQAAUBkAAP/w1AD/4rEA/9SOAP/GawD/uEgA/6olAP+q AADckgAAuXoAAJZiAABzSgAAUDIAAP//1AD//7EA//+OAP//awD//0gA//8lAP7+AADc3AAAubkA AJaWAABzcwAAUFAAAPD/1ADi/7EA1P+OAMb/awC4/0gAqv8lAKr/AACS3AAAerkAAGKWAABKcwAA MlAAAOP/1ADH/7EAq/+OAI//awBz/0gAV/8lAFX/AABJ3AAAPbkAADGWAAAlcwAAGVAAANT/1ACx /7EAjv+OAGv/awBI/0gAJf8lAAD+AAAA3AAAALkAAACWAAAAcwAAAFAAANT/4wCx/8cAjv+rAGv/ jwBI/3MAJf9XAAD/VQAA3EkAALk9AACWMQAAcyUAAFAZANT/8ACx/+IAjv/UAGv/xgBI/7gAJf+q AAD/qgAA3JIAALl6AACWYgAAc0oAAFAyANT//wCx//8Ajv//AGv//wBI//8AJf//AAD+/gAA3NwA ALm5AACWlgAAc3MAAFBQAPLy8gDm5uYA2traAM7OzgDCwsIAtra2AKqqqgCenp4AkpKSAIaGhgB6 enoAbm5uAGJiYgBWVlYASkpKAD4+PgAyMjIAJiYmABoaGgAODg4A8Pv/AKSgoACAgIAAAAD/AAD/ AAAA//8A/wAAAP8A/wD//wAA////AOnp6enp6enp6enp6enp6enp6enp6enp6enp6enp6enr5+T/ //////8AAAAA6+sAAAcHBwAAAOvr6///////5Ovn5P///////wAAAOsAB+sA6wcAAADrAOvr//// ///k6+fk////////AAAA6wDr6+vrAAAAAAAA6wD//////+Tr5+T///////8AAAAAAOvr6wAAAAAA AAAAAP//////5Ovn5P///////wAA6+sAB+vrAAAAAAAAAAAA///////k6+fk////////AADr6wAH BwcAAADrAAAAAAD//////+Tr5+T///////8AAADr6wAHB+sAAAAAAAAAAOv/////5Ovn5P////// /wAAAAAA6+sA6+vrAAAAAAAAAP/////k6+fk////////AAAAAAAAAAAAAOvrAOvrAOsA/////+Tr 5+T/////////AAAAAAAAAAAAAAfr6+vrAAAA////5Ovn5P////////8AAAAA6+sA6wAAAOvrAOvr AAD////k6+fk//////////8AAAAA6wcHAAAAAADrAAAAAP///+Tr5+T//////////+sAAAAAAAAH AAAAAAAAAAAA////5Ovn5P///////////wAA6wDrBwcAAAAAAAAAAAD////k6+fk//////////// AADrAAAHBwcABwAAAADr6+v//+Tr5+T/////////6wAAAOvr6wcHB+sA6wAAAOsAB///5Ovn5P// /wAAAAAAAOvrAAAHBwcH6wAA6wAAAAAH///k6+fk////AAAA6wcHBwcHBwfr6+vrAAAAAAAAAOv/ /+Tr5+T//+sHBwfrBwcHBwcHAAAAAOvrAAAAAADr////5Ovn5P/rAOsHBwcHBwcHBwAAAAAABwfr AAAAAP/////k6+fk//8AAOvrAOsHBwcHAADr6wAAAOsA6wfr/////+Tr5+T////r6+vrBwAABwAA AOsHB+sAAOsABwD/////5Ovn5P///+sAAP/r6wAAAADrAAfr6+sA6wDr///////k6+fk//////// //////8AAADr6wcAAOvrAP///////+Tr5+T/////////////////AAAAAAAA6+vr////////5Ovn 5P//////////////////6wAAAADr6//////////k6+fn5+fn5+fn5+fn5+fn5+fn6+sA6+fn5+fn 5+fn5wfr5wcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHB+vnZxFnZ2dnZ2dnZ2dnZ2dnZ2dn Z2dnZ2dn6+vr6+tn6+dnDmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cH6gfqB2fr5+vr6+vr6+vr6+vr 6+vr6+vr6+vr6+vr6+vr6+vr6+sAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== ) ); } sub get_help_text { my $parser; eval "require Pod::Simple::RTF"; if($@) { eval "require Pod::Simple::Text"; if($@) { return "Pod::Simple required to get help."; } else { $parser = Pod::Simple::Text->new(); } } else { $parser = Pod::Simple::RTF->new(); } my $string; $parser->output_string(\$string); $parser->parse_file($0); return $string; } sub OnAbout { my $win = shift; $win->MessageBox( "Notify Icon Tester v$VERSION\r\n" . "(c) Robert May, 2006", "About Notify Icon Tester", MB_OK, ); } sub OnHelp { my $win; $win = Win32::GUI::Window->new( -title => "Notify Icon Tester Help", -left => CW_USEDEFAULT, -size => [600, 500], -pushstyle => WS_CLIPCHILDREN, -onResize => sub { $_[0]->TEXT->Resize($_[0]->ScaleWidth(), $_[0]->ScaleHeight); 1; }, -onTerminate => sub { undef $win; 0; }, # Closure prevents $win going out of scope # at end of OnHelp(). Ref count to $win forced # to zero on Terminate event. -dialogui => 1, ); # Hidden button that handles ESC char. # Might be better to use an accelerator table # but this is nice and quick $win->AddButton( -visible => 0, -cancel => 1, -onClick => sub { undef $win; 0; }, # See comments above ); $win->AddRichEdit( -name => "TEXT", #-class => "RichEdit20A", -readonly => 1, -background => 0xFFFFFF, -width => $win->ScaleWidth(), -height => $win->ScaleHeight(), -vscroll => 1, -autohscroll => 0, ); $win->TEXT->Text(get_help_text()); $win->Show(); return; } __END__ =head1 NAME Notify Icon Tester =head1 SYNOPSIS C<perl NotifyIcon.pl> =head1 OVERVIEW This program has evolved from a simple utility designed to allow for testing of the Win32::GUI::NotifyIcon functionality into a program showing off some of the features available from Win32::GUI. =head1 VERSIONS This program requires Win32::GUI v1.03_01 or higher, and should run with any 32-bit version of windows (Win95/98/NT/ME/2K/XP). The version of Win32::GUI is displayed in the 'Version Information' panel. Different versions of windows ship with different version of shell32.dll. Some versions of Internet Explorer may update the system version of shell32.dll. The version of shell32.dll installed on your system is displayed in the 'Version Information' panel. Balloon tooltips and some of the notification events are only available with shell32.dll V5.0 and later. Functions that are not available will be disabled in the GUI. =head1 USING =head2 Showing and Removing the tray icon Pressing the bottom-right button 'Show/Remove Notify Icon' shows and removes a tray icon from the taskbar's system tray. =head2 Selecting the icon By default the Win32::GUI icon is displayed in the system tray. It is possible to change this icon by selecting the 'Change Icon ...' option from the 'File' menu, or by pressing the 'Change Icon ...' button. The file selected must be a vaild windows icon (usually a *.ico file). The microsoft documentation give the following limitations for the icon colour depth: =over 4 I<< To avoid icon distortion, be aware that notification area icons have different levels of support under different versions of Microsoft Windows. Windows 95, Windows 98, and Microsoft Windows NT 4.0 support icons of up to 4 bits per pixel (BPP). Windows Millennium Edition (Windows Me) and Windows 2000 support icons of a color depth up to the current display mode. Windows XP supports icons of up to 32 BPP. >> =back =head2 Setting the Tooltip Text entered in the Tooltip Text Textfield will be displayed as a tooltip when the icon is displayed in the system tray and the mouse hovers over the icon. The text is limited to 63 characters for shell32.dll before 5.0 and 127 characters for later versions. =head2 Balloon Tooltips Balloon tooltips are available to systems with shell32.dll greater than 5.0. Balloon tooltips are larger tooltips, capable of showing more information. While the notify icon is displayed in the taskbar a balloon tooltip can be shown and hidden using the 'Show Balloon' and 'Hide Balloon' buttons. The 'Show while editing' checkbox, if checked, shows the balloon tooltip while you edit it's contents within the 'Balloon Tooltip' panel. You may adjust the following values affecting the display of a Balloon Tooltip: =over 4 =item Title Sets the title of the balloon tooltip. The title is displayed in bold at the top of the tooltip. =item Body The main content of the balloon tooltip. The ballon tooltip will not be displayed if this field is empty. =item Icon Set the system icon that is disaplyed next to the balloon tooltip title. One of: none (no icon), info, warn or error. The icon is not displayed if there is no title. =item Timeout The maximum time in milliseconds for which the tooltip will be displayed. The tooltip may be displayed for a shorter time if another balloon tooltip is displayed by either the same or any other system tray icon. The system enforces minimum and maximum timeout values. Timeout values that are too large are set to the maximum value and values that are too small default to the minimum value. The system minimum and maximum timeout values are set by the operating system and for all current version sof windows are 10 seconds and 30 seconds, respectively. =back =head2 Events The 'Events' panel shows events that are sent from the Notify Icon to the owner window. Typically these are mouse-related events, and can be triggered by moving and clicking the mouse on the Notify Icon. v5.0 supports 2 behaviours for messages sent when the notify icon has keyboard focus and the <enter> and <space> key are pressed. The behavious can be changed by clicking the radio-buttons at the top of the 'Events' panel. See the microsoft documentation for 'Shell_NotifyIcon' for further details. The text control at the bottom of the 'Events' panel shows the events as they happen. v6.0 of shell32.dll support various additional event messages that occur as the balloon tooltip is displayed and hidden. =head1 AUTHOR Robert May - rob...@us... =head1 COPYRIGHT AND LICENCE This software is released under the same terms as Perl itself. =cut |
From: Robert M. <rob...@us...> - 2006-01-11 21:26:25
|
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5945 Modified Files: CHANGELOG GUI.h GUI.pm GUI.xs GUI_Helpers.cpp GUI_MessageLoops.cpp GUI_Options.cpp Label.xs MANIFEST NotifyIcon.xs RichEdit.xs Splitter.xs Log Message: Add Notify Icon Balloon Tooltips; Re-work splitter class; bug fixes Index: GUI.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.xs,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** GUI.xs 3 Dec 2005 01:56:31 -0000 1.47 --- GUI.xs 11 Jan 2006 21:26:15 -0000 1.48 *************** *** 2047,2054 **** DWORD result; PPCODE: ! if(SendMessageTimeout( ! handle, msg, wparam, lparam, flags, timeout, &result ! ) == 0) { ! XSRETURN_NO; } else { XSRETURN_IV(result); --- 2047,2052 ---- DWORD result; PPCODE: ! if(SendMessageTimeout(handle, msg, wparam, lparam, flags, timeout, &result) == 0) { ! XSRETURN_UNDEF; } else { XSRETURN_IV(result); Index: Label.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Label.xs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Label.xs 3 Aug 2005 21:45:57 -0000 1.6 --- Label.xs 11 Jan 2006 21:26:16 -0000 1.7 *************** *** 45,63 **** } else if(strcmp(option, "-truncate") == 0) { if(strcmp(SvPV_nolen(value), "path") == 0) { ! SwitchBit(perlcs->cs.style, SS_PATHELLIPSIS, 1); ! SwitchBit(perlcs->cs.style, SS_ENDELLIPSIS, 0); ! SwitchBit(perlcs->cs.style, SS_WORDELLIPSIS, 0); } else if(strcmp(SvPV_nolen(value), "word") == 0) { ! SwitchBit(perlcs->cs.style, SS_PATHELLIPSIS, 0); ! SwitchBit(perlcs->cs.style, SS_ENDELLIPSIS, 0); ! SwitchBit(perlcs->cs.style, SS_WORDELLIPSIS, 1); } else if(SvIV(value)) { ! SwitchBit(perlcs->cs.style, SS_PATHELLIPSIS, 0); ! SwitchBit(perlcs->cs.style, SS_ENDELLIPSIS, 1); ! SwitchBit(perlcs->cs.style, SS_WORDELLIPSIS, 0); } else { ! SwitchBit(perlcs->cs.style, SS_PATHELLIPSIS, 0); ! SwitchBit(perlcs->cs.style, SS_ENDELLIPSIS, 0); ! SwitchBit(perlcs->cs.style, SS_WORDELLIPSIS, 0); } } else if(strcmp(option, "-frame") == 0) { --- 45,58 ---- } else if(strcmp(option, "-truncate") == 0) { if(strcmp(SvPV_nolen(value), "path") == 0) { ! perlcs->cs.style &= ~SS_ELLIPSISMASK; ! perlcs->cs.style |= SS_PATHELLIPSIS; } else if(strcmp(SvPV_nolen(value), "word") == 0) { ! perlcs->cs.style &= ~SS_ELLIPSISMASK; ! perlcs->cs.style |= SS_WORDELLIPSIS; } else if(SvIV(value)) { ! perlcs->cs.style &= ~SS_ELLIPSISMASK; ! perlcs->cs.style |= SS_ENDELLIPSIS; } else { ! perlcs->cs.style &= ~SS_ELLIPSISMASK; } } else if(strcmp(option, "-frame") == 0) { Index: RichEdit.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/RichEdit.xs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RichEdit.xs 5 Oct 2005 22:20:49 -0000 1.6 --- RichEdit.xs 11 Jan 2006 21:26:16 -0000 1.7 *************** *** 25,28 **** --- 25,44 ---- void RichEdit_onPostCreate(NOTXSPROC HWND myhandle, LPPERLWIN32GUI_CREATESTRUCT perlcs) { + + if(perlcs->clrForeground != CLR_INVALID) { + CHARFORMAT cf; + ZeroMemory(&cf, sizeof(CHARFORMAT)); + cf.cbSize = sizeof(CHARFORMAT); + cf.dwMask = CFM_COLOR; + cf.crTextColor = perlcs->clrForeground; + SendMessage (myhandle, EM_SETCHARFORMAT, (WPARAM)SCF_ALL, (LPARAM)&cf); + perlcs->clrForeground = CLR_INVALID; // Don't Store + } + + if(perlcs->clrBackground != CLR_INVALID) { + SendMessage (myhandle, EM_SETBKGNDCOLOR, (WPARAM)0, (LPARAM)(perlcs->clrBackground)); + perlcs->clrBackground = CLR_INVALID; // Don't Store + } + } Index: GUI.pm =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.pm,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** GUI.pm 3 Dec 2005 01:56:31 -0000 1.36 --- GUI.pm 11 Jan 2006 21:26:14 -0000 1.37 *************** *** 25,32 **** # STATIC OBJECT PROPERTIES # ! $VERSION = "1.03_01"; # For MakeMaker $XS_VERSION = $VERSION; # For dynaloader $VERSION = eval $VERSION; # For Perl (see perldoc perlmodstyle) ! $MenuIdCounter = 1; $TimerIdCounter = 1; $NotifyIconIdCounter = 1; --- 25,32 ---- # STATIC OBJECT PROPERTIES # ! $VERSION = "1.03_02"; # For MakeMaker $XS_VERSION = $VERSION; # For dynaloader $VERSION = eval $VERSION; # For Perl (see perldoc perlmodstyle) ! $MenuIdCounter = 101; $TimerIdCounter = 1; $NotifyIconIdCounter = 1; *************** *** 1469,1474 **** # -uppercase => 0/1 (default 0) # Convert all caracter into uppercase ! # -autohscroll => 0/1 (default 0) ! # -autovscroll => 0/1 (default 0) # -number => 0/1 (default 0) # Allows only digits to be entered into the edit control --- 1469,1479 ---- # -uppercase => 0/1 (default 0) # Convert all caracter into uppercase ! # -autohscroll => 0/1 (default 1 (0 for a multiline Textfield)) ! # Automatically scroll to right as text is typed past the right ! # margin; If 0 for a multiline Textfield, then wrap to the next ! # line. ! # -autovscroll => 0/1 (default 1) ! # For a multiline Textfiled automatically scroll down as lines ! # pass the bottom of the control. # -number => 0/1 (default 0) # Allows only digits to be entered into the edit control *************** *** 1824,1828 **** # (@)PACKAGE:Win32::GUI::RichEdit # Create and manipulate Richedit controls. ! # Most of the methods and events that apply to a L<TextField|Win32::GUI::Textfield> # also apply to Win32::GUI::RichEdit. # --- 1829,1833 ---- # (@)PACKAGE:Win32::GUI::RichEdit # Create and manipulate Richedit controls. ! # Most of the methods and events that apply to a L<Textfield|Win32::GUI::Textfield> # also apply to Win32::GUI::RichEdit. # *************** *** 1842,1846 **** # Creates a new RichEdit object; # can also be called as PARENT->AddRichEdit(%OPTIONS). ! # See new Win32::GUI::TextField() for B<%OPTIONS> sub new { $Win32::GUI::RICHED = Win32::GUI::LoadLibrary("RICHED32") unless defined $Win32::GUI::RICHED; --- 1847,1851 ---- # Creates a new RichEdit object; # can also be called as PARENT->AddRichEdit(%OPTIONS). ! # See new Win32::GUI::Textfield() for B<%OPTIONS> sub new { $Win32::GUI::RICHED = Win32::GUI::LoadLibrary("RICHED32") unless defined $Win32::GUI::RICHED; *************** *** 2753,2759 **** ############################################################################### # (@)PACKAGE:Win32::GUI::NotifyIcon ! # Create and manipulate notify icons in the system tray # package Win32::GUI::NotifyIcon; ########################################################################### --- 2758,2774 ---- ############################################################################### # (@)PACKAGE:Win32::GUI::NotifyIcon ! # Create and manipulate icons and tooltips in the system tray # + # The functionality of Win32::GUI::NotifyIcon is affected by the version + # of shell.dll installed with the windows system running your script. You + # can find this version from $Win32::GUI::NotifyIcon::SHELLDLL_VERSION, + # which contains the major version number of the shell.dll library that + # has been loaded. package Win32::GUI::NotifyIcon; + use Win32(); + our $SHELLDLL_VERSION; + BEGIN { + $SHELLDLL_VERSION = (Win32::GetFileVersion('shell32'))[0]; + } ########################################################################### *************** *** 2764,2777 **** # B<%OPTIONS> are: # -icon => Win32::GUI::Icon object ! # -id => NUMBER ! # a unique identifier for the NotifyIcon object # -name => STRING # the name for the object # -tip => STRING ! # the text that will appear as tooltip when the mouse is ! # on the NotifyIcon # -event => NEM Event Hash # Set NEM event handler (you can also use -on Event Option). ! sub new { my $class = shift; --- 2779,2828 ---- # B<%OPTIONS> are: # -icon => Win32::GUI::Icon object ! # the icon to display in the taskbar # -name => STRING # the name for the object # -tip => STRING ! # the text that will appear as a tooltip when the mouse is ! # hovering over the NotifyIcon. For shell.dll versions prior ! # to 5.0 the text length is limited to 63 characters; For ! # later versions it is limited to 127 characters. The string ! # provided will be truncated as necessary. # -event => NEM Event Hash # Set NEM event handler (you can also use -on Event Option). ! # ! # For shell.dll version 5.0 and later balloon tooltips can be used, ! # the following options control balloon tooltips. If your version ! # of shell.dll does not support balloon tooltips, then these options ! # are silently ignored: ! # -balloon => 0/1 ! # A flag controlling whether the ballon tip is displayed by ! # new() or Change(), or whether the ShowBalloon() method ! # must be called to display the balloon tooltip. Defaults ! # to 0 (not displayed). ! # -balloon_tip => STRING ! # Sets the text that will appear in the body of the balloon tip. ! # Will cause the balloon tip to be removed from the screen if set ! # to the empty string and displayed. The string is limited to ! # 255 characters and will be truncated as necessary. ! # -balloon_title => STRING ! # Sets the text that appears as a title at the top of the balloon ! # tip. The string is limited to 63 characters and will be truncated ! # as necessary. ! # -balloon_icon => STRING ! # Sets the icon that is displayed next to the balloon tip title. If ! # the balloon tip title is not set (or is set to the empty string), ! # then no icon is displayed. Allowed values for STRING are: ! # error, info, warning, none. Defaults to 'none'. ! # -balloon_timeout => NUMBER ! # The maximum time for which a balloon tooltip is displayed before ! # being removed, in milliseconds. The system will limit the range ! # allowed (typically to between 10 and 30 seconds). If a balloon ! # is being displayed and another taskbar icon tries to display a ! # balloon tip, then the one being displayed will be removed after ! # it has been displayed for the system minimum time (typically 10 ! # seconds), and only then will the new tooltip be displayed. ! # Defaults to 10 seconds. ! # ! # Returns a Win32::GUI::NotifyIcon object on success, undef on failure sub new { my $class = shift; *************** *** 2782,2787 **** if(!exists($args{-id})) { ! $args{-id} = $Win32::GUI::NotifyIconIdCounter; ! $Win32::GUI::NotifyIconIdCounter++; } --- 2833,2840 ---- if(!exists($args{-id})) { ! $args{-id} = $Win32::GUI::NotifyIconIdCounter++; # TODO - deprecate ! } ! else { ! warn qq(The -id option is deprecated, and you should not be setting it.); } *************** *** 2790,2793 **** --- 2843,2848 ---- } + $args{-balloon} = 0 unless exists $args{-balloon}; + my $self = {}; bless($self, $class); *************** *** 2796,2811 **** $self->{-name} = $args{-name}; $self->{-handle} = $window->{-handle}; ! # Store name in notifyicons hash $window->{-notifyicons}->{$args{-id}} = $args{-name}; ! # AutoReference to parent $window->{$args{-name}} = $self; - # Only if perl is circular ref-safe - if ($] > 5.006) { - $self->{-window} = \$window; - } ! Win32::GUI::NotifyIcon::Add($self->{-handle}, %args); return $self; } --- 2851,2867 ---- $self->{-name} = $args{-name}; $self->{-handle} = $window->{-handle}; + $self->{-balloon_tip} = $args{-balloon_tip}; + $self->{-balloon_title} = $args{-balloon_title}; + $self->{-balloon_timeout} = $args{-balloon_timeout}; + $self->{-balloon_icon} = $args{-balloon_icon}; ! # Store name in parent's notifyicons hash $window->{-notifyicons}->{$args{-id}} = $args{-name}; ! # Add NotifyIcon into parent's hash $window->{$args{-name}} = $self; ! my $result = Win32::GUI::NotifyIcon::_Add($self->{-handle}, %args); + return undef unless $result; return $self; } *************** *** 2813,2821 **** ########################################################################### # (@)METHOD:Change(%OPTIONS) ! # Change most option. See new Win32::GUI::NotifyIcon(). sub Change { my $self = shift; my %args = @_; ! return Win32::GUI::NotifyIcon::Modify($self->{-handle}, %args); } --- 2869,2998 ---- ########################################################################### # (@)METHOD:Change(%OPTIONS) ! # Change all options. See new Win32::GUI::NotifyIcon(). ! # ! # Returns 1 on success, 0 on failure sub Change { my $self = shift; my %args = @_; ! ! $args{-balloon} = 0 unless exists $args{-balloon}; ! ! $self->{-balloon_tip} = $args{-balloon_tip} if exists $args{-balloon_tip}; ! $self->{-balloon_title} = $args{-balloon_title} if exists $args{-balloon_title}; ! $self->{-balloon_timeout} = $args{-balloon_timeout} if exists $args{-balloon_timeout}; ! $self->{-balloon_icon} = $args{-balloon_icon} if exists $args{-balloon_icon}; ! ! if($self->{-balloon}) { ! $args{-balloon_tip} = $self->{-balloon_tip}; ! $args{-balloon_title} = $self->{-balloon_title}; ! $args{-balloon_timeout} = $self->{-balloon_timeout}; ! $args{-balloon_icon} = $self->{-balloon_icon}; ! } ! ! return Win32::GUI::NotifyIcon::_Modify($self->{-handle}, -id => $self->{-id}, %args); ! } ! ! ########################################################################### ! # (@)METHOD:ShowBalloon([FLAG=1]) ! # Only supported by shell32.dll v5.0 and above ! # ! # Show or hide a balloon tooltip with details supplied from the new() or ! # Change() methods, using the -balloon_tip, -balloon_title, -balloon_timeout ! # and -balloon_icon options. ! # ! # Set B<FLAG> to a true value to display the balloon tooltip, or to a false ! # value to hide the tip (it will automatically be hidden by the system ! # after -balloon_timeout millseconds). If B<FLAG> is omitted, displays the ! # tooltip. If the tooltip is already showing, re-showing it queues ! # a new balloon tooltip to be displayed once the existing one times out. ! # ! # Returns 1 on success, 0 on failure or undef if not supported. ! sub ShowBalloon { ! return undef if $SHELLDLL_VERSION < 5; ! my $self = shift; ! my $flag = shift; ! $flag = 1 unless defined $flag; ! ! return Win32::GUI::NotifyIcon::_Modify( ! $self->{-handle}, ! -id => $self->{-id}, ! -balloon => 1, ! -balloon_tip => $flag ? $self->{-balloon_tip} : '', ! -balloon_title => $self->{-balloon_title}, ! -balloon_timeout => $self->{-balloon_timeout}, ! -balloon_icon => $self->{-balloon_icon}, ! ); ! } ! ! ########################################################################### ! # (@)METHOD:HideBalloon([FLAG=1]) ! # Only supported by shell32.dll v5.0 and above ! # ! # Show or hide a balloon tooltip with details supplied from the new() or ! # Change() methods, using the -balloon_tip, -balloon_title, -balloon_timeout ! # and -balloon_icon options. ! # ! # Set B<FLAG> to a false value to display the balloon tooltip, or to a true ! # value to hide the tip (it will automatically be hidden by the system ! # after -balloon_timeout millseconds). If B<FLAG> is omitted, hides the ! # tooltip. If the tooltip is already showing, re-showing it queues ! # a new balloon tooltip to be displayed once the existing one times out. ! # ! # Returns 1 on success, 0 on failure or undef if not supported. ! sub HideBalloon { ! return undef if $SHELLDLL_VERSION < 5; ! my $self = shift; ! my $flag = shift; ! $flag = 1 unless defined $flag; ! ! return $self->ShowBalloon(!$flag); ! } ! ! ########################################################################### ! # (@)METHOD:SetFocus() ! # Only supported by shell32.dll v5.0 and above ! # ! # Return focus to the taskbar notification area. For example if the taskbar ! # icon displays a shortcut menu and the use cancels the menu with ESC, then ! # use this method to return focus to the taskbar notification area. ! # ! # Returns 1 on success, 0 on failure and undef if not supported. ! sub SetFocus { ! return undef if $SHELLDLL_VERSION < 5; ! my $self = shift; ! return Win32::GUI::NotifyIcon::_SetFocus($self->{-handle}, -id => $self->{-id}); ! } ! ! ########################################################################### ! # (@)METHOD:SetBehaviour([FLAG]) ! # Only supported by shell32.dll v5.0 and above ! # ! # Set FLAG to a true value to get the Windows 2000 taskbar behaviour. set ! # FLAG to a flase value to get Windows 95 taskbar behaviour. See the MSDN ! # documentation for Shell_NotifyIcon for more details. ! # ! # Returns 1 on success, 0 on failure and undef if not supported. ! sub SetBehaviour { ! return undef if $SHELLDLL_VERSION < 5; ! my $self = shift; ! my $flag = shift || 0; ! return Win32::GUI::NotifyIcon::_SetVersion($self->{-handle}, -id => $self->{-id}, -behaviour => $flag); ! } ! ! ########################################################################### ! # (@)METHOD:Remove() ! # Remove the Notify Icon from the system tray, and free its related resources ! sub Remove { ! my $self = shift; ! $self->DESTROY(); ! } ! ! ########################################################################### ! # (@)METHOD:Delete() ! # Deprecated method for removing notify icon from the system tray. Will be ! # removed from future Win32::GUI versions without further warning. ! sub Delete { ! warn qq(Win32::GUI::NotifyIcon::Delete() is deprecated, please use Win32::GUI::NofityIcon::Remove()); ! return Win32::GUI::_Delete(@_); } *************** *** 2824,2846 **** sub DESTROY { ! my($self) = @_; ! if ( defined $self && ! defined $self->{-handle} && ! defined $self->{-id} ) { ! ! Win32::GUI::NotifyIcon::Delete( ! $self->{-handle}, ! -id => $self->{-id}, ! ); ! if (defined $self->{-window}) { ! my $window = ${$self->{-window}}; ! # Remove id from parent ! delete $window->{-notifyicons}->{$self->{-id}} ! if ref($window) and defined $window->{-notifyicons}->{$self->{-id}}; ! # Remove name from parent ! delete $window->{$self->{-name}} if defined $window; ! } } } --- 3001,3018 ---- sub DESTROY { + my $self = shift; ! # Remove the notify icon ! Win32::GUI::NotifyIcon::_Delete($self->{-handle}, -id => $self->{-id}); ! # We put this code to tidy up the parent here, rather than ! # in NofifyIcon->Delete(), so that we still tidy up, even in the ! # unlikely event of someone doing PARENT->{NotifyIcon name} = undef; ! my $window = Win32::GUI::GetWindowObject($self->{-handle}); ! if(defined $window) { ! # Remove id from -notifyicons hash ! delete $window->{-notifyicons}->{$self->{-id}} if defined $window->{-notifyicons}; ! # Remove name from parent ! delete $window->{$self->{-name}}; } } *************** *** 3359,3363 **** } ! # print "[DESTROY Fin] self='$self'\n"; } --- 3531,3535 ---- } ! # print "[DESTROY Fin ] self='$self'\n"; } Index: CHANGELOG =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** CHANGELOG 3 Dec 2005 01:56:31 -0000 1.69 --- CHANGELOG 11 Jan 2006 21:26:14 -0000 1.70 *************** *** 6,29 **** Win32-GUI ChangeLog =================== ! + [Robert May] : 3 Dec 2003 - bug fixes ! - GUI.h change order of instructions to prevent crashes (Trackers ! 1243378 and 1248578) - GUI.pm up version to 1.03_01 and tidy up - GUI.xs change logic in all message loops (Dialog, DoEvents, DoModal) to ! prevent memoy leak (Tracker: 1201190) - Listbox.xs add documentation to differentiate between SetCurSel and ! SetSel ! + [Robert May] : 22 Nov 2003 - 1.03 release - Tagged head as Win32-GUI-1_03 ! + [Robert May] : 21 Nov 2003 - 1.03 release candidate - t\05_Timer_*.t change interval test to use milli-seconds using ! Win32::GetTickCount() rather than time(). ! -t\01_basic.t add tests for Test::More availability and correct OS. ! -t\98_Pod.t new test of POD syntax - various minor documentation edits to correct POD syntax ! -Makefile.PL added test for presence of compiler to stop us failing CPAN ! Smoke tests in test environments with no compilers. - Up version to 1.03 --- 6,55 ---- Win32-GUI ChangeLog =================== ! + [Robert May] : 11 Jan 2006 - bug fixes and add balloon tips for Notify Icon ! - Label.xs correct -truncate option processing, as SS_.*ELLIPSIS.* ! styles are not single bits ! - NotifyIcon.xs, GUI_Options.cpp, GUI.pm re-work NofifyIcon ! class. Add balloon tooltips. Add support for message behaviour. Add ! support for setfocus. Add documentation. (Tracker: 1065072) ! - t\05_NotifyIcon*.t, MANIFEST Notify Icon Tests added ! - samples\NotifyIcon.pl, MANIFEST add demo app ! - GUI.pm Changed initial value of $Win32::GUI::MenuIdCounter to avoid ID ! clash with predefined WM_COMMAND values (IDOK, IDCANCEL, etc.) ! - GUI.xs Fix SendMessageTimeout to match documentation and return ! undef on failure. (XSRETURN_UNDEF rather than XSRETURN_NO). ! - GUI.pm corrected documentation of default values for autohscroll ! and autovscroll in Textfield documentation ! - GUI_MessageLoops.cpp added processing of WM_NEXTDLGCTL to ! CommonMessageLoop to allow for tabbing out of multiline Textfields ! when using -dialogui ! - GUI_MessageLoops.cpp fixed WM_ERASEBACKGROUND (Tracker:1363141) ! - Splitter.xs, GUI_Helpers.cpp, GUI.h re-worked splitter class. ! (Tracker:1363141) ! - RichEdit.xs made -background and -foreground work ! - GUI_MessageLoops.cpp made -background work for Splitter windows ! - GUI_Helpers.cpp removed an unnecessary dTHX, replacing it with ! PERLUD_FETCH ! - Upped version to 1.03_02 ! ! + [Robert May] : 3 Dec 2005 - bug fixes ! - GUI.h change order of instructions in PERLUD_FREE macro to prevent ! crashes (Trackers 1243378 and 1248578) - GUI.pm up version to 1.03_01 and tidy up - GUI.xs change logic in all message loops (Dialog, DoEvents, DoModal) to ! prevent memory leak (Tracker: 1201190) - Listbox.xs add documentation to differentiate between SetCurSel and ! SetSel (Tracker: 1177898) ! + [Robert May] : 22 Nov 2005 - 1.03 release - Tagged head as Win32-GUI-1_03 ! + [Robert May] : 21 Nov 2005 - 1.03 release candidate - t\05_Timer_*.t change interval test to use milli-seconds using ! Win32::GetTickCount() rather than time(). ! - t\01_basic.t add tests for Test::More availability and correct OS. ! - t\98_Pod.t new test of POD syntax - various minor documentation edits to correct POD syntax ! - Makefile.PL added test for presence of compiler to stop us failing CPAN ! Smoke tests in test environments with no compilers. - Up version to 1.03 *************** *** 31,44 **** - Makefile.PL added code to remove Test::More dependence from PPD - GUI_MessageLoops.cpp, Window.xs change all mouse related handlers to ! use GET_X_LPARAM and GET_Y_LPARAM rather than HIWORD and LOWORD ! (Tracker: 1262098) - GUI.xs added INTERNAL function GetWindowObject to get the perl window ! object from a window handle - GUI.pm, t\05_Timer*.t, docs\GUI\Tutorial\Part4.pod - re-wrote ! Win32::GUI::Timer implementation and updated docs to make it all ! consistent, and to make destruction happen correctly. Added full tests ! for the package. - GUI.xs fixed GetAsyncKeyState(), which was checking the wrong bit of ! window's return value. Updated documentation. - MANIFEST updated with new samples and new tests - GUI.pm upped version to 1.02_03 --- 57,70 ---- - Makefile.PL added code to remove Test::More dependence from PPD - GUI_MessageLoops.cpp, Window.xs change all mouse related handlers to ! use GET_X_LPARAM and GET_Y_LPARAM rather than HIWORD and LOWORD ! (Tracker: 1262098) - GUI.xs added INTERNAL function GetWindowObject to get the perl window ! object from a window handle - GUI.pm, t\05_Timer*.t, docs\GUI\Tutorial\Part4.pod - re-wrote ! Win32::GUI::Timer implementation and updated docs to make it all ! consistent, and to make destruction happen correctly. Added full tests ! for the package. - GUI.xs fixed GetAsyncKeyState(), which was checking the wrong bit of ! window's return value. Updated documentation. - MANIFEST updated with new samples and new tests - GUI.pm upped version to 1.02_03 Index: NotifyIcon.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/NotifyIcon.xs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NotifyIcon.xs 28 Mar 2004 15:01:47 -0000 1.3 --- NotifyIcon.xs 11 Jan 2006 21:26:16 -0000 1.4 *************** *** 19,23 **** # (@)INTERNAL:Add(PARENT, %OPTIONS) BOOL ! Add(parent,...) HWND parent PREINIT: --- 19,23 ---- # (@)INTERNAL:Add(PARENT, %OPTIONS) BOOL ! _Add(parent,...) HWND parent PREINIT: *************** *** 25,33 **** CODE: ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); ! nid.cbSize = sizeof(NOTIFYICONDATA); ! nid.hWnd = parent; nid.uCallbackMessage = WM_NOTIFYICON; SwitchBit(nid.uFlags, NIF_MESSAGE, 1); ParseNotifyIconOptions(NOTXSCALL sp, mark, ax, items, 1, &nid); --- 25,34 ---- CODE: ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); ! nid.cbSize = NOTIFYICONDATA_V1_SIZE; nid.hWnd = parent; nid.uCallbackMessage = WM_NOTIFYICON; SwitchBit(nid.uFlags, NIF_MESSAGE, 1); + SwitchBit(nid.uFlags, NIF_INFO, 1); + nid.uTimeout = 10000; ParseNotifyIconOptions(NOTXSCALL sp, mark, ax, items, 1, &nid); *************** *** 41,45 **** # (@)INTERNAL:Modify(PARENT, %OPTIONS) BOOL ! Modify(parent,...) HWND parent PREINIT: --- 42,46 ---- # (@)INTERNAL:Modify(PARENT, %OPTIONS) BOOL ! _Modify(parent,...) HWND parent PREINIT: *************** *** 47,53 **** CODE: ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); ! ! nid.cbSize = sizeof(NOTIFYICONDATA); nid.hWnd = parent; ParseNotifyIconOptions(NOTXSCALL sp, mark, ax, items, 1, &nid); --- 48,54 ---- CODE: ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); ! nid.cbSize = NOTIFYICONDATA_V1_SIZE; nid.hWnd = parent; + nid.uTimeout = 10000; ParseNotifyIconOptions(NOTXSCALL sp, mark, ax, items, 1, &nid); *************** *** 61,65 **** # (@)INTERNAL:Delete(PARENT, %OPTIONS) BOOL ! Delete(parent,...) HWND parent PREINIT: --- 62,66 ---- # (@)INTERNAL:Delete(PARENT, %OPTIONS) BOOL ! _Delete(parent,...) HWND parent PREINIT: *************** *** 67,71 **** CODE: ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); ! nid.cbSize = sizeof(NOTIFYICONDATA); nid.hWnd = parent; --- 68,72 ---- CODE: ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); ! nid.cbSize = NOTIFYICONDATA_V1_SIZE; nid.hWnd = parent; *************** *** 75,76 **** --- 76,114 ---- OUTPUT: RETVAL + + ########################################################################### + # (@)INTERNAL:SetFocus(PARENT, %OPTIONS) + BOOL + _SetFocus(parent,...) + HWND parent + PREINIT: + NOTIFYICONDATA nid; + CODE: + ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); + nid.cbSize = NOTIFYICONDATA_V1_SIZE; + nid.hWnd = parent; + + ParseNotifyIconOptions(NOTXSCALL sp, mark, ax, items, 1, &nid); + + RETVAL = Shell_NotifyIcon(NIM_SETFOCUS, &nid); + OUTPUT: + RETVAL + + ########################################################################### + # (@)INTERNAL:SetVersion(PARENT, %OPTIONS) + BOOL + _SetVersion(parent,...) + HWND parent + PREINIT: + NOTIFYICONDATA nid; + CODE: + ZeroMemory(&nid, sizeof(NOTIFYICONDATA)); + nid.cbSize = NOTIFYICONDATA_V1_SIZE; + nid.hWnd = parent; + + ParseNotifyIconOptions(NOTXSCALL sp, mark, ax, items, 1, &nid); + + RETVAL = Shell_NotifyIcon(NIM_SETVERSION, &nid); + OUTPUT: + RETVAL + Index: Splitter.xs =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Splitter.xs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Splitter.xs 3 Aug 2005 21:45:57 -0000 1.4 --- Splitter.xs 11 Jan 2006 21:26:16 -0000 1.5 *************** *** 82,168 **** int PerlResult = 0; - BOOL tracking, horizontal; POINT pt; HWND phwnd, hwnd; RECT rc; switch(uMsg) { case WM_MOUSEMOVE: - tracking = perlud->dwPlStyle & PERLWIN32GUI_TRACKING; if(tracking) { - horizontal = perlud->dwPlStyle & PERLWIN32GUI_HORIZONTAL; hwnd = handle_From (NOTXSCALL perlud->svSelf); phwnd = GetParent(hwnd); ! GetCursorPos(&pt); ! ScreenToClient(phwnd, &pt); if(horizontal) { ! pt.y = AdjustSplitterCoord(NOTXSCALL perlud, pt.y, phwnd); ! DrawSplitter(NOTXSCALL hwnd); ! GetWindowRect(hwnd, &rc); ! ScreenToClient(phwnd, (POINT*)&rc); ! SetWindowPos(hwnd, NULL, rc.left, pt.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); ! DrawSplitter(NOTXSCALL hwnd); } else { ! pt.x = AdjustSplitterCoord(NOTXSCALL perlud, pt.x, phwnd); ! DrawSplitter(NOTXSCALL hwnd); ! GetWindowRect(hwnd, &rc); ! ScreenToClient(phwnd, (POINT*)&rc); ! SetWindowPos(hwnd, NULL, pt.x, rc.top, 0, 0, SWP_NOZORDER | SWP_NOSIZE); ! DrawSplitter(NOTXSCALL hwnd); } } break; case WM_LBUTTONDOWN: - SwitchBit(perlud->dwPlStyle, PERLWIN32GUI_TRACKING, 1); - horizontal = perlud->dwPlStyle & PERLWIN32GUI_HORIZONTAL; hwnd = handle_From (NOTXSCALL perlud->svSelf); phwnd = GetParent(hwnd); ! GetCursorPos(&pt); ! ScreenToClient(phwnd, &pt); if(horizontal) { ! pt.y = AdjustSplitterCoord(NOTXSCALL perlud, pt.y, phwnd); ! DrawSplitter(NOTXSCALL hwnd); ! SetCapture(hwnd); } else { ! pt.x = AdjustSplitterCoord(NOTXSCALL perlud, pt.x, phwnd); ! DrawSplitter(NOTXSCALL hwnd); ! SetCapture(hwnd); } break; case WM_LBUTTONUP: - tracking = perlud->dwPlStyle & PERLWIN32GUI_TRACKING; if(tracking) { ! horizontal = perlud->dwPlStyle & PERLWIN32GUI_HORIZONTAL; hwnd = handle_From (NOTXSCALL perlud->svSelf); phwnd = GetParent(hwnd); ! GetCursorPos(&pt); ! ScreenToClient(phwnd, &pt); /* * (@)EVENT:Release(COORD) * Sent when the Splitter is released after being * dragged to a new location (identified by the ! * COORD parameter). * (@)APPLIES_TO:Splitter */ ! if(horizontal) { ! pt.y = AdjustSplitterCoord(NOTXSCALL perlud, pt.y, phwnd); ! DrawSplitter(NOTXSCALL hwnd); ! PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "Release", ! PERLWIN32GUI_ARGTYPE_LONG, (long) pt.y, ! -1); } else { ! pt.x = AdjustSplitterCoord(NOTXSCALL perlud, pt.x, phwnd); ! DrawSplitter(NOTXSCALL hwnd); ! PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "Release", ! PERLWIN32GUI_ARGTYPE_LONG, (long) pt.x, ! -1); } } - SwitchBit(perlud->dwPlStyle, PERLWIN32GUI_TRACKING, 0); - SetWindowLong(hwnd, GWL_USERDATA, (LONG) perlud); - ReleaseCapture(); break; --- 82,189 ---- int PerlResult = 0; POINT pt; HWND phwnd, hwnd; RECT rc; + int w,h; + + BOOL tracking = perlud->dwPlStyle & PERLWIN32GUI_TRACKING; + BOOL horizontal = perlud->dwPlStyle & PERLWIN32GUI_HORIZONTAL; switch(uMsg) { case WM_MOUSEMOVE: if(tracking) { hwnd = handle_From (NOTXSCALL perlud->svSelf); phwnd = GetParent(hwnd); ! GetWindowRect(hwnd, &rc); ! w = rc.right - rc.left; ! h = rc.bottom - rc.top; ! ScreenToClient(phwnd, (POINT*)&rc); ! pt.x = GET_X_LPARAM(lParam); ! pt.y = GET_Y_LPARAM(lParam); ! MapWindowPoints(hwnd, phwnd, (LPPOINT)&pt, 1); ! if(horizontal) { ! DrawSplitter(NOTXSCALL phwnd, rc.left, (int)(perlud->dwData), w, h); ! pt.y = AdjustSplitterCoord(NOTXSCALL perlud, pt.y, h, phwnd); ! perlud->dwData = (DWORD)pt.y; ! DrawSplitter(NOTXSCALL phwnd, rc.left, pt.y, w, h); } else { ! DrawSplitter(NOTXSCALL phwnd, (int)(perlud->dwData), rc.top, w, h); ! pt.x = AdjustSplitterCoord(NOTXSCALL perlud, pt.x, w, phwnd); ! perlud->dwData = (DWORD)pt.x; ! DrawSplitter(NOTXSCALL phwnd, pt.x, rc.top, w, h); } } break; case WM_LBUTTONDOWN: hwnd = handle_From (NOTXSCALL perlud->svSelf); phwnd = GetParent(hwnd); ! GetWindowRect(hwnd, &rc); ! w = rc.right - rc.left; ! h = rc.bottom - rc.top; ! ScreenToClient(phwnd, (POINT*)&rc); ! pt.x = GET_X_LPARAM(lParam); ! pt.y = GET_Y_LPARAM(lParam); ! MapWindowPoints(hwnd, phwnd, (LPPOINT)&pt, 1); if(horizontal) { ! pt.y = AdjustSplitterCoord(NOTXSCALL perlud, pt.y, h, phwnd); ! perlud->dwData = (DWORD)rc.top; ! DrawSplitter(NOTXSCALL phwnd, rc.left, rc.top, w, h); } else { ! pt.x = AdjustSplitterCoord(NOTXSCALL perlud, pt.x, w, phwnd); ! perlud->dwData = (DWORD)rc.left; ! DrawSplitter(NOTXSCALL phwnd, rc.left, rc.top, w, h); } + SwitchBit(perlud->dwPlStyle, PERLWIN32GUI_TRACKING, 1); + SetCapture(hwnd); break; case WM_LBUTTONUP: if(tracking) { ! ReleaseCapture(); // Sends us a WM_CAPTURECHANGED message hwnd = handle_From (NOTXSCALL perlud->svSelf); phwnd = GetParent(hwnd); ! GetWindowRect(hwnd, &rc); ! w = rc.right - rc.left; ! h = rc.bottom - rc.top; ! ScreenToClient(phwnd, (POINT*)&rc); ! ! if(horizontal) { ! MoveWindow(hwnd, rc.left, (int)(perlud->dwData), w, h, 1); ! } else { ! MoveWindow(hwnd, (int)(perlud->dwData), rc.top, w, h, 1); ! } ! /* * (@)EVENT:Release(COORD) * Sent when the Splitter is released after being * dragged to a new location (identified by the ! * COORD parameter). COORD is the top coordinate ! * of a horizontal splitter or the left coordinate ! * of a vertical splitter. * (@)APPLIES_TO:Splitter */ ! PerlResult = DoEvent(NOTXSCALL perlud, PERLWIN32GUI_NEM_CONTROL1, "Release", ! PERLWIN32GUI_ARGTYPE_LONG, (long) perlud->dwData, ! -1); ! } ! break; ! case WM_CAPTURECHANGED: ! if(tracking) { ! hwnd = handle_From (NOTXSCALL perlud->svSelf); ! phwnd = GetParent(hwnd); ! GetWindowRect(hwnd, &rc); ! w = rc.right - rc.left; ! h = rc.bottom - rc.top; ! ScreenToClient(phwnd, (POINT*)&rc); ! SwitchBit(perlud->dwPlStyle, PERLWIN32GUI_TRACKING, 0); + if(horizontal) { + DrawSplitter(NOTXSCALL phwnd, rc.left, (int)(perlud->dwData), w, h); } else { ! DrawSplitter(NOTXSCALL phwnd, (int)(perlud->dwData), rc.top, w, h); } } break; *************** *** 182,186 **** ########################################################################### # (@)METHOD:Min([VALUE]) ! # Get or Set Min value void --- 203,209 ---- ########################################################################### # (@)METHOD:Min([VALUE]) ! # Get or Set Min value. The min value is the minimum position ! # to which the left(top) of the splitter can be dragged, in ! # the parent window for a horizontal(vertical) splitter. void *************** *** 207,211 **** ########################################################################### # (@)METHOD:Max([VALUE]) ! # Get or Set Max value void --- 230,236 ---- ########################################################################### # (@)METHOD:Max([VALUE]) ! # Get or Set Max value. The max value is the maximum position ! # to which the left(top) of the splitter can be dragged, in ! # the parent window for a horizontal(vertical) splitter. void *************** *** 232,236 **** ########################################################################### # (@)METHOD:Horizontal([VALUE]) ! # Get or Set Horizontal value void --- 257,263 ---- ########################################################################### # (@)METHOD:Horizontal([VALUE]) ! # Get or Set Horizontal orientation. If value is true, then sets ! # the splitter orientation to horizontal. If value is false, then ! # sets the splitter to Vertical orintation. void *************** *** 257,261 **** ########################################################################### # (@)METHOD:Vertical([VALUE]) ! # Get or Set Vertical value void --- 284,290 ---- ########################################################################### # (@)METHOD:Vertical([VALUE]) ! # Get or Set Vertical orientation. If value is true, then sets ! # the splitter orientation to vertuical. If value is false, then ! # sets the splitter to horizontal orintation. void Index: MANIFEST =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/MANIFEST,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MANIFEST 21 Nov 2005 22:33:33 -0000 1.11 --- MANIFEST 11 Jan 2006 21:26:16 -0000 1.12 *************** *** 89,92 **** --- 89,93 ---- samples/MonthCal.pl samples/Notepad.pl + samples/NotifyIcon.pl samples/Region.pl samples/SplashScreen.pl *************** *** 115,118 **** --- 116,124 ---- t/05_AcceleratorTable.t t/05_Menu.t + t/05_NotifyIcon_01_Constructor.t + t/05_NotifyIcon_02_Change.t + t/05_NotifyIcon_03_OtherMethods.t + t/05_NotifyIcon_04_Remove.t + t/05_NotifyIcon_05_DESTROY.t t/05_Timer_01_OEM.t t/05_Timer_02_NEM.t Index: GUI_Options.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Options.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GUI_Options.cpp 3 Aug 2005 21:45:57 -0000 1.9 --- GUI_Options.cpp 11 Jan 2006 21:26:16 -0000 1.10 *************** *** 860,866 **** --- 860,886 ---- int i, next_i; char * option; + SV* shversion; + UINT version = 0; HV* hvEvents = NULL; + shversion = get_sv("Win32::GUI::NotifyIcon::SHELLDLL_VERSION",0); + if(shversion != NULL) { + version = (UINT)SvIV(shversion); + #if (_WIN32_IE >= 0x0500) && (_WIN32_IE < 0x0600) + if (version >= 5) { + nid->cbSize = sizeof(NOTIFYICONDATA); + } + #endif + #if (_WIN32_IE >= 0x0600) + if (version >= 5) { + nid->cbSize = NOTIFYICONDATA_V2_SIZE; + } + if (version >= 6) { + nid->cbSize = sizeof(NOTIFYICONDATA); + } + #endif + } + next_i = -1; for(i = from_i; i < items; i++) { *************** *** 876,880 **** } else if(strcmp(option, "-tip") == 0) { next_i = i + 1; ! strcpy(nid->szTip, SvPV_nolen(ST(next_i))); SwitchBit(nid->uFlags, NIF_TIP, 1); } else if(strcmp(option, "-events") == 0) { --- 896,906 ---- } else if(strcmp(option, "-tip") == 0) { next_i = i + 1; ! if( version < 5 ) { ! strncpy(nid->szTip, SvPV_nolen(ST(next_i)), 64); ! nid->szTip[63] = '\0'; ! } else { ! strncpy(nid->szTip, SvPV_nolen(ST(next_i)), 128); ! nid->szTip[127] = '\0'; ! } SwitchBit(nid->uFlags, NIF_TIP, 1); } else if(strcmp(option, "-events") == 0) { *************** *** 902,905 **** --- 928,963 ---- ParseNEMNotifyIconEvent( NOTXSCALL hvEvents, option+3, ST(next_i) ); + } else if(strcmp(option, "-behaviour") == 0) { + next_i = i + 1; + if (SvIV(ST(next_i))) { + nid->uVersion = NOTIFYICON_VERSION; + } + } else if(strcmp(option, "-balloon") == 0) { + next_i = i + 1; + SwitchBit(nid->uFlags, NIF_INFO, SvIV(ST(next_i))); + } else if(strcmp(option, "-balloon_tip") == 0) { + next_i = i + 1; + strncpy(nid->szInfo, SvPV_nolen(ST(next_i)), 256); + nid->szInfo[255] = '\0'; + } else if(strcmp(option, "-balloon_title") == 0) { + next_i = i + 1; + strncpy(nid->szInfoTitle, SvPV_nolen(ST(next_i)), 64); + nid->szInfoTitle[63] = '\0'; + } else if(strcmp(option, "-balloon_timeout") == 0) { + next_i = i + 1; + nid->uTimeout = (UINT) SvIV(ST(next_i)); + } else if(strcmp(option, "-balloon_icon") == 0) { + next_i = i + 1; + if(strcmp(SvPV_nolen(ST(next_i)), "error") == 0) { + nid->dwInfoFlags = NIIF_ERROR; + } else if(strcmp(SvPV_nolen(ST(next_i)), "info") == 0) { + nid->dwInfoFlags = NIIF_INFO; + } else if(strcmp(SvPV_nolen(ST(next_i)), "warning") == 0) { + nid->dwInfoFlags = NIIF_WARNING; + } else if(strcmp(SvPV_nolen(ST(next_i)), "none") == 0) { + nid->dwInfoFlags = NIIF_NONE; + } else { + W32G_WARN("Win32::GUI: Invalid value for -balloon_icon!"); + } } } else { *************** *** 957,959 **** hv_undef(hvEvents); } - --- 1015,1016 ---- Index: GUI.h =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** GUI.h 5 Dec 2005 09:38:58 -0000 1.23 --- GUI.h 11 Jan 2006 21:26:14 -0000 1.24 *************** *** 420,425 **** DWORD CALLBACK RichEditLoad(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR *pcb); int CALLBACK BrowseForFolderProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData); ! int AdjustSplitterCoord(NOTXSPROC LPPERLWIN32GUI_USERDATA perlud, int x, HWND phwnd); ! void DrawSplitter(NOTXSPROC HWND hwnd); BOOL CALLBACK EnumMyWindowsProc(HWND hwnd, LPARAM lparam); BOOL CALLBACK CountMyWindowsProc(HWND hwnd, LPARAM lparam); --- 420,425 ---- DWORD CALLBACK RichEditLoad(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR *pcb); int CALLBACK BrowseForFolderProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData); ! int AdjustSplitterCoord(NOTXSPROC LPPERLWIN32GUI_USERDATA perlud, int x, int w, HWND phwnd); ! void DrawSplitter(NOTXSPROC HWND hwnd, int x, int y, int w, int h); BOOL CALLBACK EnumMyWindowsProc(HWND hwnd, LPARAM lparam); BOOL CALLBACK CountMyWindowsProc(HWND hwnd, LPARAM lparam); Index: GUI_Helpers.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_Helpers.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** GUI_Helpers.cpp 6 Aug 2005 10:36:20 -0000 1.14 --- GUI_Helpers.cpp 11 Jan 2006 21:26:15 -0000 1.15 *************** *** 573,577 **** # (@)INTERNAL:AdjustSplitterCoord(self, x) */ ! int AdjustSplitterCoord(NOTXSPROC LPPERLWIN32GUI_USERDATA perlud, int x, HWND phwnd) { int min, max; int adjusted; --- 573,577 ---- # (@)INTERNAL:AdjustSplitterCoord(self, x) */ ! int AdjustSplitterCoord(NOTXSPROC LPPERLWIN32GUI_USERDATA perlud, int x, int w, HWND phwnd) { int min, max; int adjusted; *************** *** 584,588 **** max = -1; max = perlud->iMaxWidth; ! if(max == -1) max = rc.right; if(adjusted < min) adjusted = min; if(adjusted > max) adjusted = max; --- 584,588 ---- max = -1; max = perlud->iMaxWidth; ! if(max == -1) max = rc.right - w; if(adjusted < min) adjusted = min; if(adjusted > max) adjusted = max; *************** *** 594,611 **** # (@)INTERNAL:DrawSplitter(hwnd) */ ! void DrawSplitter(NOTXSPROC HWND hwnd) { ! RECT rc; HDC hdc; ! HBRUSH oldBrush; ! HPEN oldPen; hdc = GetDC(hwnd); ! oldBrush = (HBRUSH) SelectObject(hdc, GetStockObject(GRAY_BRUSH)); ! oldPen = (HPEN) SelectObject(hdc, GetStockObject(NULL_PEN)); ! GetClientRect(hwnd, &rc); ! PatBlt(hdc, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, DSTINVERT); ! if(oldBrush != NULL) SelectObject(hdc, oldBrush); ! if(oldPen != NULL) SelectObject(hdc, oldPen ); ReleaseDC(hwnd, hdc); } --- 594,624 ---- # (@)INTERNAL:DrawSplitter(hwnd) */ ! void DrawSplitter(NOTXSPROC HWND hwnd, int x, int y, int w, int h) { ! ! static WORD _dotPatternBmp[8] = { 0x00aa, 0x0055, 0x00aa, 0x0055, ! 0x00aa, 0x0055, 0x00aa, 0x0055}; ! HDC hdc; ! HBITMAP hbm; ! HBRUSH hbr, hbrushOld; ! ! /* create a monochrome checkered pattern */ ! hbm = CreateBitmap(8, 8, 1, 1, _dotPatternBmp); ! hbr = CreatePatternBrush(hbm); hdc = GetDC(hwnd); ! ! SetBrushOrgEx(hdc, x, y, NULL); ! hbrushOld = (HBRUSH)SelectObject(hdc, hbr); ! ! /* draw the checkered rectangle to the screen */ ! PatBlt(hdc, x, y, w, h, PATINVERT); ! ! SelectObject(hdc, hbrushOld); ! ReleaseDC(hwnd, hdc); + + DeleteObject(hbr); + DeleteObject(hbm); } *************** *** 696,701 **** if(code == MSGF_MENU) { - dTHX; /* fetch context */ - PerlResult = 1; pmsg = (MSG *)lParam; --- 709,712 ---- *************** *** 703,706 **** --- 714,718 ---- if(ValidUserData(perlud)) { + PERLUD_FETCH; /* fetch context */ arrayref = av_fetch(perlud->avHooks, WM_TRACKPOPUP_MSGHOOK, 0); Index: GUI_MessageLoops.cpp =================================================================== RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI_MessageLoops.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GUI_MessageLoops.cpp 5 Dec 2005 09:38:58 -0000 1.16 --- GUI_MessageLoops.cpp 11 Jan 2006 21:26:16 -0000 1.17 *************** *** 76,88 **** perlud = (LPPERLWIN32GUI_USERDATA) GetWindowLong((HWND) hwnd, GWL_USERDATA); if(perlud && (perlud->dwPlStyle & PERLWIN32GUI_FLICKERFREE)) { ! return (LRESULT) 1; } // If we're a window and we have a background brush, then use it ! if(perlud && perlud->hBackgroundBrush && ! (perlud->iClass == WIN32__GUI__WINDOW || perlud->iClass == WIN32__GUI__DIALOG) ) { ! RECT rc; ! GetUpdateRect((HWND)hwnd, &rc, 0); ! FillRect((HDC)wParam, &rc, perlud->hBackgroundBrush); ! return (LRESULT) 1; } break; --- 76,91 ---- perlud = (LPPERLWIN32GUI_USERDATA) GetWindowLong((HWND) hwnd, GWL_USERDATA); if(perlud && (perlud->dwPlStyle & PERLWIN32GUI_FLICKERFREE)) { ! return (LRESULT) 1; } // If we're a window and we have a background brush, then use it ! if(perlud && perlud->hBackgroundBrush && (perlud->iClass == WIN32__GUI__WINDOW || ! perlud->iClass == WIN32__GUI__DIALOG || ! perlud->iClass == WIN32__GUI__SPLITTER) ) { ! // Although this looks like we paint the whole of the background ! // the HDC passed in wParam is clipped to the update region ! RECT rc; ! GetClientRect(hwnd, &rc); ! FillRect((HDC)wParam, &rc, perlud->hBackgroundBrush); ! return (LRESULT) 1; } break; *************** *** 95,103 **** if( ValidUserData(perlud) ) { if(uMsg == WM_CTLCOLORSTATIC) { ! if(perlud->iClass == WIN32__GUI__EDIT) // Read-only Edit control ! SetBkColor((HDC) wParam, GetSysColor(COLOR_BTNFACE)); ! else ! SetBkMode((HDC) wParam, TRANSPARENT); ! } if(perlud->clrForeground != CLR_INVALID) SetTextColor((HDC) wParam, perlud->clrForeground); --- 98,106 ---- if( ValidUserData(perlud) ) { if(uMsg == WM_CTLCOLORSTATIC) { ! if(perlud->iClass == WIN32__GUI__EDIT) // Read-only Edit control ! SetBkColor((HDC) wParam, GetSysColor(COLOR_BTNFACE)); ! else ! SetBkMode((HDC) wParam, TRANSPARENT); ! } if(perlud->clrForeground != CLR_INVALID) SetTextColor((HDC) wParam, perlud->clrForeground); *************** *** 108,114 **** } ! DWORD hbrBackground; ! if(hbrBackground = GetClassLong((HWND)lParam, GCL_HBRBACKGROUND)) ! return ((LRESULT) hbrBackground); switch(uMsg) { --- 111,117 ---- } ! DWORD hbrBackground; ! if(hbrBackground = GetClassLong((HWND)lParam, GCL_HBRBACKGROUND)) ! return ((LRESULT) hbrBackground); switch(uMsg) { *************** *** 153,156 **** --- 156,172 ---- break; } + + case WM_NEXTDLGCTL: + { + perlud = (LPPERLWIN32GUI_USERDATA) GetWindowLong(hwnd, GWL_USERDATA); + if( ValidUserData(perlud) && (perlud->dwPlStyle & PERLWIN32GUI_DIALOGUI) ) { + if(LOWORD(lParam)) + SetFocus((HWND)wParam); + else + SetFocus(GetNextDlgTabItem(hwnd, GetFocus(), (BOOL)wParam)); + + return 0; + } + } } #ifdef PERLWIN32GUI_STRONGDEBUG *************** *** 596,601 **** /* * (@)EVENT:MouseEvent(MSG) ! * Sent when the user performs a mouse event on * a NotifyIcon; MSG is the message code. * (@)APPLIES_TO:NotifyIcon */ --- 612,619 ---- /* * (@)EVENT:MouseEvent(MSG) ! * Sent when the user performs any other mouse event on * a NotifyIcon; MSG is the message code. + * For shell.dll greater than V6 will also fire for balloon + * events. * (@)APPLIES_TO:NotifyIcon */ |