You can subscribe to this list here.
2001 |
Jan
(226) |
Feb
(139) |
Mar
(156) |
Apr
(95) |
May
(181) |
Jun
(166) |
Jul
(80) |
Aug
(59) |
Sep
(69) |
Oct
(83) |
Nov
(142) |
Dec
(33) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(42) |
Feb
(91) |
Mar
(76) |
Apr
(113) |
May
(67) |
Jun
(68) |
Jul
(37) |
Aug
(41) |
Sep
(16) |
Oct
(135) |
Nov
(51) |
Dec
(21) |
2003 |
Jan
(37) |
Feb
(36) |
Mar
(37) |
Apr
(103) |
May
(68) |
Jun
(70) |
Jul
(77) |
Aug
(12) |
Sep
(9) |
Oct
(53) |
Nov
(88) |
Dec
(63) |
2004 |
Jan
(263) |
Feb
(106) |
Mar
(36) |
Apr
(21) |
May
(21) |
Jun
(34) |
Jul
(33) |
Aug
(34) |
Sep
(35) |
Oct
(21) |
Nov
(43) |
Dec
(63) |
2005 |
Jan
(28) |
Feb
(42) |
Mar
(29) |
Apr
(14) |
May
(41) |
Jun
(20) |
Jul
(65) |
Aug
(136) |
Sep
(41) |
Oct
(74) |
Nov
(34) |
Dec
(94) |
2006 |
Jan
(85) |
Feb
(94) |
Mar
(68) |
Apr
(103) |
May
(66) |
Jun
(51) |
Jul
(24) |
Aug
(56) |
Sep
(57) |
Oct
(85) |
Nov
(73) |
Dec
(68) |
2007 |
Jan
(59) |
Feb
(32) |
Mar
(13) |
Apr
(32) |
May
(36) |
Jun
(36) |
Jul
(64) |
Aug
(35) |
Sep
(19) |
Oct
(10) |
Nov
(13) |
Dec
(20) |
2008 |
Jan
(26) |
Feb
(41) |
Mar
(19) |
Apr
(24) |
May
(16) |
Jun
(33) |
Jul
(34) |
Aug
(4) |
Sep
(11) |
Oct
|
Nov
(26) |
Dec
(23) |
2009 |
Jan
(5) |
Feb
(2) |
Mar
(21) |
Apr
(16) |
May
(13) |
Jun
(6) |
Jul
(34) |
Aug
(2) |
Sep
(1) |
Oct
(7) |
Nov
(5) |
Dec
(24) |
2010 |
Jan
(3) |
Feb
(5) |
Mar
(6) |
Apr
(6) |
May
(14) |
Jun
(6) |
Jul
(1) |
Aug
(12) |
Sep
(10) |
Oct
(9) |
Nov
|
Dec
(2) |
2011 |
Jan
(4) |
Feb
(5) |
Mar
(30) |
Apr
(1) |
May
(2) |
Jun
(5) |
Jul
(3) |
Aug
(2) |
Sep
(3) |
Oct
|
Nov
(6) |
Dec
|
2012 |
Jan
|
Feb
(10) |
Mar
|
Apr
|
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
|
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(4) |
2013 |
Jan
(5) |
Feb
(3) |
Mar
|
Apr
(3) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
(7) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(5) |
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Sean H. <jal...@ho...> - 2008-07-18 22:26:02
|
> For some reason, I could not load SPI_GETWORKAREA via > Win32::GUI::Constants. > I don't know why. The numeric value of SPI_GETWORKAREA is 48. So My guess is that it's simply not one of the constants included because the function it's intended for is not yet ported to Win32::GUI. > Thanks for pointing me in the right direction, Sean. Glad I could help. |
From: Roode, E. <er...@ba...> - 2008-07-18 19:09:37
|
> On 17 July 2008, Sean Healy wrote: > [Eric Roode wrote:] > > > > How can I start my programs at the leftmost part of the usable desktop? > > How can I ensure that my programs behave sanely with respect to users' > > taskbar configuration? > > MSDN lists a function called SystemParametersInfo(), but it doesn't > seem to be available yet in Win32::GUI. (Does anyone know > differently?) > > If it's really important to you, you can look up this function at > www.msdn.com and then try Win32::API. You will probably also need to > search online for winuser.h to find the values for the constants you > want. > > I've done this before to get functions that Win32::GUI doesn't yet > provide. (In particular, I wrote something to determine the default > icon for a file type and extract it so it could be used in a > listview.) It can be time-consuming, but if you really want it, it's > usually possible with Win32::API. Thanks, Sean, this did work for me. I found that you can pass SPI_GETWORKAREA to SystemParametersInfo, to get a Rect that contains the coordinates of the usable desktop area. For some reason, I could not load SPI_GETWORKAREA via Win32::GUI::Constants. I don't know why. The numeric value of SPI_GETWORKAREA is 48. So here is the code I came up with: ================ use Win32::GUI(); use Win32::API; Win32::API::Struct->typedef(RECT => qw{LONG x; LONG y; LONG w; LONG h;}); my $rect = Win32::API::Struct->new('RECT'); my $spi = Win32::API->new( 'user32', 'BOOL SystemParametersInfo(UINT uiAction, UINT uiParam, LPRECT pvParam, UINT fWinIni)' ); $spi->Call(48, 0, $rect, 0); say "(x,y)=($rect->{x},$rect->{y}); (w,h)=($rect->{w},$rect->{h})"; ================ Thanks for pointing me in the right direction, Sean. -- Eric |
From: Roode, E. <er...@ba...> - 2008-07-18 18:32:09
|
On 18 July 2008, Robert May wrote: > >2008/7/18 Roode, Eric <er...@ba...>: >> On 17 July 2008, Sean Healy wrote: >>> ($x, $y) = $Label->GetTextExtentPoint32($string); >> >> Upon further experimentation, there is something not quite right with >> that. The width it returns is too wide. There seems to be some sort >> of per-character skew -- short strings are very accurate; longer >> strings get progressively worse. > >The Win32::GUI GetTextExtentPoint32(...) implementation uses the >default system font sizing if you don't tell it what font to use. I >think this is not as expected (or intended). > >Try this instead as a work around: >my ($x, $y) = $Label->GetTextExtentPoint32( $string, $Label->GetFont() ); Thanks, Rob! That worked perfectly. At least in the fonts I tried. >It would be much appreciated if you could raise a bug report for >this, as if called as a method against a window without a font >specified then I think the implementation should use the window's >current font. Sure, I can do that. No prob. -- Eric |
From: Robert M. <rob...@us...> - 2008-07-18 14:11:27
|
2008/7/18 Roode, Eric <er...@ba...>: > > On 17 July 2008, Sean Healy wrote: >> >> ($x, $y) = $Label->GetTextExtentPoint32($string); > > Upon further experimentation, there is something not quite right with > that. The width it returns is too wide. There seems to be some sort > of per-character skew -- short strings are very accurate; longer > strings get progressively worse. The Win32::GUI GetTextExtentPoint32(...) implementation uses the default system font sizing if you don't tell it what font to use. I think this is not as expected (or intended). Try this instead as a work around: my ($x, $y) = $Label->GetTextExtentPoint32( $string, $Label->GetFont() ); It would be much appreciated if you could raise a bug report for this, as if called as a method against a window without a font specified then I think the implementation should use the window's current font. Regards, Rob. |
From: Sean H. <jal...@ho...> - 2008-07-18 13:55:57
|
>> ($x, $y) = $Label->GetTextExtentPoint32($string); > > Upon further experimentation, there is something not quite right with > that. The width it returns is too wide. There seems to be some sort > of per-character skew -- short strings are very accurate; longer > strings get progressively worse. <snip> > Why do the longer fields have a large error in the computed width? My guess is that it has to do with kerning. Try it with a monospace font (or other non-kerning font) and see you still have the problem. If you don't, there's nothing we can do about it, because the problem is in Microsoft code, not Win32::GUI code. If you're not familiar with kerning, look here: http://en.wikipedia.org/wiki/Kerning From MSDN: The GetTextExtentPoint32 function uses the currently selected font to compute the dimensions of the string. The width and height, in logical units, are computed without considering any clipping. Because some devices kern characters, the sum of the extents of the characters in a string may not be equal to the extent of the string. |
From: Roode, E. <er...@ba...> - 2008-07-18 12:46:27
|
On 17 July 2008, Sean Healy wrote: > > ($x, $y) = $Label->GetTextExtentPoint32($string); Upon further experimentation, there is something not quite right with that. The width it returns is too wide. There seems to be some sort of per-character skew -- short strings are very accurate; longer strings get progressively worse. Here is a sample program to demonstrate the problem. I have attached a screenshot of the resulting output. use strict; use warnings; use Win32::GUI(); my $main = Win32::GUI::Window->new (-name => 'Main', -width => 300, -height => 150); my $top = 0; for my $str ('', 'A', 'AAAAA', 'This is a test') { # Demonstrate the width as computed my $demo = $main->AddLabel(-text => 'dummy', -top => $top, -left => 150, -background => 0xFF80FF); my ($w, $h) = $demo->GetTextExtentPoint32($str); $demo->Text($str); $demo->Width($w); # Label the demo output my $info = $main->AddLabel(-text => "'$str' => w=$w", -top => $top, -left => 0); $top += $info->Height; } $main->Show; Win32::GUI::Dialog; exit; sub Main_Terminate { -1; } Why do the longer fields have a large error in the computed width? Thanks, Eric |
From: Ilya B. <Ily...@so...> - 2008-07-18 12:00:17
|
Hello! As I see in archives, this problem was raised some time ago but with no any solution. Does somebody found the way how to deal with "tabstrip" controls under Windows XP when it has XP style turned on? The problem is when I compile my app with PerlApp it obeys Windows XP styles and shows tabstips with white background. In the same time all elements placed within the tabstip (like texfields, labels, etc) still have default gray background which looks just awful. Is there a way to avoid this behavior correctly? I'll appreciate any ideas. Best regards, Ilya ========================================================= Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et susceptibles de contenir des informations couvertes par le secret professionnel. Ce message est etabli a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee interdite. Tout message electronique est susceptible d'alteration. La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme falsifie. ========================================================= This message and any attachments (the "message") are confidential, intended solely for the addressees, and may contain legally privilegedxi information. Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration. Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. ========================================================= |
From: Roode, E. <er...@ba...> - 2008-07-17 21:16:26
|
> >> How do I compute the size (amount of screen real-estate) that a given >> chunk of text will be, in a given font? >> >> The reason I ask is that I am trying to change the text of a label, >> and using the Text or Change methods do not resize the control; the >> control stays at its original size and truncates any new text. (This >> behavior is very annoying!). > >($x, $y) = $Label->GetTextExtentPoint32($string); > Fantastic, thank you! Eric |
From: Roode, E. <er...@ba...> - 2008-07-17 21:11:57
|
I have the taskbar docked along the left side of the desktop. When I start Win32::GUI programs that do not explicitly position their main window, the main window generally starts way over on the left side of the screen, obscured by the taskbar. I then have to move it to the right in order to use it. This seems clunky and unfriendly. I have also noticed that many programs (perl or not) do not behave nicely when the taskbar is at the bottom of the screen and is more than one row tall. How can I start my programs at the leftmost part of the usable desktop? How can I ensure that my programs behave sanely with respect to users' taskbar configuration? Thanks, Eric |
From: Sean H. <jal...@ho...> - 2008-07-17 20:53:42
|
> How do I compute the size (amount of screen real-estate) that a given > chunk of text will be, in a given font? > > The reason I ask is that I am trying to change the text of a label, and > using the Text or Change methods do not resize the control; the control > stays at its original size and truncates any new text. (This behavior is > very annoying!). ($x, $y) = $Label->GetTextExtentPoint32($string); |
From: Roode, E. <er...@ba...> - 2008-07-17 19:00:30
|
How do I compute the size (amount of screen real-estate) that a given chunk of text will be, in a given font? The reason I ask is that I am trying to change the text of a label, and using the Text or Change methods do not resize the control; the control stays at its original size and truncates any new text. (This behavior is very annoying!). Here is an example: my $main = Win32::GUI::Window->new (-name => 'Main', -width => 300, -height => 150); my $label = $main->AddLabel (-text => 'foo'); $label->Text('Much longer now'); $main->Show; Win32::GUI::Dialog; What displays is "Mu", because that's all that can fit in the space where "foo" was. Is there a way to make a Label auto-resize? Thanks in advance, Eric |
From: Steve L. <sl...@se...> - 2008-07-10 22:31:21
|
I am trying to capture the notify event in a Win32::GUI application when I load a file using winmm and mciSendStringA. According to Microsoft I can pass in a notify flag so that it will post an MM_MCINOTIFY message when the device completes an action. http://msdn.microsoft.com/en-us/library/ms713401(VS.85).aspx How can I capture that event with Win32::GUI::Dialog? Is is like a Terminate event? sub MainWindow_Terminate{...} I tried sub MainWindow_MM_MCINOTIFY{...} but it did not work. I have also tried Hook but that did not work either: my $MM_MCINOTIFY = 953; $mainwindow->Hook($MM_MCINOTIFY, \&mciNotify); ######################### sub mciNotify{ print "mciNotify: @_\r\n"; return 1; } Thanks for any pointers. |
From: Jan D. <ja...@ac...> - 2008-07-09 20:42:06
|
On Sat, 05 Jul 2008, Octavian Rasnita wrote: > Can you please tell me where from I can get Win32::GUI 1.06? > > I have the Theoryx repository set in ppm, but the latest available > version is 1.03 there. I have also tried to compile Win32::GUI using > the cpan shell (I have VS6) but as usually, it gave some compiling > errors that I don't know how to solve. You can download Win32::GUI 1.06 for both 5.8 and 5.10 from the new beta PPM repositories: http://ppm.activestate.com/beta/ These repositories are still beta, so please report any problems with them to the ppm mailing list, or to ActiveState support. Cheers, -Jan |
From: glass <gla...@ya...> - 2008-07-06 09:52:15
|
thanks for this rpnoble - i was looking for an example a long time ago. appreciate your sharing. rpnoble wrote: > > This is my response to a query on perlmonks. It loads the default Adobe > Acrobat ActiveX viewer in a Win32::GUI window via a file open menu. I used > the Notepad.pl and GetOpenFileName.pl files for my base app. > > #!perl -w > > use strict; > use warnings; > use Win32::GUI 1.06 qw(CW_USEDEFAULT); > use Win32::GUI::AxWindow; > > # Define the application menu > my @menu_defn = ( > "File" => "File", > ">OpenPDf" => { -name => "OpenPDF", -onClick => \&OpenPDF}, > ">Exit" => { -name => "Exit", -onClick => \&QuitFile }, > ); > > my $menu = Win32::GUI::Menu->new(@menu_defn); > > > #Define the application window > my $mw = Win32::GUI::Window->new( > -title => "Open PDF File", > -size => [400,400], > -left => CW_USEDEFAULT, > -menu => $menu, > -onResize => \&resize, > -onTerminate => \&QuitFile, > ); > > # Add a Acrobat AxtiveX control > my $PDFControl = new Win32::GUI::AxWindow ( > -parent => $mw, > -name => "PDFControl", > -control => "AcroPDF.PDF.1", > -pos => [0, 0], > -size => [400, 400], > ); > > #Show application window > $mw->Show(); > > #Enter event loop > Win32::GUI::Dialog(); > > #Hide windows on exit > $mw->Hide(); > undef $mw; > exit(0); > > > #Open standard windows file open dialog box > sub OpenPDF { > my ( @file, $file ); > my ( @parms ); > push @parms, > -filter => > [ 'PDF - Adobe Acrobat File', '*.pdf', > ], > -directory => "c:\\", > -title => 'Select a PDF file'; > @file = Win32::GUI::GetOpenFileName ( @parms ); > # print "PDF File: $file[ 0 ]\n"; > > # Call Acorbat LoadFile Method > $PDFControl->CallMethod("LoadFile", $file[ 0 ]); > > return 0; > } > > #resize to fit user input > sub resize { > my ($self) = @_; > my ($width, $height) = ($self->GetClientRect())[2..3]; > $self->PDFControl->Resize($width+1, $height+1) if exists > $self->{PDFControl}; > } > > > #Exit the application > sub QuitFile { > > my $self = shift; > > #Set the Acrobat control to nothing > $PDFControl->CallMethod("LoadFile", ""); > > #This line is needed to keep the PERL interperter from crashing > $PDFControl->Release(); > > return -1; > } > > -- View this message in context: http://www.nabble.com/Sample-Application-to-load-Adobe-Acrobat-ActiveX-control-tp18294501p18300419.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: Jeremy W. <jez...@ho...> - 2008-07-06 07:47:33
|
you can also use sourceforge: http://sourceforge.net/project/showfiles.php?group_id=16572 > From: wb...@sa... > To: win...@we... > Date: Sat, 5 Jul 2008 22:28:35 +0200 > CC: per...@li... > Subject: Re: [perl-win32-gui-users] Perl-Win32-GUI-Users Digest, Vol 26, Issue 2 > > Thank you E. Westbrook! > > It works perfectly. > > Waldemar > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ _________________________________________________________________ Play and win great prizes with Live Search and Kung Fu Panda http://clk.atdmt.com/UKM/go/101719966/direct/01/ |
From: Waldemar B. <wb...@sa...> - 2008-07-05 20:28:36
|
Thank you E. Westbrook! It works perfectly. Waldemar |
From: rpnoble <rp...@ib...> - 2008-07-05 19:11:17
|
I use the following PPM http://www.bribes.org/perl/ppmdir.html Octavian Rasnita-2 wrote: > > Hi, > > Can you please tell me where from I can get Win32::GUI 1.06? > > I have the Theoryx repository set in ppm, but the latest available version > is 1.03 there. > I have also tried to compile Win32::GUI using the cpan shell (I have VS6) > but as usually, it gave some compiling errors that I don't know how to > solve. > > Thank you. > > Octavian > > ----- Original Message ----- > From: "rpnoble" <rp...@ib...> > To: <per...@li...> > Sent: Saturday, July 05, 2008 8:40 PM > Subject: [perl-win32-gui-users] Sample Application to load Adobe Acrobat > ActiveX control > > >> >> This is my response to a query on perlmonks. It loads the default Adobe >> Acrobat ActiveX viewer in a Win32::GUI window via a file open menu. I >> used >> the Notepad.pl and GetOpenFileName.pl files for my base app. >> >> #!perl -w >> >> use strict; >> use warnings; >> use Win32::GUI 1.06 qw(CW_USEDEFAULT); >> use Win32::GUI::AxWindow; >> >> # Define the application menu >> my @menu_defn = ( >> "File" => "File", >> ">OpenPDf" => { -name => "OpenPDF", -onClick => \&OpenPDF}, >> ">Exit" => { -name => "Exit", -onClick => \&QuitFile }, >> ); >> >> my $menu = Win32::GUI::Menu->new(@menu_defn); >> >> >> #Define the application window >> my $mw = Win32::GUI::Window->new( >> -title => "Open PDF File", >> -size => [400,400], >> -left => CW_USEDEFAULT, >> -menu => $menu, >> -onResize => \&resize, >> -onTerminate => \&QuitFile, >> ); >> >> # Add a Acrobat AxtiveX control >> my $PDFControl = new Win32::GUI::AxWindow ( >> -parent => $mw, >> -name => "PDFControl", >> -control => "AcroPDF.PDF.1", >> -pos => [0, 0], >> -size => [400, 400], >> ); >> >> #Show application window >> $mw->Show(); >> >> #Enter event loop >> Win32::GUI::Dialog(); >> >> #Hide windows on exit >> $mw->Hide(); >> undef $mw; >> exit(0); >> >> >> #Open standard windows file open dialog box >> sub OpenPDF { >> my ( @file, $file ); >> my ( @parms ); >> push @parms, >> -filter => >> [ 'PDF - Adobe Acrobat File', '*.pdf', >> ], >> -directory => "c:\\", >> -title => 'Select a PDF file'; >> @file = Win32::GUI::GetOpenFileName ( @parms ); >> # print "PDF File: $file[ 0 ]\n"; >> >> # Call Acorbat LoadFile Method >> $PDFControl->CallMethod("LoadFile", $file[ 0 ]); >> >> return 0; >> } >> >> #resize to fit user input >> sub resize { >> my ($self) = @_; >> my ($width, $height) = ($self->GetClientRect())[2..3]; >> $self->PDFControl->Resize($width+1, $height+1) if exists >> $self->{PDFControl}; >> } >> >> >> #Exit the application >> sub QuitFile { >> >> my $self = shift; >> >> #Set the Acrobat control to nothing >> $PDFControl->CallMethod("LoadFile", ""); >> >> #This line is needed to keep the PERL interperter from crashing >> $PDFControl->Release(); >> >> return -1; >> } >> >> -- >> View this message in context: >> http://www.nabble.com/Sample-Application-to-load-Adobe-Acrobat-ActiveX-control-tp18294501p18294501.html >> Sent from the perl-win32-gui-users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! >> Studies have shown that voting for your favorite open source project, >> along with a healthy diet, reduces your potential for chronic lameness >> and boredom. Vote Now at http://www.sourceforge.net/community/cca08 >> _______________________________________________ >> Perl-Win32-GUI-Users mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users >> http://perl-win32-gui.sourceforge.net/ > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > -- View this message in context: http://www.nabble.com/Sample-Application-to-load-Adobe-Acrobat-ActiveX-control-tp18294501p18295305.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: Octavian R. <ora...@gm...> - 2008-07-05 18:57:10
|
Hi, Can you please tell me where from I can get Win32::GUI 1.06? I have the Theoryx repository set in ppm, but the latest available version is 1.03 there. I have also tried to compile Win32::GUI using the cpan shell (I have VS6) but as usually, it gave some compiling errors that I don't know how to solve. Thank you. Octavian ----- Original Message ----- From: "rpnoble" <rp...@ib...> To: <per...@li...> Sent: Saturday, July 05, 2008 8:40 PM Subject: [perl-win32-gui-users] Sample Application to load Adobe Acrobat ActiveX control > > This is my response to a query on perlmonks. It loads the default Adobe > Acrobat ActiveX viewer in a Win32::GUI window via a file open menu. I used > the Notepad.pl and GetOpenFileName.pl files for my base app. > > #!perl -w > > use strict; > use warnings; > use Win32::GUI 1.06 qw(CW_USEDEFAULT); > use Win32::GUI::AxWindow; > > # Define the application menu > my @menu_defn = ( > "File" => "File", > ">OpenPDf" => { -name => "OpenPDF", -onClick => \&OpenPDF}, > ">Exit" => { -name => "Exit", -onClick => \&QuitFile }, > ); > > my $menu = Win32::GUI::Menu->new(@menu_defn); > > > #Define the application window > my $mw = Win32::GUI::Window->new( > -title => "Open PDF File", > -size => [400,400], > -left => CW_USEDEFAULT, > -menu => $menu, > -onResize => \&resize, > -onTerminate => \&QuitFile, > ); > > # Add a Acrobat AxtiveX control > my $PDFControl = new Win32::GUI::AxWindow ( > -parent => $mw, > -name => "PDFControl", > -control => "AcroPDF.PDF.1", > -pos => [0, 0], > -size => [400, 400], > ); > > #Show application window > $mw->Show(); > > #Enter event loop > Win32::GUI::Dialog(); > > #Hide windows on exit > $mw->Hide(); > undef $mw; > exit(0); > > > #Open standard windows file open dialog box > sub OpenPDF { > my ( @file, $file ); > my ( @parms ); > push @parms, > -filter => > [ 'PDF - Adobe Acrobat File', '*.pdf', > ], > -directory => "c:\\", > -title => 'Select a PDF file'; > @file = Win32::GUI::GetOpenFileName ( @parms ); > # print "PDF File: $file[ 0 ]\n"; > > # Call Acorbat LoadFile Method > $PDFControl->CallMethod("LoadFile", $file[ 0 ]); > > return 0; > } > > #resize to fit user input > sub resize { > my ($self) = @_; > my ($width, $height) = ($self->GetClientRect())[2..3]; > $self->PDFControl->Resize($width+1, $height+1) if exists > $self->{PDFControl}; > } > > > #Exit the application > sub QuitFile { > > my $self = shift; > > #Set the Acrobat control to nothing > $PDFControl->CallMethod("LoadFile", ""); > > #This line is needed to keep the PERL interperter from crashing > $PDFControl->Release(); > > return -1; > } > > -- > View this message in context: > http://www.nabble.com/Sample-Application-to-load-Adobe-Acrobat-ActiveX-control-tp18294501p18294501.html > Sent from the perl-win32-gui-users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ |
From: rpnoble <rp...@ib...> - 2008-07-05 17:40:21
|
This is my response to a query on perlmonks. It loads the default Adobe Acrobat ActiveX viewer in a Win32::GUI window via a file open menu. I used the Notepad.pl and GetOpenFileName.pl files for my base app. #!perl -w use strict; use warnings; use Win32::GUI 1.06 qw(CW_USEDEFAULT); use Win32::GUI::AxWindow; # Define the application menu my @menu_defn = ( "File" => "File", ">OpenPDf" => { -name => "OpenPDF", -onClick => \&OpenPDF}, ">Exit" => { -name => "Exit", -onClick => \&QuitFile }, ); my $menu = Win32::GUI::Menu->new(@menu_defn); #Define the application window my $mw = Win32::GUI::Window->new( -title => "Open PDF File", -size => [400,400], -left => CW_USEDEFAULT, -menu => $menu, -onResize => \&resize, -onTerminate => \&QuitFile, ); # Add a Acrobat AxtiveX control my $PDFControl = new Win32::GUI::AxWindow ( -parent => $mw, -name => "PDFControl", -control => "AcroPDF.PDF.1", -pos => [0, 0], -size => [400, 400], ); #Show application window $mw->Show(); #Enter event loop Win32::GUI::Dialog(); #Hide windows on exit $mw->Hide(); undef $mw; exit(0); #Open standard windows file open dialog box sub OpenPDF { my ( @file, $file ); my ( @parms ); push @parms, -filter => [ 'PDF - Adobe Acrobat File', '*.pdf', ], -directory => "c:\\", -title => 'Select a PDF file'; @file = Win32::GUI::GetOpenFileName ( @parms ); # print "PDF File: $file[ 0 ]\n"; # Call Acorbat LoadFile Method $PDFControl->CallMethod("LoadFile", $file[ 0 ]); return 0; } #resize to fit user input sub resize { my ($self) = @_; my ($width, $height) = ($self->GetClientRect())[2..3]; $self->PDFControl->Resize($width+1, $height+1) if exists $self->{PDFControl}; } #Exit the application sub QuitFile { my $self = shift; #Set the Acrobat control to nothing $PDFControl->CallMethod("LoadFile", ""); #This line is needed to keep the PERL interperter from crashing $PDFControl->Release(); return -1; } -- View this message in context: http://www.nabble.com/Sample-Application-to-load-Adobe-Acrobat-ActiveX-control-tp18294501p18294501.html Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: E. W. <win...@we...> - 2008-07-02 22:58:39
|
Good timing. I just went through getting that to work. This code fragment might help you, it's straight from my app. Your mileage (and options and variables and etc) may vary. This isn't a complete app obviously, but I think this is all that's relevant to wheel scrolling. The $dy global is how much to scroll on each well detente, and $lastscrollpos is a global for holding the last position. I hope the rest is self-explanatory. Season to taste. use Win32::GUI qw(WM_MOUSEWHEEL); my $scrollapi = new Win32::API('user32', 'ScrollWindow', ['N', 'I', 'I', 'P', 'P'], 'N') or die "Can't load ScrollWindow API"; my $main = Win32::GUI::Window->new(-name => "Main" , -text => "Main Window" , -size => [$main_w, $main_h] , -hasmaximize => 0 , -dialogui => 1 , -onTerminate => \&terminatemain); $main->Hook(WM_MOUSEWHEEL, \&domousewheel); $main->Show(); my $scrollwindow = Win32::GUI::Window->new(-name =>"scrollwindow" , -parent => $main , -pos => [$sw_x, $sw_y] , -size => [$sw_h, $sw_w] , -dialogui => 1 , -tabstop => 1 , -vscroll => 1 , -titlebar => 0 , -sizeable => 0 , -controlparent => 1 , -pushstyle => WS_CHILD , -pushstyle => WS_VSCROLL , -popstyle => WS_THICKFRAME , -onScroll => \&doscroll); $scrollwindow->Hook(WM_MOUSEWHEEL, \&domousewheel); $scrollwindow->Show(); # create whatever controls or subwindows go inside the scrolling area here, as children of $scrollwindow sub domousewheel { my ($object, $wParam, $lParam, $type, $msgcode) = @_; my $distance = makesignedshort(($wParam & 0xFFFF0000) >> 16); my $buttons = makesignedshort($wParam & 0x0000FFFF); my $y =makesignedshort(($lParam & 0xFFFF0000) >> 16); my $x = makesignedshort($lParam & 0x0000FFFF); my $isdropped = $object->SendMessage(CB_GETDROPPEDSTATE, 0, 0); return 1 if $isdropped; if (0 < $distance) { scrollmebro(-(2*$dy), 0); } elsif (0 > $distance) { scrollmebro(2*$dy, 0); } return 0; } sub scrollmebro { my ($offset, $newpos) = @_; my $curpos = $scrollwindow->ScrollPos(SB_VERT); my ($min, $max) = $scrollwindow->ScrollRange(SB_VERT); my $pos; if ($offset) { $pos = $curpos + $offset; } elsif ($newpos) { $pos = $newpos; } if (defined $pos) { $pos = 0 if 0 > $pos; $pos = $max if $max < $pos; $scrollwindow->ScrollPos(SB_VERT, $pos); my $deltapos = $lastscrollpos - $pos; $scrollapi->Call($scrollwindow->{-handle}, 0, $deltapos, 0, 0); $lastscrollpos = $pos; } } Waldemar Biernacki wrote: > Hey everybode! > > Do you know whether mouse scrolling button is implemented in Win32::GUI and how? > > > Waldemar > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |
From: E. W. <win...@li...> - 2008-07-02 22:57:30
|
Good timing. I just went through getting that to work. This code fragment might help you, it's straight from my app. Your mileage (and options and variables and etc) may vary. This isn't a complete app obviously, but I think this is all that's relevant to wheel scrolling. The $dy global is how much to scroll on each well detente, and $lastscrollpos is a global for holding the last position. I hope the rest is self-explanatory. Season to taste. use Win32::GUI qw(WM_MOUSEWHEEL); my $scrollapi = new Win32::API('user32', 'ScrollWindow', ['N', 'I', 'I', 'P', 'P'], 'N') or die "Can't load ScrollWindow API"; my $main = Win32::GUI::Window->new(-name => "Main" , -text => "Main Window" , -size => [$main_w, $main_h] , -hasmaximize => 0 , -dialogui => 1 , -onTerminate => \&terminatemain); $main->Hook(WM_MOUSEWHEEL, \&domousewheel); $main->Show(); my $scrollwindow = Win32::GUI::Window->new(-name =>"scrollwindow" , -parent => $main , -pos => [$sw_x, $sw_y] , -size => [$sw_h, $sw_w] , -dialogui => 1 , -tabstop => 1 , -vscroll => 1 , -titlebar => 0 , -sizeable => 0 , -controlparent => 1 , -pushstyle => WS_CHILD , -pushstyle => WS_VSCROLL , -popstyle => WS_THICKFRAME , -onScroll => \&doscroll); $scrollwindow->Hook(WM_MOUSEWHEEL, \&domousewheel); $scrollwindow->Show(); # create whatever controls or subwindows go inside the scrolling area here, as children of $scrollwindow sub domousewheel { my ($object, $wParam, $lParam, $type, $msgcode) = @_; my $distance = makesignedshort(($wParam & 0xFFFF0000) >> 16); my $buttons = makesignedshort($wParam & 0x0000FFFF); my $y =makesignedshort(($lParam & 0xFFFF0000) >> 16); my $x = makesignedshort($lParam & 0x0000FFFF); my $isdropped = $object->SendMessage(CB_GETDROPPEDSTATE, 0, 0); return 1 if $isdropped; if (0 < $distance) { scrollmebro(-(2*$dy), 0); } elsif (0 > $distance) { scrollmebro(2*$dy, 0); } return 0; } sub scrollmebro { my ($offset, $newpos) = @_; my $curpos = $scrollwindow->ScrollPos(SB_VERT); my ($min, $max) = $scrollwindow->ScrollRange(SB_VERT); my $pos; if ($offset) { $pos = $curpos + $offset; } elsif ($newpos) { $pos = $newpos; } if (defined $pos) { $pos = 0 if 0 > $pos; $pos = $max if $max < $pos; $scrollwindow->ScrollPos(SB_VERT, $pos); my $deltapos = $lastscrollpos - $pos; $scrollapi->Call($scrollwindow->{-handle}, 0, $deltapos, 0, 0); $lastscrollpos = $pos; } } Waldemar Biernacki wrote: > Hey everybode! > > Do you know whether mouse scrolling button is implemented in Win32::GUI and how? > > > Waldemar > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |
From: E. W. <er...@we...> - 2008-07-02 22:47:00
|
Good timing. I just went through getting that to work. This code fragment might help you, it's straight from my app. Your mileage (and options and variables and etc) may vary. This isn't a complete app obviously, but I think this is all that's relevant to wheel scrolling. The $dy global is how much to scroll on each well detente, and $lastscrollpos is a global for holding the last position. I hope the rest is self-explanatory. Season to taste. use Win32::GUI qw(WM_MOUSEWHEEL); my $scrollapi = new Win32::API('user32', 'ScrollWindow', ['N', 'I', 'I', 'P', 'P'], 'N') or die "Can't load ScrollWindow API"; my $main = Win32::GUI::Window->new(-name => "Main" , -text => "Main Window" , -size => [$main_w, $main_h] , -hasmaximize => 0 , -dialogui => 1 , -onTerminate => \&terminatemain); $main->Hook(WM_MOUSEWHEEL, \&domousewheel); $main->Show(); my $scrollwindow = Win32::GUI::Window->new(-name =>"scrollwindow" , -parent => $main , -pos => [$sw_x, $sw_y] , -size => [$sw_h, $sw_w] , -dialogui => 1 , -tabstop => 1 , -vscroll => 1 , -titlebar => 0 , -sizeable => 0 , -controlparent => 1 , -pushstyle => WS_CHILD , -pushstyle => WS_VSCROLL , -popstyle => WS_THICKFRAME , -onScroll => \&doscroll); $scrollwindow->Hook(WM_MOUSEWHEEL, \&domousewheel); $scrollwindow->Show(); # create whatever controls or subwindows go inside the scrolling area here, as children of $scrollwindow sub domousewheel { my ($object, $wParam, $lParam, $type, $msgcode) = @_; my $distance = makesignedshort(($wParam & 0xFFFF0000) >> 16); my $buttons = makesignedshort($wParam & 0x0000FFFF); my $y =makesignedshort(($lParam & 0xFFFF0000) >> 16); my $x = makesignedshort($lParam & 0x0000FFFF); my $isdropped = $object->SendMessage(CB_GETDROPPEDSTATE, 0, 0); return 1 if $isdropped; if (0 < $distance) { scrollmebro(-(2*$dy), 0); } elsif (0 > $distance) { scrollmebro(2*$dy, 0); } return 0; } sub scrollmebro { my ($offset, $newpos) = @_; my $curpos = $scrollwindow->ScrollPos(SB_VERT); my ($min, $max) = $scrollwindow->ScrollRange(SB_VERT); my $pos; if ($offset) { $pos = $curpos + $offset; } elsif ($newpos) { $pos = $newpos; } if (defined $pos) { $pos = 0 if 0 > $pos; $pos = $max if $max < $pos; $scrollwindow->ScrollPos(SB_VERT, $pos); my $deltapos = $lastscrollpos - $pos; $scrollapi->Call($scrollwindow->{-handle}, 0, $deltapos, 0, 0); $lastscrollpos = $pos; } } Waldemar Biernacki wrote: > Hey everybode! > > Do you know whether mouse scrolling button is implemented in Win32::GUI and how? > > > Waldemar > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |
From: E. W. <er...@we...> - 2008-07-02 22:39:18
|
Good timing. I just went through getting that to work. This code fragment might help you, it's straight from my app. Your mileage (and options and variables and etc) may vary. This isn't a complete app obviously, but I think this is all that's relevant to wheel scrolling. The $dy global is how much to scroll on each well detente, and $lastscrollpos is a global for holding the last position. I hope the rest is self-explanatory. Season to taste. use Win32::GUI qw(WM_MOUSEWHEEL); my $scrollapi = new Win32::API('user32', 'ScrollWindow', ['N', 'I', 'I', 'P', 'P'], 'N') or die "Can't load ScrollWindow API"; my $main = Win32::GUI::Window->new(-name => "Main" , -text => "Main Window" , -size => [$main_w, $main_h] , -hasmaximize => 0 , -dialogui => 1 , -onTerminate => \&terminatemain); $main->Hook(WM_MOUSEWHEEL, \&domousewheel); $main->Show(); my $scrollwindow = Win32::GUI::Window->new(-name =>"scrollwindow" , -parent => $main , -pos => [$sw_x, $sw_y] , -size => [$sw_h, $sw_w] , -dialogui => 1 , -tabstop => 1 , -vscroll => 1 , -titlebar => 0 , -sizeable => 0 , -controlparent => 1 , -pushstyle => WS_CHILD , -pushstyle => WS_VSCROLL , -popstyle => WS_THICKFRAME , -onScroll => \&doscroll); $scrollwindow->Hook(WM_MOUSEWHEEL, \&domousewheel); $scrollwindow->Show(); # create whatever controls or subwindows go inside the scrolling area here, as children of $scrollwindow sub domousewheel { my ($object, $wParam, $lParam, $type, $msgcode) = @_; my $distance = makesignedshort(($wParam & 0xFFFF0000) >> 16); my $buttons = makesignedshort($wParam & 0x0000FFFF); my $y =makesignedshort(($lParam & 0xFFFF0000) >> 16); my $x = makesignedshort($lParam & 0x0000FFFF); my $isdropped = $object->SendMessage(CB_GETDROPPEDSTATE, 0, 0); return 1 if $isdropped; if (0 < $distance) { scrollmebro(-(2*$dy), 0); } elsif (0 > $distance) { scrollmebro(2*$dy, 0); } return 0; } sub scrollmebro { my ($offset, $newpos) = @_; my $curpos = $scrollwindow->ScrollPos(SB_VERT); my ($min, $max) = $scrollwindow->ScrollRange(SB_VERT); my $pos; if ($offset) { $pos = $curpos + $offset; } elsif ($newpos) { $pos = $newpos; } if (defined $pos) { $pos = 0 if 0 > $pos; $pos = $max if $max < $pos; $scrollwindow->ScrollPos(SB_VERT, $pos); my $deltapos = $lastscrollpos - $pos; $scrollapi->Call($scrollwindow->{-handle}, 0, $deltapos, 0, 0); $lastscrollpos = $pos; } } Waldemar Biernacki wrote: > Hey everybode! > > Do you know whether mouse scrolling button is implemented in Win32::GUI and how? > > > Waldemar > > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > |
From: Waldemar B. <wb...@sa...> - 2008-07-02 22:06:55
|
Hey everybode! Do you know whether mouse scrolling button is implemented in Win32::GUI and how? Waldemar |
From: Jeremy W. <jez...@ho...> - 2008-07-02 17:33:46
|
Hi, The way I would approach this is to have one thread controlling the GUI and then have worker threads that do the actual work. Using the threading approach will allow you more interactivity, and if any of the jobs are processor bound you'll gain significant performance on dual/quad cores. Have a look at the Win32::GUI::ThreadUtils package on: http://www.robmay.me.uk/win32gui Although it's "EXPERIMENTAL" it will show how to raise an event in the GUI thread from a worker thread via a thread safe message queue. It might sound complicated, but it does work well and makes life simpler for boss/worker coding. Also have a look at the link below, using a database: http://perl-win32-gui.sourceforge.net/cgi-bin/wiki.cgi?Multi_Threaded_Win32-GUI_App_Using_The_DBI_(DBD-Mysql) Cheers, jez. ________________________________ Date: Tue, 1 Jul 2008 07:47:16 -0500 From: sas...@gm... To: per...@li... Subject: [perl-win32-gui-users] GUI and Console in the same application? Hi, I'm having some trouble with getting an idea I have (that I think will work) actually implemented in Perl. I work at a job that has me connecting to various systems all over the place with the command prompt (Win32 environment). I also have a rather large collection of scripts, batch files, and commands that I use frequently on the systems I connect to. What I'm trying to do is to reduce some of the repetitive tasks while working on these systems. I want to have a command prompt that basically has a toolbar of sorts associated with it, which will have buttons for my most used scripts/commands/etc, so that when I click on a button the information is either pasted to the window, or the script launches in the background on the appropriate system. I have tried researching this online via Google without much luck. (Searching for things like wrapping command prompt, etc.) I already have a Perl script that makes my connections for me, which I run from a regular command prompt, and then the connection script backticks out the remote console application. So I am either looking to add the functionality to that script, or if I could get a command prompt wrapped into a Perl window, I could add the connection script to it Any suggestions or pointers of where I can look for more information? Thanks! - Craig _________________________________________________________________ 100’s of Nikon cameras to be won with Live Search http://clk.atdmt.com/UKM/go/101719808/direct/01/ |