[Perl-win32-gui-cvscommit] Win32-GUI/samples AnimateWindow.pl, NONE, 1.1
Update of /cvsroot/perl-win32-gui/Win32-GUI/samples
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14347
Added Files:
AnimateWindow.pl
Log Message:
Add missing AnimateWindow sample
--- NEW FILE: AnimateWindow.pl ---
#!perl -w
use strict;
use warnings;
# Show off window animation
use Win32::GUI qw(CW_USEDEFAULT);
use Win32::GUI::BitmapInline();
my @directions = qw(tlbr tb trbl rl brtl bt bltr lr);
my $ico = arrow_icon();
my $mw = Win32::GUI::Window->new(
-title => "Animation Demo",
-left => CW_USEDEFAULT,
-size => [180,280],
);
my $aw = Win32::GUI::Window->new(
-title => "Animated Window",
-left => CW_USEDEFAULT,
-size => [400,300],
-toolwindow => 1,
-onTerminate => sub { do_animation(); 0; },
);
$mw->AddTextfield(
-name => 'time',
-text => 200,
-prompt => [ "Animation time:", 80 ],
-pos => [10,10],
-size => [45,20],
-align => 'right',
-number => 1,
);
$mw->AddLabel(
-text => "ms",
-left => $mw->time->Left() + $mw->time->Width() + 5,
-top => $mw->time_Prompt->Top(),
);
$mw->AddCombobox(
-name => 'animation',
-dropdownlist => 1,
-left => $mw->time->Left(),
-top => $mw->time->Top() + $mw->time->Height() + 10,
-width => 60,
-height => 100,
);
$mw->animation->Add('roll', 'slide', 'blend', 'center');
$mw->animation->Select(0);
$mw->AddLabel(
-text => "Animation Type:",
-left => $mw->time_Prompt->Left(),
-top => $mw->animation->Top() + 3,
);
my $size = 15;
my $dim = 100;
my $left = 25;
my $top = $mw->animation->Top() + $mw->animation->Height() + 20;
$mw->AddLabel(
-pos => [$left+$size+3, $top+$size+3],
-size => [80,80],
-icon => $ico,
);
$mw->AddRadioButton(
-name => $directions[0],
-pos => [$left, $top],
-size => [$size,$size],
);
$mw->AddRadioButton(
-name => $directions[1],
-pos => [$left+($dim/2), $top],
-size => [$size,$size],
);
$mw->AddRadioButton(
-name => $directions[2],
-pos => [$left+$dim, $top],
-size => [$size,$size],
);
$mw->AddRadioButton(
-name => $directions[3],
-pos => [$left+$dim, $top+($dim/2)],
-size => [$size,$size],
);
$mw->AddRadioButton(
-name => $directions[4],
-pos => [$left+$dim, $top+$dim],
-size => [$size,$size],
);
$mw->AddRadioButton(
-name => $directions[5],
-pos => [$left+($dim/2), $top+$dim],
-size => [$size,$size],
);
$mw->AddRadioButton(
-name => $directions[6],
-pos => [$left, $top+$dim],
-size => [$size,$size],
);
$mw->AddRadioButton(
-name => $directions[7],
-pos => [$left, $top+($dim/2)],
-size => [$size,$size],
);
$mw->{$directions[7]}->Checked(1);
$mw->AddButton(
-text => "Show/Hide",
-left => $mw->Width() - 90,
-top => $mw->Height() - 60,
-onClick => \&do_animation,
);
$mw->Show();
Win32::GUI::Dialog();
$mw->Hide();
undef $mw;
exit(0);
sub do_animation {
my $d;
for (@directions) {
$d = $_,last if $mw->{$_}->Checked();
}
$aw->Animate(
-show => !$aw->IsVisible(),
-activate => 1,
-animation => $mw->animation->Text(),
-direction => $d,
-time => $mw->time->Text(),
);
}
sub arrow_icon { newIcon Win32::GUI::BitmapInline( q(
AAABAAEAUFAQAAEABACoEAAAFgAAACgAAABQoAEABEgAAABIEAAA
AACAAACAgIAAgIAAgACAgAAAwMDAAICAgP8AAP8AAAD//wD/
/wD/AP//AAD///8A
[Perl-win32-gui-cvscommit] Win32-GUI GUI.h,1.28,1.29
Update of /cvsroot/perl-win32-gui/Win32-GUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27159 Modified Files: GUI.h Log Message: Add WINVER definition (need for MinGW) Index: GUI.h === RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.h,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** GUI.h 14 Apr 2006 01:52:25 - 1.28 --- GUI.h 24 Jun 2006 13:33:30 - 1.29 *** *** 10,13 --- 10,16 #define _WIN32_IE 0x0501 // #define _WIN32_WINNT 0x0400 + /* If WINVER is not defined, the latest MS headers define it as 0x501, + * but MinGW headers don't, so set it here */ + #define WINVER 0x501 #undef NOTRACKMOUSEEVENT #include
[Perl-win32-gui-cvscommit] Win32-GUI CHANGELOG, 1.89, 1.90 DC.xs, 1.13, 1.14
Update of /cvsroot/perl-win32-gui/Win32-GUI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30145
Modified Files:
CHANGELOG DC.xs
Log Message:
ExtCreateRgn and GetRgnData
Index: DC.xs
===
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/DC.xs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DC.xs 13 Apr 2006 22:17:07 - 1.13
--- DC.xs 24 Jun 2006 14:53:13 - 1.14
***
*** 1697,1700
--- 1697,1758
###
+ # (@)METHOD:ExtCreateRgn (RGNDATA)
+ #
+ # The ExtCreateRgn function creates a region from data held in memory.
The
+ # data is a win32 RGNDATA structure (See MSDN) that can be created by
packing
+ # the bytes by hand, or more easily by using the
L
+ # method.
+ #
+ # my $rgn = Win32::GUI::Region->CreateRoundRectRgn(0,0,100,100,50,50);
+ # my $rgndata = $rgn->GetRgnData();
+ # my $newrgn = Win32::GUI::Region->ExtCreateRgn($rgndata);
+ #
+ # Returns a Win32::GUI::Region object on success or undef on failure
+ void
+ ExtCreateRgn(Class="Win32::GUI::Region", svrgndata)
+ char *Class
+ SV *svrgndata
+ PREINIT:
+ HRGN hrgn;
+ LPRGNDATA rgndata;
+ STRLEN len;
+ PPCODE:
+ rgndata = (LPRGNDATA)SvPV(svrgndata, len);
+ /* TODO: XFORM transformation as first param? */
+ hrgn = ExtCreateRegion(NULL, (DWORD)len, rgndata);
+ if (hrgn== NULL) XSRETURN_UNDEF;
+ XPUSHs(CreateObjectWithHandle(NOTXSCALL "Win32::GUI::Region", (HWND)
hrgn));
+
+
###
+ # (@)METHOD:GetRgnData ()
+ #
+ # The GetRgnData functions returns a representation of the region as a
string
+ # of bytes that can be used to re-create an identical region using the
+ # L method.
+ #
+ # Returns a string of bytes on success or undef on failure
+ void
+ GetRgnData(handle)
+ HRGN handle
+ PREINIT:
+ SV *svrgndata;
+ STRLEN len1, len2;
+ PPCODE:
+ len1 = (STRLEN)GetRegionData(handle, 0, NULL);
+ svrgndata = sv_2mortal(newSV(len1));
+ SvPOK_on(svrgndata);
+ SvCUR_set(svrgndata,len1);
+ len2 = (STRLEN)GetRegionData(handle, (DWORD)len1,
(LPRGNDATA)SvPV_nolen(svrgndata));
+
+ if(len1 == len2) { /* success */
+ XPUSHs(svrgndata);
+ XSRETURN(1);
+ }
+ else { /* failure */
+ XSRETURN_UNDEF;
+ }
+
+
+
###
# (@)METHOD:CombineRgn (source1,source2,CombineMode)
# The CombineRgn method combines two regions. The two regions are
combined according to the
***
*** 1714,1718
# COMPLEXREGION (3) The region is more than a single rectangle.
# ERROR No (0) region is created.
-
int CombineRgn(destination,source1,source2,CombineMode)
HRGN destination
--- 1772,1775
Index: CHANGELOG
===
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/CHANGELOG,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** CHANGELOG 23 Jun 2006 23:08:07 - 1.89
--- CHANGELOG 24 Jun 2006 14:53:12 - 1.90
***
*** 6,9
--- 6,13
Win32-GUI ChangeLog
===
+ + [Robert May] : 24 June 2006 - ExtCreateRgn and GetRgnData
+ - DC.xs - added new region construction ExtCreateRgn and
+ new region method GetRgnData (Tracker: 1469648)
+
+ [Robert May] : 23 June 2006 - -wantreturn and AnimateWindow
- GUI.pm, Textfield.xs - add -wantreturn option to constructor

