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: <jez...@ho...> - 2007-03-26 12:31:39
|
Thanks - good to know. Cheers, Jez -----Original Message----- From: "Steve Loughran" <ste...@sc...> To: "Per...@li..." <Per...@li...> Sent: 25/03/07 19:48 Subject: Re: [perl-win32-gui-users] Vista and Win32: :GUI no glitches as far as I can tell for my application (I develop under XP SP2, then run the application via perl2exe, not native perl... if you see what i mean) Steve Jeremy White wrote: > Hi, > > Has anyone run a Win32::GUI application under Vista yet? Any glitches? > > Cheers, > > Jez. > > _________________________________________________________________ > Get Hotmail, News, Sport and Entertainment from MSN on your mobile. > http://www.msn.txt4content.com/ > > > ------------- |
From: Steve L. <ste...@sc...> - 2007-03-25 18:48:14
|
no glitches as far as I can tell for my application (I develop under XP SP2, then run the application via perl2exe, not native perl... if you see what i mean) Steve Jeremy White wrote: > Hi, > > Has anyone run a Win32::GUI application under Vista yet? Any glitches? > > Cheers, > > Jez. > > _________________________________________________________________ > Get Hotmail, News, Sport and Entertainment from MSN on your mobile. > http://www.msn.txt4content.com/ > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > 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: Jeremy W. <jez...@ho...> - 2007-03-25 18:30:45
|
Hi, Has anyone run a Win32::GUI application under Vista yet? Any glitches? Cheers, Jez. _________________________________________________________________ Get Hotmail, News, Sport and Entertainment from MSN on your mobile. http://www.msn.txt4content.com/ |
From: Robert M. <rob...@us...> - 2007-03-21 22:28:01
|
Chuck Pierce wrote: > anyone know how (or if it's possible) to add/update icons to the > TrackPopupMenu? Also, how do you add separator bars in the menu as well? It's not currently possible using Win32::GUI alone. There's a feature request open asking for it, and I've just had a quick look at the code, and don't think it would be too hard to add .... but I need to get the time (unless someone else wants to have a go, then I can point them to the right bits of code) In the meantime, here's a horrible hack to do it using Win32::API to get direct access to the SetMenuInfo and SetMenuItemInfo API calls. I've thrown in a separator so you can see how that's done too. Regards, Rob. #!perl -w use strict; use warnings; use Win32::API(); Win32::API->Import('user32', 'SetMenuItemInfo', 'LILP', 'L') or die; Win32::API->Import('user32', 'SetMenuInfo', 'LP', 'L') or die; use Win32::GUI qw(CW_USEDEFAULT SM_CXMENUCHECK SM_CYMENUCHECK TRANSPARENT); use Win32::GUI::DIBitmap(); sub MIIM_BITMAP() {0x00000080} sub MIM_STYLE() {0x00000010} sub MNS_CHECKORBMP() {0x04000000} sub MNS_NOCHECK() {0x80000000} my $menu = Win32::GUI::Menu->new( 'Popup' => 'Popup', '>Item &1' => { -name => 'Item1', -onClick => sub { print "Item1\n"; 0; }, }, '>Item &2' => { -name => 'Item2', -onClick => sub { print "Item2\n"; 0; }, }, '>Item &3' => { -name => 'Item3', -onClick => sub { print "Item3\n"; 0; }, }, '>-' => 'Seperator', '>Item &4' => { -name => 'Item4', -onClick => sub { print "Item4\n"; 0; }, }, ); # Remove the reserved space for check marks - comment out this # line to see the effect of leaving the reserved space set_menu_info($menu->{Popup}->{-handle}); my @bitmaps; # we need to keep a reference to the bitmaps to stop them getting destroyed my $pos = 0; for my $color ( [255,0,0], [0,255,0], [0,0,255] ) { # ( Blue, Green, Red ) my $bmp = create_bitmap($color); set_menuitem_bitmap($menu->{Popup}->{-handle}, $pos++, $bmp->{-handle}); push @bitmaps, $bmp; } my $mw = Win32::GUI::Window->new( -left => CW_USEDEFAULT, -size => [400,300], -onMouseRightUp => \&context_menu, -onPaint => \&instructions, ); $mw->Show(); Win32::GUI::Dialog(); $mw->Hide(); exit(0); # Handler for onMouseRightUp event sub context_menu { my ($self) = @_; $self->TrackPopupMenu($menu->{Popup}); return 0; } # Set the bitmap for the menu item. We set by position, as in Win32::GUI I # can see no way to get the menu item identifier. # IN: handle to menu # position of item in menu (zero based) # handle to bitmap # OUT: returns true on success, die()s on failure sub set_menuitem_bitmap { my ($hmenu, $pos, $hbmp) = @_; # Create a MENUITEMINFO structure my $mii = pack( 'IIIIILLLLLIL', 12 * 4, # cbsize = sizeof(MENUITEMINFO) MIIM_BITMAP, # fMask = MIIM_BITMAP 0, # fType - unused 0, # fState - unused 0, # wID - unused 0, # hSubMenu - unused 0, # hbmpChecked - unused 0, # hbmpUnchecked - unused 0, # dwItemData - unused 0, # dwTypeData - unused 0, # cch - unused $hbmp, # hbmpItem ); my $r = SetMenuItemInfo($hmenu, $pos, 1, $mii); if ( $r == 0 ) { die qq(SetMenuItemInfo() failed: $^E); } return 1; } # Set the menu style so that we don't reserve space for checkmarks, # otherwise we have an extra gap to the left of the bitmap # IN: handle to menu # OUT: returns true on success, die()s on failure sub set_menu_info { my ($hmenu) = @_; # Create a MENUINFO structure my $mi = pack( 'LLLILLL', 7 * 4, # cbsize = sizeof(MENUITEMINFO) MIM_STYLE, # fMask = MIM_STYLE MNS_NOCHECK, # dwStyle (or MNS_CHECKORBMP if we want some items to # have checks and some to have bitmaps) 0, # cyMax - unused 0, # hbrBack - unused 0, # dwContextHelpID - unused 0, # dwMenuData - unused ); my $r = SetMenuInfo($hmenu, $mi); if ( $r == 0 ) { die qq(SetMenuInfo() failed: $^E); } return 1; } # Create a solid color bitmap of the correct size # IN: COLOR - array ref [ Blue, Green, Red ] # OUT: Win32::GUI::Bitmap sub create_bitmap { my ($color) = @_; my $cx = Win32::GUI::GetSystemMetrics(SM_CXMENUCHECK); my $cy = Win32::GUI::GetSystemMetrics(SM_CYMENUCHECK); my $dib = Win32::GUI::DIBitmap->new($cx, $cy); for my $y ( 0 .. $cy-1 ) { for my $x ( 0 .. $cx-1 ) { # Using array ref, as DIBitmap appears to have a bug with # passing a COLORREF value (0xBBGGRR). Note that when DIBitmap # uses an array ref the colors are in a different order to most # Win32::GUI usage of array refs for colors: BGR rather than RGB. $dib->SetPixel($x, $y, $color); } } my $bmp = $dib->ConvertToBitmap(); return $bmp; } # Handler for onPaint event sub instructions { my ($self, $dc) = @_; my $saved = $dc->Save(); $dc->Validate(); my ($l, $t, $r, $b) = $self->GetClientRect(); $dc->BkMode(TRANSPARENT); $dc->DrawText("Right-Click to see menu", $l, $t, $r, $b); $dc->Restore($saved); return 0; } __END__ |
From: Chuck P. <ch...@on...> - 2007-03-21 04:47:37
|
anyone know how (or if it's possible) to add/update icons to the TrackPopupMenu? Also, how do you add separator bars in the menu as well? Thanks - Chuck |
From: Charles A. <cha...@al...> - 2007-03-20 21:07:23
|
Hi, You're correct that your problem is in the nested subroutines. The =20 behavior of the handlers you set up inside of verify() is not what =20 you're expecting. There's a lot of stuff going on here that can trap =20 you. First of all, when you try running this script with warnings enabled =20 (perl -w myscript.pl), you'll get messages like this: Variable "$result" will not stay shared at verify.pl line 68. Variable "$outputfield" will not stay shared at verify.pl line 69. Variable "$result" will not stay shared at verify.pl line 74. Variable "$outputfield" will not stay shared at verify.pl line 75. It's always a good idea to use strict and use warnings when you're =20 writing Perl. Basically, the two variables you're referring to in the handlers =20 ($result and $outputfield) are recreated each time you call verify(), =20 but the handlers will only see the first instance of $result and =20 $outputfield. Successive calls to the handlers are meaningless =20 because $result and $outputfield were local to the first call to =20 verify(). Here's some comments: sub Pass_Click { # Here you are assigning to the $result variable that was privately # scoped within the first call to verify() $result =3D 1; # Same thing here. You are modifying the text field in the first text # field created on the first call to verify() $outputfield->Text("result : $result"); # Try returning 0 in this handler and in the Fail_Click handler. # You'll see that the output field is changing to what you would think = at # first, but when you close (X out) the first window, the successive # windows' text fields won't get updated -1; # say 'return 0' instead; } For a better explanation on nested subroutines and private variables, =20 check out these articles: * http://www.webreference.com/programming/perl/subroutines/2.html * http://perl.com/pub/a/2002/05/07/mod_perl.html My take on nested subroutines: If you never plan on using mod_perl, =20 you could probably just completely avoid nested subroutines and be =20 just fine. So anyway, back to your problem. I'm not really sure what you're =20 trying to accomplish with this script, but an alternative approach you =20 could take could be to only create your window once (at the startup of =20 your script). When you later call verify, (1) show the window, (2) =20 enter the Dialog, (3) handle user input, (4) exit the dialog, (5) then =20 hide the window. Good Luck, Charles Alderman Quoting luksedj the first <lu...@ya...>: > Hello, > > I'm just starting to use Win32::GUI and I can't seem to explain the =20 > behavior of my application. > > I have a main perl program that occasionally needs user input. On =20 > those occasions I call a function (sub) that builds the window and =20 > starts the dialog, and returns a result gathered from the user input. > > The first time this function is called, it works as expected. The =20 > user clicks a button, the button callback sets a value, and =20 > terminates the Dialog(). The value that was set is the return value =20 > of the function. > > However, on the second and following times that the function is =20 > called, the window is shown, via printouts I can see the return =20 > value being set, but when the dialog exits and the function is about =20 > to return its return value, the return value is the default one, in =20 > stead of the set one. I assume that it has to do something with me, =20 > coding the event handlers inside the function that does all the gui =20 > stuff. If that is so, can someone explain this behavior? I don;t =20 > mind changing my code, but then I want to understand why it behaves =20 > like this. > > The code is pasted below. The behavior I want is that the user =20 > clicks on the pass button which returns 1 to the calling function. =20 > If you press 'passed' in every test, then you'll see the return =20 > value is 0 starting from the second call to the 'verify' function. > > > use Win32::GUI(); > > > > my $canvas_height =3D 328; > my $title_height =3D 32; > my $margin =3D 15; > > > for ($i=3D0; $i<5;$i++){ > my $output =3D "test $i"; > print "$output "; > my $result_1 =3D verify($output); > print $result_1; > print " $output\r\n"; > } > > > sub verify { > my $output =3D shift; > > my $result =3D 0; > my $main =3D > Win32::GUI::DialogBox->new( > -name =3D> 'Main', > -width =3D> 280, > -height =3D> $canvas_height+$title_height, > -text =3D> 'Test Step Output Verification', > -helpbox =3D> 0, > ); > > > my $outputfield =3D $main->AddTextfield( > -name =3D> 'Outputfield', > -multiline =3D> 1, > -hscroll =3D> 1, > -vscroll =3D> 1, > -width =3D> 215, > -height =3D> 200, > -pos =3D> [ $margin, 60], > -disabled =3D> 0, > -readonly =3D> 1, > ); > > my $pass =3D $main->AddButton( > -text =3D> 'Passed', > -width =3D> 100, > -height =3D> 25, > -pos =3D> [$outputfield->Left(), > $outputfield->Height() + $outputfield->Top() + $margi= n], > -name =3D> 'Pass', > -tabstop =3D> 1 > ); > > my $fail =3D $main->AddButton( > -text =3D> 'Failed', > -width =3D> 100, > -height =3D> 25, > -pos =3D> [$outputfield->Left() + =20 > $outputfield->Width() - 100, > $pass->Top()], > -name =3D> 'Fail', > -tabstop =3D> 1 > ); > > > sub Pass_Click { > $result =3D 1; > $outputfield->Text("result : $result"); > -1; > } > > sub Fail_Click { > $result =3D 0; > $outputfield->Text("result : $result"); > -1; > } > > sub Main_Terminate { > -1; > } > > > $outputfield->Text($output); > $main->Show(); > Win32::GUI::Dialog(); > return $result; > } > > > Thanks for any hints, > > luksedj > > > > > > __________________________________________________________________________= __________ > Expecting? Get great news right away with email Auto-Check. > Try the Yahoo! Mail Beta. > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share yo= ur > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DD= EVDEV > _______________________________________________ > 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: Jan D. <ja...@ac...> - 2007-03-20 19:19:57
|
On Mon, 19 Mar 2007, Peter Buck wrote: > "STILL_ACTIVE" is not exported by the Win32::Process module You need Win32::Process version 0.10 or later. Check your version: perl -MWin32::Process -eprint$Win32::Process::VERSION 0.10 It is already included in ActivePerl 815 and later. Cheers, -Jan |
From: luksedj t. f. <lu...@ya...> - 2007-03-20 09:34:32
|
Hello,=0A=0AI'm just starting to use Win32::GUI and I can't seem to explain= the behavior of my application.=0A=0AI have a main perl program that occas= ionally needs user input. On those occasions I call a function (sub) that b= uilds the window and starts the dialog, and returns a result gathered from = the user input.=0A=0AThe first time this function is called, it works as ex= pected. The user clicks a button, the button callback sets a value, and ter= minates the Dialog(). The value that was set is the return value of the fun= ction.=0A=0AHowever, on the second and following times that the function is= called, the window is shown, via printouts I can see the return value bein= g set, but when the dialog exits and the function is about to return its re= turn value, the return value is the default one, in stead of the set one. I= assume that it has to do something with me, coding the event handlers insi= de the function that does all the gui stuff. If that is so, can someone exp= lain this behavior? I don;t mind changing my code, but then I want to under= stand why it behaves like this.=0A=0AThe code is pasted below. The behavior= I want is that the user clicks on the pass button which returns 1 to the c= alling function. If you press 'passed' in every test, then you'll see the r= eturn value is 0 starting from the second call to the 'verify' function.=0A= =0A=0Ause Win32::GUI();=0A=0A=0A=0Amy $canvas_height =3D 328;=0Amy $title_h= eight =3D 32;=0Amy $margin =3D 15;=0A=0A=0Afor ($i=3D0; $i<5;$i++){=0A m= y $output =3D "test $i";=0A print "$output ";=0A my $result_1 =3D ver= ify($output);=0A print $result_1;=0A print " $output\r\n";=0A}=0A = =0A=0Asub verify {=0A my $output =3D shift;=0A =0A my $result =3D = 0;=0A my $main =3D=0A Win32::GUI::DialogBox->new(=0A = -name =3D> 'Main',=0A -width =3D> 280,=0A = -height =3D> $canvas_height+$title_height,=0A = -text =3D> 'Test Step Output Verification',=0A -helpbo= x =3D> 0,=0A );=0A =0A =0A my $outputfield =3D $= main->AddTextfield(=0A -name =3D> 'Outputfield',=0A = -multiline =3D> 1,=0A -hscroll =3D>= 1,=0A -vscroll =3D> 1,=0A -width= =3D> 215,=0A -height =3D> 200,=0A = -pos =3D> [ $margin, 60],=0A -disabled =3D> 0,=0A = -readonly =3D> 1,=0A );=0A =0A = my $pass =3D $main->AddButton(=0A -text =3D> 'Passed',=0A = -width =3D> 100,=0A -height =3D> 25,=0A = -pos =3D> [$outputfield->Left(),=0A $outputfi= eld->Height() + $outputfield->Top() + $margin],=0A -name =3D= > 'Pass',=0A -tabstop =3D> 1=0A );=0A =0A = my $fail =3D $main->AddButton(=0A -text =3D> 'Failed',= =0A -width =3D> 100,=0A -height =3D> 25,= =0A -pos =3D> [$outputfield->Left() + $outputfield->Widt= h() - 100,=0A $pass->Top()],=0A -nam= e =3D> 'Fail',=0A -tabstop =3D> 1=0A );=0A= =0A =0A sub Pass_Click {=0A $result =3D 1;=0A $output= field->Text("result : $result");=0A -1;=0A }=0A =0A sub Fail_= Click {=0A $result =3D 0;=0A $outputfield->Text("result : $result= ");=0A -1;=0A }=0A =0A sub Main_Terminate {=0A -1;=0A }= =0A =0A =0A $outputfield->Text($output);=0A $main->Show();=0A = Win32::GUI::Dialog();=0A return $result;=0A}=0A=0A=0AThanks for any hi= nts,=0A=0Aluksedj=0A=0A=0A=0A=0A =0A_______________________________________= _____________________________________________=0AExpecting? Get great news r= ight away with email Auto-Check. =0ATry the Yahoo! Mail Beta.=0Ahttp://advi= sion.webevents.yahoo.com/mailbeta/newmail_tools.html |
From: Peter B. <pb...@co...> - 2007-03-19 22:42:54
|
"STILL_ACTIVE" is not exported by the Win32::Process module Jason Plum, I got the above msg when trying your spawn_child example. What am I doing wrong? I searched for win32::Process in ppm, didn't find it. Thanks, Peter Buck |
From: Jason P. <jp...@un...> - 2007-03-13 12:31:13
|
Simple and easy to create out of process, look at Win32::Process and using the Win32::GUI library to get the handle to the desktop "window". I use this in a PerlSvc (activestate Perl Dev Kit) to spawn my automated system metrics recording and virus/spyware scans. Any event can trigger the calling of script by this method, (a)synchronous from the perl script that you have controlling any given action. _code_ # required modules use Win32::GUI; use Win32::Process ('STILL_ACTIVE'); sub PERL_PATH(){ return "c:/perl/bin/perl.exe"}; # get the desktop "window" handle my $hDesktop = Win32::GUI::GetDesktopWindow(); # fire up a subprocess that is a child to the desktop (aka explorer.exe, and appears as any standard program) my $child_perl_script; Win32::Process::Create( $child_perl_script, PERL_PATH, "[standard perl.exe command line arguments]", 0, 0, cwd() ); # wait for process..?? [optional] $child_perl_script->wait(); # get the exit code [will return STILL_ACTIVE if not complete) my $exit_code; $child_perl_script->GetExitCode( $exit_code ); if( $exit_code == STILL_ACTIVE ){ print "child script still running... I'll leave it be a while...\n"; }else{ print "child script exited with $exit_code\n"; } _code_ Enjoy the wonders of perl on win32 :p Jason P. mike morrison wrote: > Hello, > I am a new Perl programmer and I have just discovered the win32::api > interface. I think it is really cool. I have written a plain Jane > menu script in Perl that executes on the command line but I would like > to Gui-ize it to make it more user friendly for my W-intel techs. How > can I call other scripts from the menu items in the MDI form or is > there a way I can use form objects for input then use them for running > a script in the background? > > Thanks, > Mike > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > ------------------------------------------------------------------------ > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > ------------------------------------------------------------------------ > > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.9/719 - Release Date: 3/12/2007 8:41 AM > |
From: mike m. <mmo...@gm...> - 2007-03-13 03:51:12
|
Hello, I am a new Perl programmer and I have just discovered the win32::api interface. I think it is really cool. I have written a plain Jane menu script in Perl that executes on the command line but I would like to Gui-ize it to make it more user friendly for my W-intel techs. How can I call other scripts from the menu items in the MDI form or is there a way I can use form objects for input then use them for running a script in the background? Thanks, Mike |
From: Steve <ste...@sv...> - 2007-03-01 02:04:12
|
I have a problem with this combination: pp and Gui::Loft. I use pp (PAR) a lot, for creating Windows exe's. I created a GUI app with GUI::Loft, which works great. Although, I think GUI::Loft has become orphaned (no development) in the past couple of years. When I use pp to create an exe, it bombs out when Dynaloading Win32::GUI. ActiveState perl 5.8.8, Win32::GUI 1.05 I am surprised that there is no mention of this problem here. Any recommendations you have for troubleshooting my problem? stv ------ original message ------ Reini Urban <rurban@x-...> wrote 2007-02-02 05:47 I regularly build and use: pp (free) with cygwin and ActivePerl-5.8.6.811 (cpan PAR - http://par.perl.org/) and perl2exe with ActivePerl-5.8.6.811. (non-free) 2007/2/1, Eric Hansen <ehansen@co...>: > Can some folks recommend to me a PERL compiler vendor/version that they > are |
From: Robert M. <rm...@po...> - 2007-02-26 21:16:00
|
Nice indeed. I saw your original message before I went away last week, and came up with a slightly different solution on the plane. I'll add the EN_ and CBN_ constant definitions to Win32::GUI::Constants. I also note what you say about wanting to hook the edit control and listbox control in the combobox - but I don't think it'd be trivial to add. Regards, Rob. #!perl -w use strict; use warnings; use Win32::GUI 1.05 qw(CW_USEDEFAULT WM_COMMAND VK_BACK VK_DELETE); sub CB_ERR() {-1} sub CBN_EDITUPDATE() {6} my $mw = Win32::GUI::DialogBox->new( -title => 'Drop-Down', -left => CW_USEDEFAULT, -size => [400,300], ); my $cb = $mw->AddCombobox( -dropdown => 1, -size => [100,100], ); $cb->Hook(CBN_EDITUPDATE, \&autocomplete); $cb->Add( sort qw(Red Green Blue Yellow Black White Purple Orange Brown) ); $cb->SetFocus(); $mw->Show(); Win32::GUI::Dialog(); $mw->Hide(); exit(0); sub autocomplete { my ($self, $wparam, $lparam, $type, $msgcode) = @_; return unless $type == WM_COMMAND; return unless $msgcode == CBN_EDITUPDATE; # Prevent matching for Backspace and Delete keys return if Win32::GUI::GetKeyState(VK_BACK); return if Win32::GUI::GetKeyState(VK_DELETE); # Get the text from the edit control my $edit_text = $self->Text(); my $edit_len = length($edit_text); # Get the current selection my ($start, $end) = $self->GetEditSel(); if($self->SelectString($edit_text) == CB_ERR) { # No match, restore text and selection $self->Text($edit_text); $self->SetEditSel($start, $end); } else { # Found match, SelectString changed the text for us if($end < $edit_len) { # We were editing in the middle of the string, # so keep the selection point $self->SetEditSel($start, $end); } else { # Select the added characters $self->SetEditSel($edit_len, -1); } } return 0; } __END__ Glenn W Munroe wrote: > ...and thanks to you for the feedback. It's hard to know sometimes if this > kind of stuff might be useful to someone, or if I'm just filling the list up > with garbage. > > There was a slight error in the example, by the way! I forgot the line > > -onChange => \& cbChange, > > in the combobox definition. > > All the best, > Glenn2 > >> -----Original Message----- >> From: Glenn Linderman [mailto:pe...@Ne...] >> Sent: 19 February 2007 16:35 >> To: Glenn W Munroe >> Cc: per...@li... >> Subject: Re: [perl-win32-gui-users] "Smart" Combobox >> >> On approximately 2/19/2007 8:34 AM, came the following characters from >> the keyboard of Glenn W Munroe: >>> .and for the record, here is the finished example, using the Hook >>> mentioned below. >>> >> Thanks for figuring this out. It looks good to me! I'm adding that to my >> personal "goody box" :) >> >> >> -- >> Glenn -- http://nevcal.com/ >> =========================== >> A protocol is complete when there is nothing left to remove. >> -- Stuart Cheshire, Apple Computer, regarding Zero Configuration >> Networking > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > 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: Roode, E. <er...@ba...> - 2007-02-22 20:07:55
|
What??! You mean you couldn't understand the crystal-clear Win32::GUI docs? What's wrong with you?=20 Just kidding. The Win32::GUI docs are awful. On that page, [X,Y]+ refers to a set of points (one point for each vertex of the polygon). You pass the points as X, Y coordinates in one long list. Here: $dc->Polygon(10, 10, 10, 200, 200, 200, 10, 10); This draws a right triangle with its right-angled vertex at (200, 200). If you like, you can group the arguments: $dc->Polygon( (10, 10), (10, 200), (200, 200), (10, 10)); They all get flattened out into one list anyhow. Eric ________________________________ From: per...@li... [mailto:per...@li...] On Behalf Of Shepherd, Mike Sent: Thursday, February 22, 2007 2:56 PM To: per...@li... Subject: [perl-win32-gui-users] Win32-GUI-DC Polygon Perl-Win32-GUI users, =20 I'm looking for an example using Win32-GUI-DC, specifically creating Polygons (or any of the Poly... objects). The format to create a Polygon objects is: =20 $DC -> Polygon([X,Y]+) =20 What is getting passed to the polygon - I don't understand the [X,Y]+ notation? =20 Thanks, =20 Mike =20 =20 =20 |
From: Shepherd, M. <she...@ag...> - 2007-02-22 19:56:07
|
Perl-Win32-GUI users, =20 I'm looking for an example using Win32-GUI-DC, specifically creating Polygons (or any of the Poly... objects). The format to create a Polygon objects is: =20 $DC -> Polygon([X,Y]+) =20 What is getting passed to the polygon - I don't understand the [X,Y]+ notation? =20 Thanks, =20 Mike =20 =20 =20 =20 |
From: Glenn W M. <gwm...@gm...> - 2007-02-19 19:43:33
|
...and thanks to you for the feedback. It's hard to know sometimes if this kind of stuff might be useful to someone, or if I'm just filling the list up with garbage. There was a slight error in the example, by the way! I forgot the line -onChange => \& cbChange, in the combobox definition. All the best, Glenn2 > -----Original Message----- > From: Glenn Linderman [mailto:pe...@Ne...] > Sent: 19 February 2007 16:35 > To: Glenn W Munroe > Cc: per...@li... > Subject: Re: [perl-win32-gui-users] "Smart" Combobox > > On approximately 2/19/2007 8:34 AM, came the following characters from > the keyboard of Glenn W Munroe: > > > > .and for the record, here is the finished example, using the Hook > > mentioned below. > > > > Thanks for figuring this out. It looks good to me! I'm adding that to my > personal "goody box" :) > > > -- > Glenn -- http://nevcal.com/ > =========================== > A protocol is complete when there is nothing left to remove. > -- Stuart Cheshire, Apple Computer, regarding Zero Configuration > Networking |
From: Glenn W M. <gwm...@gm...> - 2007-02-19 16:31:46
|
.and for the record, here is the finished example, using the Hook mentioned below. #!perl -w use Win32::GUI(); use Win32::GUI::Constants qw(:window /^GW_/); use constant CBN_EDITCHANGE => 5; $mw = new Win32::GUI::Window( -name => "mw", -title => "Smart Combobox", -pos => [100, 100], -size => [200, 200], -dialogui => 1, ); $mw->AddCombobox( -name => "cb", -size => [170, 110], -pos => [10, 20], -vscroll => 1, -dropdown => 1, -tabstop => 1, -onGotFocus => \& cbGotFocus, ); foreach (sort qw(Red Green Blue Yellow Black White Purple Orange Brown)) { $mw->cb->AddString($_) } $mw->cb->SetExtendedUI(1); # Down arrow to drop down list $mw->cb->UserData( {iLenght => 0} ); $mw->AddTextfield( -name => "tx", -size => [154, 24], -left => 10, -top => 50, -tabstop => 1, ); $mw->cb->Hook(CBN_EDITCHANGE,\&cbEditChange); $mw->Show(); Win32::GUI::Dialog(); sub cbEditChange { my ($hObject, $wParam, $lParam, $iType, $iMsgCode) = @_; return 1 unless $iType == WM_COMMAND; my $szText = $mw->cb->Text; my $bPredict = 1 if (length($szText) > $mw->cb->UserData->{iLength}); $mw->cb->UserData->{iLength} = length($szText); if ($bPredict) { my $iIndex = length($szText); if ((my $i = $mw->cb->FindString($szText)) >= 0) { $mw->cb->Text($mw->cb->GetString($i)); $mw->cb->SetEditSel($iIndex,-1); } } 1; } sub cbGotFocus { $mw->cb->UserData->{iLength} = 0; 1;} sub cbChange { $mw->cb->UserData->{iLength} = 0; 1;} _____ From: Glenn W Munroe [mailto:gwmunroe @ gmail.com] Sent: 16 February 2007 19:36 To: per...@li... Subject: RE: "Smart" Combobox I think I just answered my own question :-) The parent combobox gets a CBN_EDITCHANGE event when the text in the edit control changes. That event doesn't appear to be implemented in Win32::GUI, but it can be "hooked" with the following line: $mw->cb->Hook(CBN_EDITCHANGE,\&CB_Change); Again, the CBN_EDITCHANGE constant isn't exported by Win32::GUI::Constants (maybe these are considered internal and are purposely not exported), but its value is 5. I also notice that there is a method to get the edit control handle by using the ComboboxEx control. Glenn _____ From: Glenn W Munroe [mailto:gwmunroe @ gmail.com] Sent: 16 February 2007 19:15 To: per...@li... Subject: "Smart" Combobox I've been trying to implement a "smart" combobox dropdown list. To get an idea of what I'm talking about, compare the font dropdowns in Wordpad and Word. In Wordpad, type "ar" into the control and "ar" is what you see. Tab away of the control and it gets replaced with "Arial". That is easy enough to implement and is shown in the example below. In Word, the behaviour is slightly more sophisticated. Type "ar" and you see "Arial", with the final three letters highlighted. This is what I'm trying to emulate. Again, it would be easy enough if I could get the "change" notification from the underlying edit control, but I can't see how to do that. I guess the first question is if this is a built-in behaviour of the combobox that I'm missing? Assuming it's not, I started by getting the handle of the edit control. That is easy enough, and its validity can be seen by the line in the combobox "GotFocus" event. I then tried to "hook" the change event, but it doesn't work (incidentally, should those EN_ constants be defined in Win32::GUI::Constants?) I assume the problem is that the control is not owned directly by Win32::GUI. Does anyone have any ideas? I would have thought that an ability to "hook" events for non-owned windows would be useful in other situations. Cheers, Glenn ============================================================================ ===================== #!perl -w use Win32::GUI(); use Win32::GUI::Constants qw(/^GW_/); use constant EN_CHANGE => 768; my ($hCB, $hED, $hTX); $mw = new Win32::GUI::Window( -name => "mw", -title => "ComboBox Test", -pos => [100, 100], -size => [200, 200], -dialogui => 1, ); $mw->AddCombobox( -name => "cb", -size => [170, 110], -pos => [10, 20], -vscroll => 1, -dropdown => 1, -tabstop => 1, -onGotFocus => sub { Win32::GUI::Text($hCB,"Test"); 1 }, -onLostFocus => sub { if ((my $i = $mw->cb->FindString($mw->cb->Text)) >= 0) { $mw->cb->Text($mw->cb->GetString($i)) } 1 }, ); foreach (sort qw(Red Green Blue Yellow Black White)) { $mw->cb->AddString($_) } $mw->cb->SetExtendedUI(1); # Down arrow to drop down list $mw->AddTextfield( -name => "tx", -size => [154, 24], -left => 10, -top => 50, -tabstop => 1, ); sub CB_Change { print "CB Change\n" } sub TX_Change { print "TX Change\n" } $hCB = $mw->cb->{-handle}; $hED = $mw->cb->GetWindow(GW_CHILD); $hTX = $mw->tx->{-handle}; print "Combobox control's handle is $hCB\n"; print "Combobox edit control's handle is $hED\n"; print "Textfield control's handle is $hTX\n"; $mw->tx->Hook(EN_CHANGE,\&TX_Change); Win32::GUI::Hook($hCB,EN_CHANGE,\&CB_Change); $mw->Show(); Win32::GUI::Dialog(); |
From: Glenn W M. <gwm...@gm...> - 2007-02-16 22:33:05
|
I think I just answered my own question :-) The parent combobox gets a CBN_EDITCHANGE event when the text in the edit control changes. That event doesn't appear to be implemented in Win32::GUI, but it can be "hooked" with the following line: $mw->cb->Hook(CBN_EDITCHANGE,\&CB_Change); Again, the CBN_EDITCHANGE constant isn't exported by Win32::GUI::Constants (maybe these are considered internal and are purposely not exported), but its value is 5. I also notice that there is a method to get the edit control handle by using the ComboboxEx control. Glenn _____ From: Glenn W Munroe [mailto:gwmunroe @ gmail.com] Sent: 16 February 2007 19:15 To: per...@li... Subject: "Smart" Combobox I've been trying to implement a "smart" combobox dropdown list. To get an idea of what I'm talking about, compare the font dropdowns in Wordpad and Word. In Wordpad, type "ar" into the control and "ar" is what you see. Tab away of the control and it gets replaced with "Arial". That is easy enough to implement and is shown in the example below. In Word, the behaviour is slightly more sophisticated. Type "ar" and you see "Arial", with the final three letters highlighted. This is what I'm trying to emulate. Again, it would be easy enough if I could get the "change" notification from the underlying edit control, but I can't see how to do that. I guess the first question is if this is a built-in behaviour of the combobox that I'm missing? Assuming it's not, I started by getting the handle of the edit control. That is easy enough, and its validity can be seen by the line in the combobox "GotFocus" event. I then tried to "hook" the change event, but it doesn't work (incidentally, should those EN_ constants be defined in Win32::GUI::Constants?) I assume the problem is that the control is not owned directly by Win32::GUI. Does anyone have any ideas? I would have thought that an ability to "hook" events for non-owned windows would be useful in other situations. Cheers, Glenn ============================================================================ ===================== #!perl -w use Win32::GUI(); use Win32::GUI::Constants qw(/^GW_/); use constant EN_CHANGE => 768; my ($hCB, $hED, $hTX); $mw = new Win32::GUI::Window( -name => "mw", -title => "ComboBox Test", -pos => [100, 100], -size => [200, 200], -dialogui => 1, ); $mw->AddCombobox( -name => "cb", -size => [170, 110], -pos => [10, 20], -vscroll => 1, -dropdown => 1, -tabstop => 1, -onGotFocus => sub { Win32::GUI::Text($hCB,"Test"); 1 }, -onLostFocus => sub { if ((my $i = $mw->cb->FindString($mw->cb->Text)) >= 0) { $mw->cb->Text($mw->cb->GetString($i)) } 1 }, ); foreach (sort qw(Red Green Blue Yellow Black White)) { $mw->cb->AddString($_) } $mw->cb->SetExtendedUI(1); # Down arrow to drop down list $mw->AddTextfield( -name => "tx", -size => [154, 24], -left => 10, -top => 50, -tabstop => 1, ); sub CB_Change { print "CB Change\n" } sub TX_Change { print "TX Change\n" } $hCB = $mw->cb->{-handle}; $hED = $mw->cb->GetWindow(GW_CHILD); $hTX = $mw->tx->{-handle}; print "Combobox control's handle is $hCB\n"; print "Combobox edit control's handle is $hED\n"; print "Textfield control's handle is $hTX\n"; $mw->tx->Hook(EN_CHANGE,\&TX_Change); Win32::GUI::Hook($hCB,EN_CHANGE,\&CB_Change); $mw->Show(); Win32::GUI::Dialog(); |
From: Glenn W M. <gwm...@gm...> - 2007-02-16 22:12:18
|
I've been trying to implement a "smart" combobox dropdown list. To get an idea of what I'm talking about, compare the font dropdowns in Wordpad and Word. In Wordpad, type "ar" into the control and "ar" is what you see. Tab away of the control and it gets replaced with "Arial". That is easy enough to implement and is shown in the example below. In Word, the behaviour is slightly more sophisticated. Type "ar" and you see "Arial", with the final three letters highlighted. This is what I'm trying to emulate. Again, it would be easy enough if I could get the "change" notification from the underlying edit control, but I can't see how to do that. I guess the first question is if this is a built-in behaviour of the combobox that I'm missing? Assuming it's not, I started by getting the handle of the edit control. That is easy enough, and its validity can be seen by the line in the combobox "GotFocus" event. I then tried to "hook" the change event, but it doesn't work (incidentally, should those EN_ constants be defined in Win32::GUI::Constants?) I assume the problem is that the control is not owned directly by Win32::GUI. Does anyone have any ideas? I would have thought that an ability to "hook" events for non-owned windows would be useful in other situations. Cheers, Glenn ============================================================================ ===================== #!perl -w use Win32::GUI(); use Win32::GUI::Constants qw(/^GW_/); use constant EN_CHANGE => 768; my ($hCB, $hED, $hTX); $mw = new Win32::GUI::Window( -name => "mw", -title => "ComboBox Test", -pos => [100, 100], -size => [200, 200], -dialogui => 1, ); $mw->AddCombobox( -name => "cb", -size => [170, 110], -pos => [10, 20], -vscroll => 1, -dropdown => 1, -tabstop => 1, -onGotFocus => sub { Win32::GUI::Text($hCB,"Test"); 1 }, -onLostFocus => sub { if ((my $i = $mw->cb->FindString($mw->cb->Text)) >= 0) { $mw->cb->Text($mw->cb->GetString($i)) } 1 }, ); foreach (sort qw(Red Green Blue Yellow Black White)) { $mw->cb->AddString($_) } $mw->cb->SetExtendedUI(1); # Down arrow to drop down list $mw->AddTextfield( -name => "tx", -size => [154, 24], -left => 10, -top => 50, -tabstop => 1, ); sub CB_Change { print "CB Change\n" } sub TX_Change { print "TX Change\n" } $hCB = $mw->cb->{-handle}; $hED = $mw->cb->GetWindow(GW_CHILD); $hTX = $mw->tx->{-handle}; print "Combobox control's handle is $hCB\n"; print "Combobox edit control's handle is $hED\n"; print "Textfield control's handle is $hTX\n"; $mw->tx->Hook(EN_CHANGE,\&TX_Change); Win32::GUI::Hook($hCB,EN_CHANGE,\&CB_Change); $mw->Show(); Win32::GUI::Dialog(); |
From: marco h. <mar...@gm...> - 2007-02-14 10:25:50
|
Thanks a lot, also for your comments on the script. EnsureCellVisible() was exactly that I was looking for. That opens the next door... Regards, Marco Robert May schrieb: > marco hofmann wrote: >> Hello, >> I want to control the Scrollbar in a grid. The aim is to set the focus >> on a defined cell and to move the scrollbar so thats visible. I tried >> the following skript (modified script from the Win32::Gui::Grid) but >> the sequence >> my $Scroll = $Grid->ScaleHeight; >> $Grid->ScrollPos(0,$Scroll/2); >> doesn't work. >> Someone who knows why? > > The ScrollPos() method doesn't do what you seem to think it should. > Win32::GUI::Grid has an EnsureCellVisible() method that ensures the cell > passed is in the visible bit of the window - I think that is what you need. > > Some comments on your original code below, and a complete script at the > end. > > Regards, > Rob. > >> use strict; >> use Win32::GUI(); >> use Win32::GUI::Grid; >> >> sub paintgrid >> { >> my $Grid =${$_[0]}; >> for my $row (0..$Grid->GetRows()) >> { >> for my $col (0..$Grid->GetColumns()) >> { >> if ($row == 0) >> { >> $Grid->SetCellText($row, $col,"Column : $col"); >> } >> elsif ($col == 0) >> { >> $Grid->SetCellText($row, $col, "Row : $row"); >> } >> else >> { >> $Grid->SetCellText($row, $col, "Cell : ($row,$col)"); >> } >> } >> } >> } >> >> >> # main Window >> my $Window = new Win32::GUI::Window ( > > Best not to use indirect method invocation: > my $Window = Win32::GUI::Window->new( > >> -title => "Win32::GUI::Grid", >> -pos => [0, 0], >> -size => [500, 500], >> -name => "Window", >> ) or die "new Window"; >> >> # Grid Window >> my $Grid = $Window->AddGrid( >> -name => "Grid", >> -pos => [0, 40], >> -rows => 50, >> -columns => 10, >> -fixedrows => 1, >> -fixedcolumns => 1, >> -editable => 1, >> -vscroll => 1, >> -hscroll =>1, >> ) or die "new Grid"; >> # Fill Grid > > Nothing broken, but I don't understand why you're using a reference to > $Grid here, as $Grid is already a reference to a Win32::GUI::Grid object. > >> my $ref_Grid = \$Grid; >> paintgrid($ref_Grid); >> > > Your constructor creates a grid with 50 rows and 10 columns. row 3 and > column 30 is outside this range, so the SetFocus() call will do nothing. > >> $Grid->SetFocusCell(3,30); #Set Cell Focus on Row 3, Column 30 >> > > The available scroll range depends entirely on what the class has set up > for it's scrolling parameters, so unless you know the class's innards > you can't scroll this way. > >> # try to scroll to the middle >> my $Scroll = $Grid->ScaleHeight; >> $Grid->ScrollPos(0,$Scroll/2); >> >> # Event loop >> $Window->Show(); >> Win32::GUI::Dialog(); >> # Main window event handler > > If all your _Terminate handler is doing is to return -1; then it's not > necessary (unless you need backwards compatibility with Win32::GUI > earlier than v1.0) > >> sub Window_Terminate { >> return -1; >> } > >> sub Window_Resize { >> my ($width, $height) = ($Window->GetClientRect)[2..3]; >> $Grid->Resize ($width, $height); >> } >> # Grid event handler >> sub Grid_Click { >> my ($col, $row) = @_; >> print "Click on Cell ($col, $row)\n"; >> } > > Here's how I'd do it: > > #!perl -w > use strict; > use warnings; > > use Win32::GUI(); > use Win32::GUI::Grid(); > > # main Window > my $Window = Win32::GUI::Window->new( > -title => "Win32::GUI::Grid", > -size => [500, 500], > -name => "Window", > ) or die "new Window"; > > # Grid Window > my $Grid = $Window->AddGrid( > -name => "Grid", > -pos => [0, 0], > -rows => 50, > -columns => 10, > -fixedrows => 1, > -fixedcolumns => 1, > -editable => 1, > -vscroll => 1, > -hscroll => 1, > ) or die "new Grid"; > > # Fill Grid > fillgrid($Grid); > > $Grid->SetFocusCell(30,3); # Set Cell Focus on Row 30, Column 3 > > # Must show grid before calling EnsureCellVisible(), else crashes > $Window->Show(); > > # Ensure the cell with focus is in visible area > $Grid->EnsureCellVisible($Grid->GetFocusCell()); > > Win32::GUI::Dialog(); > $Window->Hide(); > exit(0); > > # Main window event handler > sub Window_Resize { > $Grid->Resize (($Window->GetClientRect)[2..3]); > return 0; > } > > # Grid event handler > sub Grid_Click { > my ($col, $row) = @_; > print "Click on Cell ($col, $row)\n"; > > return 0; > } > > sub fillgrid { > my ($self) = @_; > > for my $row (0 .. $self->GetRows()) { > for my $col (0 .. $self->GetColumns()) { > if ($row == 0) { > $self->SetCellText($row, $col,"Column : $col"); > } > elsif ($col == 0) { > $self->SetCellText($row, $col, "Row : $row"); > } > else { > $self->SetCellText($row, $col, "Cell : ($row,$col)"); > } > } > } > > return; > } > __END__ > |
From: Robert M. <rm...@po...> - 2007-02-14 02:30:11
|
marco hofmann wrote: > Hello, > I want to control the Scrollbar in a grid. The aim is to set the focus > on a defined cell and to move the scrollbar so thats visible. I tried > the following skript (modified script from the Win32::Gui::Grid) but the > sequence > my $Scroll = $Grid->ScaleHeight; > $Grid->ScrollPos(0,$Scroll/2); > doesn't work. > Someone who knows why? The ScrollPos() method doesn't do what you seem to think it should. Win32::GUI::Grid has an EnsureCellVisible() method that ensures the cell passed is in the visible bit of the window - I think that is what you need. Some comments on your original code below, and a complete script at the end. Regards, Rob. > use strict; > use Win32::GUI(); > use Win32::GUI::Grid; > > sub paintgrid > { > my $Grid =${$_[0]}; > for my $row (0..$Grid->GetRows()) > { > for my $col (0..$Grid->GetColumns()) > { > if ($row == 0) > { > $Grid->SetCellText($row, $col,"Column : $col"); > } > elsif ($col == 0) > { > $Grid->SetCellText($row, $col, "Row : $row"); > } > else > { > $Grid->SetCellText($row, $col, "Cell : ($row,$col)"); > } > } > } > } > > > # main Window > my $Window = new Win32::GUI::Window ( Best not to use indirect method invocation: my $Window = Win32::GUI::Window->new( > -title => "Win32::GUI::Grid", > -pos => [0, 0], > -size => [500, 500], > -name => "Window", > ) or die "new Window"; > > # Grid Window > my $Grid = $Window->AddGrid( > -name => "Grid", > -pos => [0, 40], > -rows => 50, > -columns => 10, > -fixedrows => 1, > -fixedcolumns => 1, > -editable => 1, > -vscroll => 1, > -hscroll =>1, > ) or die "new Grid"; > # Fill Grid Nothing broken, but I don't understand why you're using a reference to $Grid here, as $Grid is already a reference to a Win32::GUI::Grid object. > my $ref_Grid = \$Grid; > paintgrid($ref_Grid); > Your constructor creates a grid with 50 rows and 10 columns. row 3 and column 30 is outside this range, so the SetFocus() call will do nothing. > $Grid->SetFocusCell(3,30); #Set Cell Focus on Row 3, Column 30 > The available scroll range depends entirely on what the class has set up for it's scrolling parameters, so unless you know the class's innards you can't scroll this way. > # try to scroll to the middle > my $Scroll = $Grid->ScaleHeight; > $Grid->ScrollPos(0,$Scroll/2); > > # Event loop > $Window->Show(); > Win32::GUI::Dialog(); > # Main window event handler If all your _Terminate handler is doing is to return -1; then it's not necessary (unless you need backwards compatibility with Win32::GUI earlier than v1.0) > sub Window_Terminate { > return -1; > } > sub Window_Resize { > my ($width, $height) = ($Window->GetClientRect)[2..3]; > $Grid->Resize ($width, $height); > } > # Grid event handler > sub Grid_Click { > my ($col, $row) = @_; > print "Click on Cell ($col, $row)\n"; > } Here's how I'd do it: #!perl -w use strict; use warnings; use Win32::GUI(); use Win32::GUI::Grid(); # main Window my $Window = Win32::GUI::Window->new( -title => "Win32::GUI::Grid", -size => [500, 500], -name => "Window", ) or die "new Window"; # Grid Window my $Grid = $Window->AddGrid( -name => "Grid", -pos => [0, 0], -rows => 50, -columns => 10, -fixedrows => 1, -fixedcolumns => 1, -editable => 1, -vscroll => 1, -hscroll => 1, ) or die "new Grid"; # Fill Grid fillgrid($Grid); $Grid->SetFocusCell(30,3); # Set Cell Focus on Row 30, Column 3 # Must show grid before calling EnsureCellVisible(), else crashes $Window->Show(); # Ensure the cell with focus is in visible area $Grid->EnsureCellVisible($Grid->GetFocusCell()); Win32::GUI::Dialog(); $Window->Hide(); exit(0); # Main window event handler sub Window_Resize { $Grid->Resize (($Window->GetClientRect)[2..3]); return 0; } # Grid event handler sub Grid_Click { my ($col, $row) = @_; print "Click on Cell ($col, $row)\n"; return 0; } sub fillgrid { my ($self) = @_; for my $row (0 .. $self->GetRows()) { for my $col (0 .. $self->GetColumns()) { if ($row == 0) { $self->SetCellText($row, $col,"Column : $col"); } elsif ($col == 0) { $self->SetCellText($row, $col, "Row : $row"); } else { $self->SetCellText($row, $col, "Cell : ($row,$col)"); } } } return; } __END__ |
From: Steve L. <ste...@sc...> - 2007-02-13 19:04:38
|
Thanks for that, I`ll give that a go when I get back to the UK Steve Robert May wrote: > Steve Loughran wrote: >> Does anyone know where I should be looking to determine if the user has >> selected "large" or "very large" fonts in the control panel -> display >> -> appearance settings? > > Various ways, depending exactly what you want to achieve. Here's one > way (although I don't have an OS that supports the 'very large' setting > - XP only I think - so you'll have to see what value you get for that). > > #!perl -w > use strict; > use warnings; > > use Win32::GUI qw(); > > sub LOGPIXELSX() {88} > > # Get the logical pixels per inch in the X direction for > # the default "DISPLAY" device > my $size = Win32::GUI::DC->new()->GetDeviceCaps(LOGPIXELSX); > > if ($size == 96) { # 96 dpi is small system font > print "Small System Font\n"; > } > elsif ($size == 120) { # 120 dpi is large system font > print "Large System Font\n"; > } > else { # All other sizes (on Win98) are called 'Custom' > print "Custom font size: ", $size, "dpi\n"; > } > __END__ > > > Regards, > Rob. > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier. > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > 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: marco h. <mar...@gm...> - 2007-02-13 17:52:31
|
Hello, I want to control the Scrollbar in a grid. The aim is to set the focus on a defined cell and to move the scrollbar so thats visible. I tried the following skript (modified script from the Win32::Gui::Grid) but the sequence my $Scroll = $Grid->ScaleHeight; $Grid->ScrollPos(0,$Scroll/2); doesn't work. Someone who knows why? Thanks, Marco use strict; use Win32::GUI(); use Win32::GUI::Grid; sub paintgrid { my $Grid =${$_[0]}; for my $row (0..$Grid->GetRows()) { for my $col (0..$Grid->GetColumns()) { if ($row == 0) { $Grid->SetCellText($row, $col,"Column : $col"); } elsif ($col == 0) { $Grid->SetCellText($row, $col, "Row : $row"); } else { $Grid->SetCellText($row, $col, "Cell : ($row,$col)"); } } } } # main Window my $Window = new Win32::GUI::Window ( -title => "Win32::GUI::Grid", -pos => [0, 0], -size => [500, 500], -name => "Window", ) or die "new Window"; # Grid Window my $Grid = $Window->AddGrid( -name => "Grid", -pos => [0, 40], -rows => 50, -columns => 10, -fixedrows => 1, -fixedcolumns => 1, -editable => 1, -vscroll => 1, -hscroll =>1, ) or die "new Grid"; # Fill Grid my $ref_Grid = \$Grid; paintgrid($ref_Grid); $Grid->SetFocusCell(3,30); #Set Cell Focus on Row 3, Column 30 # try to scroll to the middle my $Scroll = $Grid->ScaleHeight; $Grid->ScrollPos(0,$Scroll/2); # Event loop $Window->Show(); Win32::GUI::Dialog(); # Main window event handler sub Window_Terminate { return -1; } sub Window_Resize { my ($width, $height) = ($Window->GetClientRect)[2..3]; $Grid->Resize ($width, $height); } # Grid event handler sub Grid_Click { my ($col, $row) = @_; print "Click on Cell ($col, $row)\n"; } |
From: Waldemar B. <wb...@sa...> - 2007-02-12 20:16:41
|
Hello! I've got the following problem: My textfield object has its value which is dynamically determined while the application is running. I can set background of the textfield dependent on the textfield value vary easy: by using Change(...) function. However when I aply the Change function to the -tip=>... option to obtain dynamical help it does not work. In what way I should set -tip dynamically? regards Waldemar |
From: Robert M. <rm...@po...> - 2007-02-12 20:07:45
|
Steve Loughran wrote: > Does anyone know where I should be looking to determine if the user has > selected "large" or "very large" fonts in the control panel -> display > -> appearance settings? Various ways, depending exactly what you want to achieve. Here's one way (although I don't have an OS that supports the 'very large' setting - XP only I think - so you'll have to see what value you get for that). #!perl -w use strict; use warnings; use Win32::GUI qw(); sub LOGPIXELSX() {88} # Get the logical pixels per inch in the X direction for # the default "DISPLAY" device my $size = Win32::GUI::DC->new()->GetDeviceCaps(LOGPIXELSX); if ($size == 96) { # 96 dpi is small system font print "Small System Font\n"; } elsif ($size == 120) { # 120 dpi is large system font print "Large System Font\n"; } else { # All other sizes (on Win98) are called 'Custom' print "Custom font size: ", $size, "dpi\n"; } __END__ Regards, Rob. |