[Perl-win32-gui-cvscommit] Win32-GUI CHANGELOG,1.79,1.80 Makefile.PL,1.19,1.20 RichEdit.xs,1.7,1.8

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2

Modified Files:
CHANGELOG Makefile.PL RichEdit.xs 
Log Message:
Fix build under cygwin

Index: RichEdit.xs
===
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/RichEdit.xs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** RichEdit.xs 11 Jan 2006 21:26:16 -  1.7
--- RichEdit.xs 25 Apr 2006 21:24:52 -  1.8
***
*** 294,298 
  EXTEND(SP, 2);
  XST_mPV(si++, "-bold");
! XST_mIV(si++, cf.dwEffects & CFE_BOLD > 0);
  }
  if(dwMask & CFM_COLOR) {
--- 294,298 
  EXTEND(SP, 2);
  XST_mPV(si++, "-bold");
! XST_mIV(si++, (cf.dwEffects & CFE_BOLD) ? 1 : 0);
  }
  if(dwMask & CFM_COLOR) {
***
*** 309,313 
  EXTEND(SP, 2);
  XST_mPV(si++, "-italic");
! XST_mIV(si++, cf.dwEffects & CFE_ITALIC > 0);
  }
  if(dwMask & CFM_SIZE) {
--- 309,313 
  EXTEND(SP, 2);
  XST_mPV(si++, "-italic");
! XST_mIV(si++, (cf.dwEffects & CFE_ITALIC) ? 1 : 0);
  }
  if(dwMask & CFM_SIZE) {
***
*** 319,328 
  EXTEND(SP, 2);
  XST_mPV(si++, "-strikeout");
! XST_mIV(si++, cf.dwEffects & CFE_STRIKEOUT > 0);
  }
  if(dwMask & CFM_UNDERLINE) {
  EXTEND(SP, 2);
  XST_mPV(si++, "-underline");
! XST_mIV(si++, cf.dwEffects & CFE_UNDERLINE > 0);
  }
  XSRETURN(si);
--- 319,328 
  EXTEND(SP, 2);
  XST_mPV(si++, "-strikeout");
! XST_mIV(si++, (cf.dwEffects & CFE_STRIKEOUT) ? 1 : 0);
  }
  if(dwMask & CFM_UNDERLINE) {
  EXTEND(SP, 2);
  XST_mPV(si++, "-underline");
! XST_mIV(si++, (cf.dwEffects & CFE_UNDERLINE) ? 1 : 0);
  }
  XSRETURN(si);

Index: Makefile.PL
===
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/Makefile.PL,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Makefile.PL 13 Apr 2006 22:17:07 -  1.19
--- Makefile.PL 25 Apr 2006 21:24:52 -  1.20
***
*** 3,7 
  
  use File::Spec();
! use ExtUtils::MakeMaker;
  use Config;
  
--- 3,10 
  
  use File::Spec();
! # Bug in ExUtils::MakeMaker 5.45 that ships with ActiveState Perl
! # 5.6.1, writes the subdirs target with dmake syntax, that breaks
! # nmake.  Fixed in EU::MM 5.47
! use ExtUtils::MakeMaker 5.47;
  use Config;
  
***
*** 203,207 
  NAME=> 'Win32::GUI',
  VERSION_FROM=> 'GUI.pm',
! LIBS=> [':nosearch -lcomctl32 -lcomdlg32 -lshell32 -lgdi32 
-luser32'],
  PREREQ_PM   => {
   'Test::More' => 0,
--- 206,210 
  NAME=> 'Win32::GUI',
  VERSION_FROM=> 'GUI.pm',
! LIBS=> [':nosearch -lcomctl32 -lcomdlg32 -lshell32 -lgdi32 
-luser32 -lversion'],
  PREREQ_PM   => {
   'Test::More' => 0,
***
*** 243,247 
  
  if ($main::BUILDENV eq "cygwin") {
!   $MakefileArgs{'LIBS'} = ['-L/usr/lib/w32api -lcomctl32 -lcomdlg32 -lshell32 
-lgdi32 -luser32'];
$MakefileArgs{'DEFINE'} = '-UWIN32';
$MakefileArgs{'MYEXTLIB'} = './libcyg.a';
--- 246,250 
  
  if ($main::BUILDENV eq "cygwin") {
!   $MakefileArgs{'LIBS'} = ['-L/usr/lib/w32api -lcomctl32 -lcomdlg32 -lshell32 
-lgdi32 -luser32 -lversion'];
$MakefileArgs{'DEFINE'} = '-UWIN32';
$MakefileArgs{'MYEXTLIB'} = './libcyg.a';
***
*** 259,263 
  sub pasthru {
my $inherited = shift->SUPER::pasthru(@_);
!   return "$inherited W32G_CORE=1";
  }
  
--- 262,268 
  sub pasthru {
my $inherited = shift->SUPER::pasthru(@_);
!   chomp $inherited;
!   $inherited .= "\\\n\tW32G_CORE=1";
!   return $inherited;
  }
  

Index: CHANGELOG
===
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -d -r1.79 -r1.80
*** CHANGELOG   20 Apr 2006 22:20:20 -  1.79
--- CHANGELOG   25 Apr 2006 21:24:51 -  1.80
***
*** 6,9 
--- 6,14 
  Win32-GUI ChangeLog
  ===
+ + [Robert May] : 25 Apr 2006 - Fix build under cygwin/MSVC7
+ - RichEdit.xs fix precedence warning under VC7
+ - Makefile.PL fix LIBS under cygwin (add -lversion); fix
+   pasthru target under cygwin
+ 
  + [Robert May] : 20 Apr 2006 - Fix build under MinGW
  - GUI.xs correct typo in type definition (LPCTSTR vs LPTSTR);




[Perl-win32-gui-cvscommit] Win32-GUI/Win32-GUI-DropFiles - New directory

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26065/Win32-GUI-DropFiles

Log Message:
Directory /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles added to the 
repository





[Perl-win32-gui-cvscommit] Win32-GUI/Win32-GUI-DropFiles/t - New directory

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28112/t

Log Message:
Directory /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/t added to the 
repository





[Perl-win32-gui-cvscommit] Win32-GUI/Win32-GUI-DropFiles/demos - New directory

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/demos
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28229/demos

Log Message:
Directory /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/demos added to 
the repository





[Perl-win32-gui-cvscommit] Win32-GUI/Win32-GUI-DropFiles DropFiles.pm,NONE,1.1 DropFiles.xs,NONE,1.1 DropFilesRC.PL,NONE,1.1 Makefile,NONE,1.1 Makefile.PL,NONE,1.1 README,NONE,1.1 TYPEMAP,NONE,1.1 ppp

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364/Win32-GUI-DropFiles

Added Files:
DropFiles.pm DropFiles.xs DropFilesRC.PL Makefile Makefile.PL 
README TYPEMAP ppport.h 
Log Message:
Add Win32::GUI::DropFiles

--- NEW FILE: DropFiles.xs ---
#define WIN32_MEAN_AND_LEAN

/* XS code for Win32::GUI::DropFiles
 * $Id: DropFiles.xs,v 1.1 2006/04/25 21:38:18 robertemay Exp $
 * (c) Robert May, 2006
 * Released under the same terms as Perl
 */

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include "ppport.h"

#include "Windows.h"
#include "shellapi.h"

/* void newSVpvnW(SV* s, WCHAR* w, UINT c)
 *  - s [OUT] pointer to SV. Will be set to point to a newly created SV,
 *with ref count 1.
 *  - w [IN]  pointer to WCHAR buffer.
 *  - c [IN]  number of characters (NOT bytes) to be copied from WCHAR.  Do
 *not include any NULL termination. If c = -1, then length will be
 *calculated, assuming w is NULL terminated.
 */
/* TODO: This macro probably better written as a function that returns the
 * pointer to the SV, and it is more 'perl like' if c==0 indicates the length
 * should be calculated. It would be good to get rid of the duplicated SvPVX() 
calls.
 */
#define newSVpvnW(s, w, c) \
{ UINT b = WideCharToMultiByte(CP_UTF8, 0, w, c, NULL, 0, NULL, NULL); \
  s = newSV(b); SvPOK_on(s); SvUTF8_on(s); SvCUR_set(s,b); \
  WideCharToMultiByte(CP_UTF8, 0, w, c, SvPVX(s), b, NULL, NULL); \
  *(SvPVX(s) + b) = 0; sv_utf8_downgrade(s, 1); }

/* BOOL INVALID_HANDLE(HDROP h)
 * Attempt to determine if a HDROP handle is valid
 * Returns TRUE  if handle is invalid
 * Returns FALSE if handle is valid
 * TODO: can we do better than this?
 */
BOOL INVALID_HANDLE(HDROP h) {
if(GlobalLock((HGLOBAL)h)) {
GlobalUnlock((HGLOBAL)h);
return 0;
}
return 1;
}

#ifndef W32G_NO_WIN9X
/* BOOL IsWin9X()
 * Returns TRUE  if OS Version is Win95/98/ME
 * Returns FLASE if OS Version is NT/2K/XP/2003 or higher
 */
/* TODO: Better to cache the value to prevent the overhead of
 * GetVersion() on each call.  Eventually this needs extracting
 * somewhere central, so that we don't have repeat implementations
 * all over the place.  ??Can we efficiently access the Win32::IsWin95
 * function??
 */
BOOL IsWin9X() {
return (GetVersion() & 0x8000);
}
#endif

MODULE = Win32::GUI::DropFilesPACKAGE = Win32::GUI::DropFiles

PROTOTYPES: ENABLE

 ##
 # (@)WIN32API:DragQueryFile(HDROP, [ITEM])
 # See Dropfiles.pm for documentation
void DragQueryFile(handle, ...)
HDROP handle
PREINIT:
UINT count, item, cch;
SV* sv;
PPCODE:
/* Shell32.dll crashes if we pass an invalid handle
 * to DragQueryFile, so ensure we have one
 */
if(INVALID_HANDLE(handle)) {
SetLastError(ERROR_INVALID_HANDLE); /* set $^E */
errno = EINVAL; /* set $! */
XSRETURN_UNDEF; /* and return undef */
}
#ifndef W32G_NO_WIN9X
if(IsWin9X())
count = DragQueryFileA(handle, 0x, NULL, 0);
else
#endif
count = DragQueryFileW(handle, 0x, NULL, 0);

if(items == 1) {
mXPUSHu(count);
XSRETURN(1);
} else if (items == 2) {
item = SvIV(ST(1));
if(item < count) {  /* item is in range */
#ifndef W32G_NO_WIN9X
if(IsWin9X()) {
CHAR buffer[MAX_PATH];

cch = DragQueryFileA(handle, item, buffer, MAX_PATH);
sv = newSVpvn(buffer,cch);
} else {
#endif
WCHAR wbuffer[MAX_PATH];

cch = DragQueryFileW(handle, item, wbuffer, MAX_PATH);
newSVpvnW(sv, wbuffer, cch);
#ifndef W32G_NO_WIN9X
}
#endif
XPUSHs(sv_2mortal(sv));
XSRETURN(1);
} else {   /* item is out of range */
SetLastError(ERROR_INVALID_INDEX); /* set $^E */
errno = EINVAL;/* set $! */
XSRETURN_UNDEF;/* and return undef */
}
} else {
croak("Usage: DragQueryHandle(handle);\n   or: DragQueryHandle(handle, 
index);");
}

 ##
 # (@)WIN32API:DragQueryPoint(HDROP)
 # See Dropfiles.pm for documentation
void DragQueryPoint(handle)
HDROP handle
PREINIT:
POINT pt;
UV client;
PPCODE:
/* DragQueryPoint returns garbage if passed
 * an invalid handle, so ensure we have one
 */
if(INVALID_HANDLE(handle)) {
SetLastError(ERROR_INVALID_HANDLE); /* set $^E */
errno = EINVAL; /* set $! */
XSRETURN_UNDEF; /* and return undef */
}
client = (UV)DragQueryPoint(handle, &pt);
mXPUSHi(pt.x);
mXPUSHi(pt.y

[Perl-win32-gui-cvscommit] Win32-GUI/Win32-GUI-DropFiles/t 01_load.t,NONE,1.1 02_old_callback.t,NONE,1.1 03_new_callback.t,NONE,1.1 04_GetDroppedFiles.t,NONE,1.1 05_GetDroppedFile.t,NONE,1.1 06_GetDro

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364/Win32-GUI-DropFiles/t

Added Files:
01_load.t 02_old_callback.t 03_new_callback.t 
04_GetDroppedFiles.t 05_GetDroppedFile.t 06_GetDropPos.t 
07_DragQueryFile.t 08_DragQueryPoint.t 09_DragFinish.t 
10_Unicode.t 11_invalid_handles.t 98_pod.t 99_pod_coverage.t 
DropTest.pm 
Log Message:
Add Win32::GUI::DropFiles

--- NEW FILE: 99_pod_coverage.t ---
#!perl -wT
# Win32::GUI::DropFiles test suite.
# $Id: 99_pod_coverage.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $

# Check the POD covers all method calls

use strict;
use warnings;

use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" 
if $@;
plan skip_all => "Pod Coverage tests for Win32::GUI::DropFiles done by core" if 
$ENV{W32G_CORE};
all_pod_coverage_ok();

--- NEW FILE: 10_Unicode.t ---
#!perl -w
# Win32::GUI::DropFiles test suite
# $Id: 10_Unicode.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $
#
# Test Win32::GUI::DropFiles Unicode support

use strict;
use warnings;

BEGIN { $| = 1 } # Autoflush

# We assume that 01_load.t has been run, so we know we have Test::More
# and that Win32::GUI and Win32::GUI::DropFiles will load.

use Test::More;

BEGIN {
#No unicode support before WinNT
plan skip_all => "No Unicode filename support in Win95/98/ME" if 
Win32::GetOSVersion() < 2;
eval "use Win32::API 0.41";
plan skip_all => "Win32::API 0.41 required for testing Uniocde Support" if 
$@;
eval "use Unicode::String";
plan skip_all => "Unicode::String required for testing Unicode Support" if 
$@;
}

# Load our helpers
use FindBin;
use lib "$FindBin::Bin";
use DropTest;

use Win32::GUI 1.03_02;
use Win32::GUI::DropFiles;

my @tests = (
# Ascii chars only
[ "AB", "C", "Longer Name with spaces", ],
# Simley face
[ "\x{263A}", ],
# Hello World - multi-lingual
[ "Hello world",
  "\x{039A}\x{03B1}\x{03BB}\x{3B7}\x{03BC}\x{1F73}\x{03C1}\x{03B1}",
  "\x{03B1}\x{1F79}\x{03C3}\x{03BC}\x{03B5}, 
\x{30B3}\x{30F3}\x{30CB}\x{30C1}\x{30CF}",
],
# Thai
[ "\x{0E4F} 
\x{0E41}\x{0E1C}\x{0E48}\x{0E19}\x{0E14}\x{0E34}\x{0E19}\x{0E2E}\x{0E31}\x{0E48}\x{0E19}\x{0E40}\x{0E2A}\x{0E37}\x{0E48}\x{0E2D}\x{0E21}\x{0E42}\x{0E17}\x{0E23}\x{0E21}\x{0E41}\x{0E2A}\x{0E19}\x{0E2A}\x{0E31}\x{0E07}\x{0E40}\x{0E27}\x{0E0A}",
"\x{0E1E}\x{0E23}\x{0E30}\x{0E1B}\x{0E01}\x{0E40}\x{0E01}\x{0E28}\x{0E01}\x{0E2D}\x{0E07}\x{0E1A}\x{0E39}\x{0E4A}\x{0E01}\x{0E39}\x{0E49}\x{0E02}\x{0E36}\x{0E49}\x{0E19}\x{0E43}\x{0E2B}\x{0E21}\x{0E48}",
],
);

plan tests => 1 * scalar @tests;

my $W = Win32::GUI::Window->new(
-name  => 'win',
-title => "Win32::GUI DropFiles Test",
-size  => [400,300],
-onDropFiles => \&drop,
);

Win32::GUI::DoEvents();

my $files;
while($files = shift @tests) {
my $dt = DropTest->new(files => $files, wide => 1);
$dt->PostDropMessage($W);
Win32::GUI::Dialog();
}

exit(0);

sub drop {
my ($self, $dropobj) = @_;

my @f = $dropobj->GetDroppedFiles();
ok(eq_set($files,[EMAIL PROTECTED]), "Correct set of files found");

return -1;
}

--- NEW FILE: 98_pod.t ---
#!perl -wT
# Win32::GUI::DropFiles test suite.
# $Id: 98_pod.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $

# Check that our pod documentation has valid syntax

use strict;
use warnings;

BEGIN { $| = 1 } # Autoflush

use Test::More;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
plan skip_all => "Pod tests for Win32::GUI::DropFiles done by core" if 
$ENV{W32G_CORE};
all_pod_files_ok();

--- NEW FILE: 03_new_callback.t ---
#!perl -w
# Win32::GUI::DropFiles test suite
# $Id: 03_new_callback.t,v 1.1 2006/04/25 21:38:19 robertemay Exp $
#
# Test Win32::GUI DropFiles callback after loading Win32::GUI::DropFiles

# - check pre-requsites
# - check both OEM and NEM callbacks
# - check callback parameter types
# - check that DragFinish is called

use strict;
use warnings;

BEGIN { $| = 1 } # Autoflush

# We assume that 01_load.t has been run, so we know we have Test::More
# and that Win32::GUI and Win32::GUI::DropFiles will load.

use Test::More;

BEGIN {
eval "use Win32::API 0.41";
plan skip_all => "Win32::API 0.41 required for testing New Callback API" if 
$@;
}

plan tests => 7;

# Load our helpers
use FindBin;
use lib "$FindBin::Bin";
use DropTest;

use Win32::GUI 1.03_02;
use Win32::GUI::DropFiles;

my $dropobj = DropTest->new();

my $W = Win32::GUI::Window->new(
-name  => 'win',
-title => "Win32::GUI DropFiles Test",
-size  => [400,300],
-onDropFiles => \&drop,
-eventmodel  => "byname",
);

Win32::GUI::DoEvents();

# Do the OEM tests

$dropobj->PostDropMessage($W);

Win32::GUI::Dialog();

# Check that the receiver freed the handle
ok($dropobj->Free(), "OEM frees the drop object");

# Now do the NEM tests:

$W->Change(-eventmod

[Perl-win32-gui-cvscommit] Win32-GUI CHANGELOG,1.80,1.81 MANIFEST,1.14,1.15

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364

Modified Files:
CHANGELOG MANIFEST 
Log Message:
Add Win32::GUI::DropFiles

Index: CHANGELOG
===
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** CHANGELOG   25 Apr 2006 21:24:51 -  1.80
--- CHANGELOG   25 Apr 2006 21:38:18 -  1.81
***
*** 6,9 
--- 6,13 
  Win32-GUI ChangeLog
  ===
+ + [Robert May] : 25 Apr 2006 - Add Win32::GUI::DropFiles
+ - add Win32-GUI-DropFiles directory and new files
+ - update MANIFEST
+ 
  + [Robert May] : 25 Apr 2006 - Fix build under cygwin/MSVC7
  - RichEdit.xs fix precedence warning under VC7

Index: MANIFEST
===
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/MANIFEST,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** MANIFEST16 Mar 2006 21:11:12 -  1.14
--- MANIFEST25 Apr 2006 21:38:18 -  1.15
***
*** 131,134 
--- 131,135 
  t/50_Richedit_GetCharFormat.t
  t/98_Pod.t
+ t/99_pod_coverage.t
  TabStrip.xs
  Textfield.xs
***
*** 141,143 
--- 142,166 
  UpDown.xs
  vsplit.cur
+ Win32-GUI-DropFiles/demos/DropFilesDemo.pl
+ Win32-GUI-DropFiles/DropFiles.pm
+ Win32-GUI-DropFiles/DropFiles.xs
+ Win32-GUI-DropFiles/DropFilesRC.PL
+ Win32-GUI-DropFiles/Makefile.PL
+ Win32-GUI-DropFiles/ppport.h
+ Win32-GUI-DropFiles/README
+ Win32-GUI-DropFiles/t/01_load.t
+ Win32-GUI-DropFiles/t/02_old_callback.t
+ Win32-GUI-DropFiles/t/03_new_callback.t
+ Win32-GUI-DropFiles/t/04_GetDroppedFiles.t
+ Win32-GUI-DropFiles/t/05_GetDroppedFile.t
+ Win32-GUI-DropFiles/t/06_GetDropPos.t
+ Win32-GUI-DropFiles/t/07_DragQueryFile.t
+ Win32-GUI-DropFiles/t/08_DragQueryPoint.t
+ Win32-GUI-DropFiles/t/09_DragFinish.t
+ Win32-GUI-DropFiles/t/10_Unicode.t
+ Win32-GUI-DropFiles/t/11_invalid_handles.t
+ Win32-GUI-DropFiles/t/98_pod.t
+ Win32-GUI-DropFiles/t/99_pod_coverage.t
+ Win32-GUI-DropFiles/t/DropTest.pm
+ Win32-GUI-DropFiles/TYPEMAP
  Window.xs




[Perl-win32-gui-cvscommit] Win32-GUI/Win32-GUI-DropFiles/demos DropFilesDemo.pl,NONE,1.1

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI/Win32-GUI-DropFiles/demos
In directory 
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2364/Win32-GUI-DropFiles/demos

Added Files:
DropFilesDemo.pl 
Log Message:
Add Win32::GUI::DropFiles

--- NEW FILE: DropFilesDemo.pl ---
#!perl -w
use strict;
use warnings;
# $Id: DropFilesDemo.pl,v 1.1 2006/04/25 21:38:19 robertemay Exp $
#
# Demonstration of Win32::GUI::DropFiles functionality
#
# Note that even though Win32::GUI::DropFiles supports
# Unicode filenames on WinNT and above, Win32::GUI::Listbox
# does not, so filenames with unicode characters will appear
# corrupted in this demo.

use Win32::GUI();
use Win32::GUI::DropFiles();

my $mw = Win32::GUI::Window->new(
-title => "Win32::GUI::DropFiles Demonstration",
-pos   => [100,100],
-size  => [400,300],
-onResize => \&mwResize,
);

$mw->AddLabel(
-pos  => [10,10],
-text => "Drag files onto the Listbox below:",
);

$mw->AddListbox(
-name => 'LB',
-pos => [10,30],
-vscroll => 1,
-acceptfiles => 1,
-onDropFiles => \&gotDrop,
);

$mw->Show();
Win32::GUI::Dialog();
$mw->Hide();
exit(0);

sub gotDrop {
my ($self, $dropObj) = @_;

$self->Add($dropObj->GetDroppedFiles());

return 0;
}

sub mwResize {
my $self = shift;

$self->LB->Resize(
$self->ScaleWidth()-20,
$self->ScaleHeight()-40,
);

return 1;
}




[Perl-win32-gui-cvscommit] Win32-GUI/t 99_pod_coverage.t,NONE,1.1

2006-04-25 Thread Robert May
Update of /cvsroot/perl-win32-gui/Win32-GUI/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3589

Added Files:
99_pod_coverage.t 
Log Message:
Add Win32::GUI TODO test for POD Coverage

--- NEW FILE: 99_pod_coverage.t ---
#!perl -wT
# Win32::GUI::DropFiles test suite.
# $Id: 99_pod_coverage.t,v 1.1 2006/04/25 21:39:53 robertemay Exp $

# Check the POD covers all method calls

use strict;
use warnings;

use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" 
if $@;

plan tests => 1;

TODO: {
local $TODO = "Tests for Win32::GUI POD coverage not yet written";
fail("Win32::GUI POD Coverage tests");
}

# all_pod_coverage_ok is not even close to what we need!
# all_pod_coverage_ok();