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: Robert M. <rm...@po...> - 2007-01-25 20:04:37
|
alexander Serechenko Alexander wrote: > Is there any way to copy some transparent image over another? > Only way I found is to use AlphaCopyToDC to some virtual DC, but i > can't find any way to get Win32::GUI::DC not associated with any > device. > Is any one can help me? I'm not overly familiar with Win32::GUI::DIBitmap, but the Composite() method looks promising, but I see that it's usage is undocumented - I don't know if there's anyone out there who has used this call that can help? If you do invest the time to work out how to use it, then perhaps you'd submit your findings so that I can fix up that part of the documentation? Regards, Rob. |
From: alexander S. A. <sk...@gm...> - 2007-01-25 16:45:05
|
Is there any way to copy some transparent image over another? Only way I found is to use AlphaCopyToDC to some virtual DC, but i can't find any way to get Win32::GUI::DC not associated with any device. Is any one can help me? Best regards, Alex. |
From: Perl R. <pe...@co...> - 2007-01-20 17:18:58
|
As always, thanks very much for the quick reply and simple solution! Glad to know I wasn't doing something "wrong". Thanks, Rob -----Original Message----- From: Robert May [mailto:rm...@po...] Sent: Saturday, January 20, 2007 7:26 AM To: Perl Rob Cc: Win32 GUI Users Mailing List Subject: Re: [perl-win32-gui-users] How can I get all the contents of a textfield? Perl Rob wrote: > Hi all, > > I'm trying to do something that seems real simple: capture the > contents (all the lines) of a text field and write them to a file. > Since I can't see a more straightforward way of doing this $contents = $textfield->Text(); gets all the text in one go. [snip info about Textfield::GetLine sometimes truncating lines ] > Am I doing something wrong, or is > there perhaps a bug in the GetLine() function of Win32::GUI::Textfield? The GetLine() function is (badly) broken, and I don't see any work-around. Thanks for the report, I will ensure it gets fixed in the next release. Regards, Rob. |
From: Robert M. <rm...@po...> - 2007-01-20 14:26:41
|
Perl Rob wrote: > Hi all, > > I'm trying to do something that seems real simple: capture the contents > (all the lines) of a text field and write them to a file. Since I can't > see a more straightforward way of doing this $contents = $textfield->Text(); gets all the text in one go. [snip info about Textfield::GetLine sometimes truncating lines ] > Am I doing something wrong, or is > there perhaps a bug in the GetLine() function of Win32::GUI::Textfield? The GetLine() function is (badly) broken, and I don't see any work-around. Thanks for the report, I will ensure it gets fixed in the next release. Regards, Rob. |
From: Perl R. <pe...@co...> - 2007-01-20 05:51:56
|
Hi all, I'm trying to do something that seems real simple: capture the contents (all the lines) of a text field and write them to a file. Since I can't see a more straightforward way of doing this, I wrote an algorithm that gets the number of lines in the text field, then gets each line (by its number) and writes it to the file one at a time. However, some lines are being cut off and only partially written to file. For example, if you copy/paste the following three lines into the text field, then the middle line gets cut off for no apparent reason: <tr valign="top"> <td width="45"><img alt="" src="https://www.linvert.com/miscimages/info.gif" border="0" /></td> <td> However, if you copy/paste ONLY the middle line into the textfield, then it doesn't get cut off when written to file! What's even more strange is this: if I copy/paste more lines above and below those three, then less of the middle line gets cut off, but it still gets cut off. And I've found that with some blocks of text, every line gets cut off at the same point. Needless to say, this is really weird. Below is a slimmed down version of the code that reproduces the problem every time (at least on my system). Am I doing something wrong, or is there perhaps a bug in the GetLine() function of Win32::GUI::Textfield? ################################ use strict; use Win32::GUI(); my $number; my $line_number = 0; my $w = Win32::GUI::Window->new( -size => [650,650], -resizable => 0, -hasmaximize => 0, -dialogui => 1, ); my $font = Win32::GUI::Font->new( -name => "Courier New", -size => 8, ); my $textfield = $w->AddTextfield( -multiline => 1, -size => [536,370], -pos => [54,158], -font => $font, -tabstop => 1, -background => [255,255,255], -autovscroll => 1, -vscroll => 1, -hscroll => 1, -wantreturn => 1, ); my $OK = $w->AddButton( -name => 'OK', -text => "OK", -size => [80,25], -pos => [447,582], -ok => 1, -default => 1, -tabstop => 1, ); $w->Center(); $w->Show(); Win32::GUI::Dialog(); sub OK_Click { my $file = "file.txt"; open(FILE, ">>".$file); select(FILE); $number = $textfield->GetLineCount(); while ( $line_number != $number ) { my $line = $textfield->GetLine($line_number); if ( $line_number == 0 ) { print $line; } else { print "\n" . $line; } ++$line_number; } close(FILE); $line_number = 0; } ################################ Thanks, Rob |
From: Waldemar B. <wb...@sa...> - 2007-01-19 22:56:31
|
Robert! Thank you for your explanation. > I don't :-) I think you are missing some of the subtleties of windows > GUI programming. I have to admit... > That depends what you mean by 'does not work'. I agree, it does work. > If you add a menu to the window, I think it becomes a bit more obvious > (code below). Watch the focus move the the menu bar when you press and > release the F10 key. I've seen it. > If you are referring to the Alt+_F4 problem in your previous mail, > then I think it is a Win98 problem. Thank you for all. Waldemar |
From: Robert M. <rm...@po...> - 2007-01-19 20:51:29
|
Waldemar Biernacki wrote: > I think that in Win32::GUI there is a bug. I don't :-) I think you are missing some of the subtleties of windows GUI programming. > When you start the code attached at the end of the mail then you can see > that: > > 1. key F10 does not work. The same is in WinXP and in Win98. That depends what you mean by 'does not work'. F10 is a system-wide accelerator, used to move focus to the menu bar of a window. It never generates a WM_KEYDOWN message (which is what -onKeyDown hooks), but generates WM_SYSKEYDOWN message instead. Alt does the same, as does any Alt+CHAR. > 2. When I did similar program for Win32-Console package it work correctly. The Console and Windows subsystems are very different when it comes to processing key strokes. > 3. The F10 key behavior is funny: it works as a switcher for other Fxx > keys but not for other keys. After pressing F10, when you press a letter key don't you get a beep the first time, and then all keys start working again? > When I press the F10 key 1,3,... (odd number) times then other Fxx keys > don't work. If you add a menu to the window, I think it becomes a bit more obvious (code below). Watch the focus move the the menu bar when you press and release the F10 key. > ----------- > It could seem that it is not important problem. In the case of WinXP the > problem is not big in fact. > Only F10 doesn't work and application works smoothly. > However on Windows98 there is quite serious problem; because the > keyboard answer > is unstable and unpredictible I am facing against the problem: > Is the problem of Windows or Perl itself? If you are referring to the Alt+_F4 problem in your previous mail, then I think it is a Win98 problem. Regards, Rob. #!perl -w use strict; use warnings; use Win32::GUI qw(VK_SHIFT VK_CONTROL VK_MENU); my $menu = Win32::GUI::Menu->new( "File" => "File", ">Exit" => { -name => "Exit", -onClick => sub {-1}, }, ); my $Window = new Win32::GUI::Window ( -size => [200,100], -onKeyDown => \&keydown, -menu => $menu, ); $Window->Show(); Win32::GUI::Dialog(); $Window->Hide(); exit(1); #----------------------------------------- sub keydown { my ($self, $ext, $vkey) = @_; # I'm not interested in seeing the modifier # keys on thier own: return 1 if($vkey == VK_SHIFT or $vkey == VK_CONTROL or $vkey == VK_MENU); print "(virtual) key just pressed: $vkey (" . decode_vk($vkey) . ")\n"; my $modifiers = ""; $modifiers .= "Shift, " if Win32::GUI::GetKeyState(VK_SHIFT); $modifiers .= "Alt, " if Win32::GUI::GetKeyState(VK_MENU); $modifiers .= "Ctrl, " if Win32::GUI::GetKeyState(VK_CONTROL); $modifiers = substr $modifiers, 0, -2; print "modifiers: $modifiers\n"; my $kbd_ref = Win32::GUI::GetKeyboardState(); my $wanted = ""; my $count = 0; for (0 .. 255) { if ($kbd_ref->[$_]) { $wanted .= "$_(".decode_vk($_).")|" ; ++$count; } } $wanted = substr $wanted, 0, -1; print "$count depressed (virtual) keys: $wanted\n\n"; return 1; } #----------------------------------------- my %vk_to_string; sub decode_vk { return $vk_to_string{shift()}; } BEGIN { %vk_to_string = ( 1 => "VK_LBUTTON", 2 => "VK_RBUTTON", 3 => "VK_CANCEL", 4 => "VK_MBUTTON", 5 => "VK_XBUTTON1", 6 => "VK_XBUTTON2", 8 => "VK_BACK", 9 => "VK_TAB", 12 => "VK_CLEAR", 13 => "VK_RETURN", 16 => "VK_SHIFT", 17 => "VK_CONTROL", 18 => "VK_MENU", 19 => "VK_PAUSE", 20 => "VK_CAPITAL", 21 => "VK_HANGEUL", 23 => "VK_JUNJA", 24 => "VK_FINAL", 25 => "VK_KANJI", 27 => "VK_ESCAPE", 28 => "VK_CONVERT", 29 => "VK_NONCONVERT", 30 => "VK_ACCEPT", 31 => "VK_MODECHANGE", 32 => "VK_SPACE", 33 => "VK_PRIOR", 34 => "VK_NEXT", 35 => "VK_END", 36 => "VK_HOME", 37 => "VK_LEFT", 38 => "VK_UP", 39 => "VK_RIGHT", 40 => "VK_DOWN", 41 => "VK_SELECT", 42 => "VK_PRINT", 43 => "VK_EXECUTE", 44 => "VK_SNAPSHOT", 45 => "VK_INSERT", 46 => "VK_DELETE", 47 => "VK_HELP", 48 => "VK_0", 49 => "VK_1", 50 => "VK_2", 51 => "VK_3", 52 => "VK_4", 53 => "VK_5", 54 => "VK_6", 55 => "VK_7", 56 => "VK_8", 57 => "VK_9", 65 => "VK_A", 66 => "VK_B", 67 => "VK_C", 68 => "VK_D", 69 => "VK_E", 70 => "VK_F", 71 => "VK_G", 72 => "VK_H", 73 => "VK_I", 74 => "VK_J", 75 => "VK_K", 76 => "VK_L", 77 => "VK_M", 78 => "VK_N", 79 => "VK_O", 80 => "VK_P", 81 => "VK_Q", 82 => "VK_R", 83 => "VK_S", 84 => "VK_T", 85 => "VK_U", 86 => "VK_V", 87 => "VK_W", 88 => "VK_X", 89 => "VK_Y", 90 => "VK_Z", 91 => "VK_LWIN", 92 => "VK_RWIN", 93 => "VK_APPS", 95 => "VK_SLEEP", 96 => "VK_NUMPAD0", 97 => "VK_NUMPAD1", 98 => "VK_NUMPAD2", 99 => "VK_NUMPAD3", 100 => "VK_NUMPAD4", 101 => "VK_NUMPAD5", 102 => "VK_NUMPAD6", 103 => "VK_NUMPAD7", 104 => "VK_NUMPAD8", 105 => "VK_NUMPAD9", 106 => "VK_MULTIPLY", 107 => "VK_ADD", 108 => "VK_SEPARATOR", 109 => "VK_SUBTRACT", 110 => "VK_DECIMAL", 111 => "VK_DIVIDE", 112 => "VK_F1", 113 => "VK_F2", 114 => "VK_F3", 115 => "VK_F4", 116 => "VK_F5", 117 => "VK_F6", 118 => "VK_F7", 119 => "VK_F8", 120 => "VK_F9", 121 => "VK_F10", 122 => "VK_F11", 123 => "VK_F12", 124 => "VK_F13", 125 => "VK_F14", 126 => "VK_F15", 127 => "VK_F16", 128 => "VK_F17", 129 => "VK_F18", 130 => "VK_F19", 131 => "VK_F20", 132 => "VK_F21", 133 => "VK_F22", 134 => "VK_F23", 135 => "VK_F24", 144 => "VK_NUMLOCK", 145 => "VK_SCROLL", 146 => "VK_OEM_FJ_JISHO", 147 => "VK_OEM_FJ_MASSHOU", 148 => "VK_OEM_FJ_TOUROKU", 149 => "VK_OEM_FJ_LOYA", 150 => "VK_OEM_FJ_ROYA", 160 => "VK_LSHIFT", 161 => "VK_RSHIFT", 162 => "VK_LCONTROL", 163 => "VK_RCONTROL", 164 => "VK_LMENU", 165 => "VK_RMENU", 166 => "VK_BROWSER_BACK", 167 => "VK_BROWSER_FORWARD", 168 => "VK_BROWSER_REFRESH", 169 => "VK_BROWSER_STOP", 170 => "VK_BROWSER_SEARCH", 171 => "VK_BROWSER_FAVORITES", 172 => "VK_BROWSER_HOME", 173 => "VK_VOLUME_MUTE", 174 => "VK_VOLUME_DOWN", 175 => "VK_VOLUME_UP", 176 => "VK_MEDIA_NEXT_TRACK", 177 => "VK_MEDIA_PREV_TRACK", 178 => "VK_MEDIA_STOP", 179 => "VK_MEDIA_PLAY_PAUSE", 180 => "VK_LAUNCH_MAIL", 181 => "VK_LAUNCH_MEDIA_SELECT", 182 => "VK_LAUNCH_APP1", 183 => "VK_LAUNCH_APP2", 186 => "VK_OEM_1", 187 => "VK_OEM_PLUS", 188 => "VK_OEM_COMMA", 189 => "VK_OEM_MINUS", 190 => "VK_OEM_PERIOD", 191 => "VK_OEM_2", 192 => "VK_OEM_3", 219 => "VK_OEM_4", 220 => "VK_OEM_5", 221 => "VK_OEM_6", 222 => "VK_OEM_7", 223 => "VK_OEM_8", 225 => "VK_OEM_AX", 226 => "VK_OEM_102", 227 => "VK_ICO_HELP", 228 => "VK_ICO_00", 229 => "VK_PROCESSKEY", 230 => "VK_ICO_CLEAR", 231 => "VK_PACKET", 233 => "VK_OEM_RESET", 234 => "VK_OEM_JUMP", 235 => "VK_OEM_PA1", 236 => "VK_OEM_PA2", 237 => "VK_OEM_PA3", 238 => "VK_OEM_WSCTRL", 239 => "VK_OEM_CUSEL", 240 => "VK_OEM_ATTN", 241 => "VK_OEM_FINISH", 242 => "VK_OEM_COPY", 243 => "VK_OEM_AUTO", 244 => "VK_OEM_ENLW", 245 => "VK_OEM_BACKTAB", 246 => "VK_ATTN", 247 => "VK_CRSEL", 248 => "VK_EXSEL", 249 => "VK_EREOF", 250 => "VK_PLAY", 251 => "VK_ZOOM", 252 => "VK_NONAME", 253 => "VK_PA1", 254 => "VK_OEM_CLEAR", ); } #BEGIN __END__ |
From: Robert M. <rm...@po...> - 2007-01-19 19:58:40
|
Waldemar Biernacki wrote: > Robert May wrote: >> I don't have both systems. What is different between them? > The problem is that one perl script gives different outputs on different > Windows versions: XP and 98(SE). > Both systems have Perl 5.8.817 (ActiveState) and Win32-GUI 1.05 > (installed from ppd). > I rewrote the console outputs from both systems (after perl application > started then > I pressed 5 keys Down,a,Right,a,Up): [snip] > ------------------------------------------------------- > However on Windows 98 (SE) when I start the program on the system which > is just started then at the first time > I have the same as in XP: > but at second and next times I have the following output: > ================= > c:\apps\test_kbd.pl > 40|115|F4 > 65|115|F4 > 39|115|F4 > 65|115|F4 > 38|115|F4 > ================= > and it is repeatable. > > Is my problem clearer for you? Much clearer. You omitted that it only happens after you exit the application using Alt+F4 - you can run it successfully as many times as you want if you exit using the mouse. I can repeat this on Win98. I've not looked into it very hard, and can't explain why GetKeyboardState() is saying that the F4 key is pressed when it is not - GetKeyState(VK_F4) shows the same behaviour too. I'm going to put this down to a Win98 problem - it happens even if I start notepad, exit notepad using Alt+F4 and then run the script. Regards, Rob. |
From: Waldemar B. <wb...@sa...> - 2007-01-19 08:01:56
|
I think that in Win32::GUI there is a bug. When you start the code attached at the end of the mail then you can see that: 1. key F10 does not work. The same is in WinXP and in Win98. 2. When I did similar program for Win32-Console package it work correctly. 3. The F10 key behavior is funny: it works as a switcher for other Fxx keys but not for other keys. When I press the F10 key 1,3,... (odd number) times then other Fxx keys don't work. I use Perl 5.8.817 - Activestate, Win32-GUI 1.05 I've checked it also with 1.03 version of Win32-GUI - the same result ----------- It could seem that it is not important problem. In the case of WinXP the problem is not big in fact. Only F10 doesn't work and application works smoothly. However on Windows98 there is quite serious problem; because the keyboard answer is unstable and unpredictible I am facing against the problem: Is the problem of Windows or Perl itself? No! Other software, like Win32-Console works properly. Is it solution to the problem. ############################################### #!/usr/bin/perl -w use strict; use warnings; use Win32::GUI qw(); my $Window = new Win32::GUI::Window ( -name => "Window", -pos => [0,0], -size => [200,100], -onTerminate => sub { return -1 }, ); $Window->AddTextfield( -name => "Pole", -pos => [0,0], -size => [800,600], -onKeyDown => \&keydown, ); $Window->Pole->Text("Exit = Alt+F4"); $Window->Pole->SetFocus(); $Window->Show(); Win32::GUI::Dialog(); exit(1); #----------------------------------------- sub keydown { my $hasz = Win32::GUI::GetKeyboardState(); for ( my $i = 0; $i < 256; $i++ ) { print $i,'|' if $hasz->[$i] } print "\n"; return 1; } ############################################### |
From: Waldemar B. <wb...@sa...> - 2007-01-18 22:28:28
|
Robert May wrote: > I don't have both systems. What is different between them? The problem is that one perl script gives different outputs on different Windows versions: XP and 98(SE). Both systems have Perl 5.8.817 (ActiveState) and Win32-GUI 1.05 (installed from ppd). I rewrote the console outputs from both systems (after perl application started then I pressed 5 keys Down,a,Right,a,Up): in Windows XP (SP1): ================= c:\apps\test_kbd.pl 40|Down 65|a 39|Right 65|a 38|Up ================= and this is repeatable each time: ================= c:\apps\test_kbd.pl 40|Down 65|a 39|Right 65|a 38|Up ================= and any time I start the program it works the same. ------------------------------------------------------- However on Windows 98 (SE) when I start the program on the system which is just started then at the first time I have the same as in XP: ================= c:\apps\test_kbd.pl 40|Down 65|a 39|Right 65|a 38|Up ================= but at second and next times I have the following output: ================= c:\apps\test_kbd.pl 40|115|F4 65|115|F4 39|115|F4 65|115|F4 38|115|F4 ================= and it is repeatable. Is my problem clearer for you? I can add that this effect I've got on "true" machine with Windows 98 but also on vmware machine emulation. Any suggestions? wb |
From: Robert M. <rm...@po...> - 2007-01-18 20:23:39
|
Stefan Behrendt wrote: > Hi, > > I have a couple of questions: > > 1. How do I change or remove the icon of a window? Try $Window->SetIcon($icon) > 2. Is it possible to start a Win32::GUI app. in an other programm wich > is running in fullscreen? I expect so. You probably won't see anything though. What happened when you tried? > 3. How do I change the colors of the titlebar, scrollbar(s), From the Control panel: Display Properties->Appearance Tab. > textfields (background), etc.? For the textfield, look up the -background option. > 4. I want that the second textfield is always at the bottom of the > window, and that only the width is resizeable, not the height! So only change the width: #!perl -w use strict; use warnings; use Win32::GUI 1.05 qw(WS_CLIPCHILDREN); my $height_of_edit2 = 24; my $mw = Win32::GUI::Window->new( -name => "Window", -title => "W", -pos => [100, 100], -size => [400, 400], -onResize => \&resize, -addstyle => WS_CLIPCHILDREN, # Reduce redraw flicker ); $mw->AddTextfield( -name => "Edit", -multiline => 1, -vscroll => 1, -autovscroll => 1, ); $mw->AddTextfield( -name => "Edit2", -autovscroll => 1, ); $mw->Show(); Win32::GUI::Dialog(); $mw->Hide(); exit(0); sub resize { my ($self) = @_; my ($width, $height) = ($self->GetClientRect())[2..3]; $self->Edit->Resize($width, $height - $height_of_edit2); $self->Edit2->Move(0, $height - $height_of_edit2); $self->Edit2->Resize($width, $height_of_edit2); return 0; } __END__ Regards, Rob. |
From: Robert M. <rm...@po...> - 2007-01-18 20:09:26
|
Waldemar Biernacki wrote: > Hello! > > Maybe you could me help? > > I have the code (read later please). What is my problem? I don't know. > The aim of the program is to catch keyboard events and write them into string > named $_EVENT. However it works different in WindowsXP (correctly I think) > and in Windows98 (wrong). It can be seen in console printouts on the both > systems. I don't have both systems. What is different between them? > In windows 98 I notice the application with this "catching" stops with errors > which point to Dialog function. In Windows XP everything is allright. What errors? What version of perl? What version of Win32::GUI? The code you posted appears to work OK for me on both Win98 and Win2k (i.e. it does what I would expect it to) - but as I don't know what I am looking for I may be missing your point. Regards, Rob. |
From: Waldemar B. <wb...@sa...> - 2007-01-18 16:16:25
|
Hello! Maybe you could me help? I have the code (read later please). What is my problem? The aim of the program is to catch keyboard events and write them into string named $_EVENT. However it works different in WindowsXP (correctly I think) and in Windows98 (wrong). It can be seen in console printouts on the both systems. In windows 98 I notice the application with this "catching" stops with errors which point to Dialog function. In Windows XP everything is allright. cheers Waldemar =============================================================================================== #!/usr/bin/perl -w use strict; use Win32::GUI qw(); my $_EVENT = ''; my $Window = new Win32::GUI::Window ( -name => "Window", -pos => [0,0], -size => [200,100], -onResize => sub { my ($self) = @_; my ($width,$height) = ($self->GetClientRect())[2..3]; $self->Pole->Resize($width+1, $height+1) if exists $self->{Pole};}, -onKeyDown => \&keydown, -onTerminate => sub { return -1 }, ); $Window->AddTextfield( -name => "Pole", -pos => [0,0], -size => [800,600], -onKeyDown => \&keydown, ); $Window->Pole->Text(""); $Window->Pole->Append("Exit = Alt+F4"); $Window->Pole->SetFocus(); $Window->Show(); Win32::GUI::Dialog(); ########################################################################## #--------------------------------------------- sub keydown { my ( $self, undef, $key ) = @_; my $hash_EVENT = Win32::GUI::GetKeyboardState; $_EVENT = what_event( $hash_EVENT ); print $_EVENT,"|\n"; return 1; } #--------------------------------------------- sub what_event { my $_EVENT = shift; my $result = ''; my $SHIFT = ''; my $CTRL = ''; my $ALT = ''; if (( $_EVENT->[160] )||( $_EVENT->[161] )) { $SHIFT = 'Shift' } if (( $_EVENT->[162] )||( $_EVENT->[163] )) { $CTRL = 'Ctrl' } if (( $_EVENT->[164] )||( $_EVENT->[165] )) { $ALT = 'Alt' } if (( $_EVENT->[16] )) { $SHIFT = 'Shift' } if (( $_EVENT->[17] )) { $CTRL = 'Ctrl' } if (( $_EVENT->[18] )) { $ALT = 'Alt' } for ( my $i = 0; $i < 256; $i++ ) { if ( $_EVENT->[$i] ) { print $i,'|'; if ( $i == 0 ) { $result .= 'Null' } elsif ( $i == 8 ) { $result = 'Backspace' } elsif ( $i == 9 ) { $result = $CTRL.$SHIFT.'Tab' } elsif ( $i == 13 ) { $result = $CTRL.$SHIFT.'Enter' } elsif ( $i == 27 ) { $result = $CTRL.$SHIFT.'Escape' } elsif ( $i == 33 ) { $result = $CTRL.$SHIFT.'PgUp' } elsif ( $i == 34 ) { $result = $CTRL.$SHIFT.'PgDn' } elsif ( $i == 36 ) { $result = $CTRL.$SHIFT.'Home' } elsif ( $i == 35 ) { $result = $CTRL.$SHIFT.'End' } elsif ( $i == 38 ) { $result = $CTRL.$SHIFT.'Up' } elsif ( $i == 37 ) { $result = $CTRL.$SHIFT.'Left' } elsif ( $i == 39 ) { $result = $CTRL.$SHIFT.'Right' } elsif ( $i == 40 ) { $result = $CTRL.$SHIFT.'Down' } elsif ( $i == 45 ) { $result = $CTRL.$SHIFT.'Insert' } elsif ( $i == 46 ) { $result = $CTRL.$SHIFT.'Delete' } elsif (( 47 < $i )&&( $i < 58 )) { $result = $CTRL.$SHIFT.chr( $i ) } elsif (( 64 < $i )&&( $i < 91 )) { my $shift = 0; $shift = 32 if (( $SHIFT eq 'Shift' )||( $CTRL eq 'Ctrl' )); $result = $CTRL.$ALT.chr( $i + 32 - $shift ) } elsif (( 111 < $i )&&( $i < 124 )) { $result = $ALT.$CTRL.$SHIFT.'F'.($i-111); } else { if (( $i != 160 )&&( $i != 161 )&&( $i != 16 )&& ( $i != 162 )&&( $i != 163 )&&( $i != 17 )&& ( $i != 164 )&&( $i != 165 )&&( $i != 18 )) { } } } } return $result; } =============================================================================================== |
From: Stefan B. <te...@go...> - 2007-01-16 03:29:06
|
Hi, I have a couple of questions: 1. How do I change or remove the icon of a window? 2. Is it possible to start a Win32::GUI app. in an other programm wich is running in fullscreen? 3. How do I change the colors of the titlebar, scrollbar(s), textfields (background), etc.? 4. I want that the second textfield is always at the bottom of the window, and that only the width is resizeable, not the height! $W = new Win32::GUI::Window ( -name => "Window", -title => "W", -pos => [100, 100], -size => [400, 400], -onResize => \&resize, ); $W->AddTextfield( -name => "Edit", -pos => [0, 0], -size => [100, 100], -multiline => 1, -vscroll => 1, -autovscroll => 1, -keepselection => 1 , -readonly => 1, ); $W->AddTextfield( -name => "Edit2", -pos => [0, 0], -size => [100, 24], -autovscroll => 1, -keepselection => 1, ); sub resize { my ($self) = @_; my ($width, $height) = ($self->GetClientRect())[2..3]; $self->Edit->Resize($width+1, $height+1) if exists $self->{Edit}; # $self->Edit2->Resize(....... ... ... ... .. ) ... ... } Example: ________________ | | | | <------- Textfield 1 | | |________________| |________________| <------- Textfield 2 (always at the bottom, and only the width is resizeable) |
From: Eric N. <er...@di...> - 2007-01-15 19:45:05
|
I'm using Win32::Grid and trying to set a decimal number in a cell. It w= orks fine if you are using the United States formats but if you switch to Swed= ish you get all zeros. I was setting it using setCellText and learned setCel= lData was the preferred way to pass a numeric to a cell. I cannot find any documentation on what an lparam is. Can someone give m= e an example of how to use setCellData to set a long value? Many Thanks E. |
From: Geoffrey S. <geo...@gm...> - 2007-01-10 17:57:18
|
I've got an MDIChild window created with -onTerminate => \&closeChild in its options. When the X box is clicked on the window, closeChild runs fine and then the window closes. However, if I close it by sending $client->Close($child);, the window closes *without* closeChild being called at all. >From Microsoft's documentation, it appears that this is a bug (i.e., the expected behavior is that MDIClient's Close method should do the exact same thing as clicking the Close box on the child window). Can anyone come up with a workaround for this? As it is, if I close my whole application, it shuts down without the MDIChildren getting a chance to object (if they contain unsaved data), and the "Close All" menu item I'm trying to add leads to potentially losing data as well. Thanks, -- Geoffrey Spear http://www.geoffreyspear.com/ |
From: Robert M. <rm...@po...> - 2007-01-09 22:49:53
|
Guojun Yang wrote: > I print a graphic on a window, but when I resize the window smaller than > the image the image content outside of the window frame is gone even > after I size it back to the original size. Can anyone suggest a > solution?Thanks, Without any code it's difficult to help you. I suspect that you haven't get understood how drawing on windows works: I expect that you'll find the drawing that you have done will disappear if you move another window over the front of your window, or minimise and restore your window, or do anything else that results in the window re-painting. You probably need to be doing your drawing in a the _Paint event handler. If you post a *short* and *complete* example showing what you have tried, then I'm sure that there are plenty of people who will help. Regards, Rob. |
From: Shoxin <ak...@ho...> - 2007-01-09 20:27:47
|
hey guys, ok ive tried everything to install win32::gui on my windows xp cpu apparently the ppm install ./win32-gui and it says "Error: connect: Unknown error" could someone please fill me in on how to solve this problem?? -- View this message in context: http://www.nabble.com/Installation-errors-tf2948451.html#a8245501 Sent from the perl-win32-gui-users mailing list archive at Nabble.com. |
From: Charles A. <cha...@al...> - 2007-01-09 19:16:12
|
How about: my $win = Win32::GUI::Window->new( -name => 'etc...', -minwidth => $fill_in_with_image_width, -minheight => $fill_in_with_image_height, ); Now you won't have to worry about the image going away. (You could also look into redrawing the image on a Resize event). Thanks, Charles Alderman Quoting Guojun Yang <gy...@pl...>: > Hi, all, > I print a graphic on a window, but when I resize the window smaller > than the image the image content outside of the window frame is gone > even after I size it back to the original size. Can anyone suggest > a solution?Thanks, > Guojun |
From: Guojun Y. <gy...@pl...> - 2007-01-09 18:55:20
|
Hi, all, =20 I print a graphic on a window, but when I resize the window smaller than= the image the image content outside of the window frame is gone even af= ter I size it back to the original size. Can anyone suggest a solution= =3FThanks, =20 Guojun |
From: Leif A. <Lei...@su...> - 2007-01-09 14:23:50
|
Robert May wrote: > Recommended: Use the UserData() method - this is exactly what this=20 > method is intended for: > > $object->UserData($whatever); # store scalar with object > my $w =3D $object->UserData(); # retrieve previously stored scalar Thank you very much. UserData() seems to be the way to go! /Leif |
From: Robert M. <rm...@po...> - 2007-01-08 22:34:23
|
Leif Andersson wrote: >> But there is no GetName() method for the button object (or indeed any >> Win32::GUI object). Slightly naughty, and I shouldn't be encouraging >> this [1], but the object's name is stored in it's '-name' hash slot, > so >> you can replace: >> print $self->GetName(), "\n"; >> with >> print $self->{-name}, "\n"; > > A handful of the attributes used to define the object seems available in > this (unrecommended) manner. > > But is it possible to add attributes? Not recommended: add your attributes to the object's hash. $object->{-parent} = $whatever; Recommended: Use the UserData() method - this is exactly what this method is intended for: $object->UserData($whatever); # store scalar with object my $w = $object->UserData(); # retrieve previously stored scalar Regards, Rob. |
From: Leif A. <Lei...@su...> - 2007-01-08 21:07:19
|
> But there is no GetName() method for the button object (or indeed any=20 > Win32::GUI object). Slightly naughty, and I shouldn't be encouraging=20 > this [1], but the object's name is stored in it's '-name' hash slot, so=20 > you can replace: > print $self->GetName(), "\n"; > with > print $self->{-name}, "\n"; A handful of the attributes used to define the object seems available in this (unrecommended) manner. But is it possible to add attributes? Like for instance if I would like to store information about a widgets parent? I can not simply say $main->AddButton( -name =3D> 'btOK', -parent =3D> $main, ... Perl will not be complaining, but I can not retrieve the information later. And why do I want to do this? Maybe because I, very often, find myself thinking along the lines of DOM (Document Object Model), familiar to web developers. /Leif |
From: Robert M. <rm...@po...> - 2007-01-08 19:43:26
|
Perl Rob wrote: [slightly edited] > foreach ( @button_names ) { > my ($name) = $_; > $main->AddButton( > -name => $name, > -text => $name, > -onClick => sub { Button_Clicked ( $name ) }, ... > ); > } > > sub Button_Clicked { > print "Your name is " . $_[0]; > } So, what you're really like is: foreach (@button_names) { $main->AddButton( -name => $_, -text => $_, -onClick => \&clicked, ... ); # NEM callback sub clicked { my ($self) = @_; print $self->GetName(), "\n"; return 1; } But there is no GetName() method for the button object (or indeed any Win32::GUI object). Slightly naughty, and I shouldn't be encouraging this [1], but the object's name is stored in it's '-name' hash slot, so you can replace: print $self->GetName(), "\n"; with print $self->{-name}, "\n"; And get what you want without the closures. But why do you need the name, given that the NEM callback gives you the object reference as first parameter? Regards, Rob. [1] Accessing an object's internal state by any mechanism other than an accessor method should be strongly discouraged, as it breaks the OO encapsulation. |
From: Jonathan E. <Jon...@ni...> - 2007-01-08 19:35:15
|
ActiveState provides commercial tools to do this, PerlCOM and PerlCtrl. And here are some Perl links: http://ftp.activestate.com/unsupported/PDK/release.htm http://www.mkssoftware.com/docs/man5/perlcom.5.asp http://burningbird.net/devaspcomp/bonus/perl.htm http://www.foo.be/docs/tpj/issues/vol3_3/tpj0303-0008.html http://www.windowsitpro.com/Article/ArticleID/3928/3928.html I haven't used these. But I have used corresponding (free) tools in Python ... for some reason this is one of the few areas (IMHO) where Python's tools are more advanced than Perl's. Here's a link to a great book which includes a lot of info on this subject. It's even worth reading if you plan to do this in Perl. http://www.oreilly.com/catalog/pythonwin32/ HTH, Jonathan At 11:31 AM 1/8/2007, Steve Loughran wrote: >Slightly off-topic, but is it possible to write standalone (dll or ocx) >ActiveX modules in win32 perl? (And I dont mean show them in perl using >AXWindow). Or should I just stick with VB6 for that? > >Any helpful hints or tips would be gratefully received, especially from >anyone who has actually done this (or still doing it) > >Steve |