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
*/