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: Jeremy W. <jez...@ho...> - 2009-01-15 23:40:05
|
Hi,
I've had crashes before - some related to systray. Make sure you are using the latest version of both Win32::GUI, PerlApp (7.3) and Perl (5.8.7+). I've had some issues (crashes and silent exits) with PerlApp under Vista (fine under XP) but they have all been fixed in the latest version. Drop me a mail off list if this doesn't solve things.
Cheers,
Jeremy.
> Date: Thu, 15 Jan 2009 15:03:05 -0800
> From: ja...@mo...
> To: per...@li...
> Subject: [perl-win32-gui-users] crashes in GUI.dll?
>
> Hi,
>
> I have a large ActiveState Perl 5.8 application, compiled to .exe
> using their PDK. It uses a system tray icon to advertise its state
> while it's running, using balloon tips. Sometimes, on some systems, it
> crashes in GUI.dll. I have not been able to replicate or diagnose the
> issue, and I'm hoping for some pointers for what might cause it. Not
> using the system tray icon does appear to make the crashes stop.
> Here's the systray subroutines:
>
> ## System tray icon subroutines ###############################################
> sub EnableSystray {
> $systrayicon = new Win32::GUI::Icon('ldms_core.ico');
> $systraymain = Win32::GUI::Window->new(
> -name => 'ldms_core_systray',
> -text => 'ldms_core_systray',
> -width => 20,
> -height => 20,
> -visible => 0,
> );
> $systraymain->Enable();
> $popupMenu = Win32::GUI::Menu->new(
> "Options" => "Options",
> ">Manual" => {
> -name => "Manual",
> -onClick => sub {
> open_browser(
> 'http://www.droppedpackets.org/scripts/ldms_core/ldms_core-manual'
> );
> }
> },
> ">EventViewer" => {
> -name => "Event Viewer",
> -onClick => \&Eventvwr
> },
> ">Exit" => {
> -name => "Exit",
> -onClick => \&systrayexit
> }
> );
> $systraynotify = $systraymain->AddNotifyIcon(
> -name => "ldms_core_systray",
> -icon => $systrayicon,
> -tip => "$prog $VERSION running\n",
> -balloon_icon => "info",
> -onClick => \&systraymenu,
> -onRightClick => \&systraymenu,
>
> );
> return 0;
> }
>
> sub ChangeBalloon {
>
> # Is the user trying to kill us?
> Win32::GUI::DoEvents() >= 0 or &LogDie("Killed by user.");
>
> # If systray support is off, just leave now
> if ( $showsystray == 0 ) { return 0; }
>
> # item can be title or tip
> # icon is fixed as "info"
> my $item = shift;
> my $value = shift;
> $systraynotify->Change( "-balloon_$item" => $value );
>
> # this is to change the hovering tooltip
> $systraynotify->Change( -tip => $value, );
> $systraynotify->ShowBalloon(0);
> $systraynotify->ShowBalloon(1);
> return 0;
> }
>
> sub systraymain_Terminate {
> &LogDie("Killed by user");
> return 0;
> }
>
> sub systraymenu {
> $systraymain->TrackPopupMenu( $popupMenu->{Options} );
> return 1;
> }
>
> sub Eventvwr {
> system("eventvwr.msc");
> return 0;
> }
>
> sub systrayexit {
> &LogDie("Killed by user");
> return 0;
> }
>
>
> --
> "I spent all me tin with the ladies drinking gin,
> So across the Western ocean I must wander" -- traditional
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Per...@li...
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
_________________________________________________________________
Choose the perfect PC or mobile phone for you
http://clk.atdmt.com/UKM/go/130777504/direct/01/ |
|
From: Jack C. <ja...@mo...> - 2009-01-15 23:03:16
|
Hi,
I have a large ActiveState Perl 5.8 application, compiled to .exe
using their PDK. It uses a system tray icon to advertise its state
while it's running, using balloon tips. Sometimes, on some systems, it
crashes in GUI.dll. I have not been able to replicate or diagnose the
issue, and I'm hoping for some pointers for what might cause it. Not
using the system tray icon does appear to make the crashes stop.
Here's the systray subroutines:
## System tray icon subroutines ###############################################
sub EnableSystray {
$systrayicon = new Win32::GUI::Icon('ldms_core.ico');
$systraymain = Win32::GUI::Window->new(
-name => 'ldms_core_systray',
-text => 'ldms_core_systray',
-width => 20,
-height => 20,
-visible => 0,
);
$systraymain->Enable();
$popupMenu = Win32::GUI::Menu->new(
"Options" => "Options",
">Manual" => {
-name => "Manual",
-onClick => sub {
open_browser(
'http://www.droppedpackets.org/scripts/ldms_core/ldms_core-manual'
);
}
},
">EventViewer" => {
-name => "Event Viewer",
-onClick => \&Eventvwr
},
">Exit" => {
-name => "Exit",
-onClick => \&systrayexit
}
);
$systraynotify = $systraymain->AddNotifyIcon(
-name => "ldms_core_systray",
-icon => $systrayicon,
-tip => "$prog $VERSION running\n",
-balloon_icon => "info",
-onClick => \&systraymenu,
-onRightClick => \&systraymenu,
);
return 0;
}
sub ChangeBalloon {
# Is the user trying to kill us?
Win32::GUI::DoEvents() >= 0 or &LogDie("Killed by user.");
# If systray support is off, just leave now
if ( $showsystray == 0 ) { return 0; }
# item can be title or tip
# icon is fixed as "info"
my $item = shift;
my $value = shift;
$systraynotify->Change( "-balloon_$item" => $value );
# this is to change the hovering tooltip
$systraynotify->Change( -tip => $value, );
$systraynotify->ShowBalloon(0);
$systraynotify->ShowBalloon(1);
return 0;
}
sub systraymain_Terminate {
&LogDie("Killed by user");
return 0;
}
sub systraymenu {
$systraymain->TrackPopupMenu( $popupMenu->{Options} );
return 1;
}
sub Eventvwr {
system("eventvwr.msc");
return 0;
}
sub systrayexit {
&LogDie("Killed by user");
return 0;
}
--
"I spent all me tin with the ladies drinking gin,
So across the Western ocean I must wander" -- traditional
|
|
From: Jeremy W. <jez...@ho...> - 2009-01-11 19:35:58
|
> # Begin button row
> $btn_DBWindowDefault = $DBWindow->AddButton(
> -name => 'DBWindowDefault',
> -text => 'Ok',
> -tabstop => 1,
> -default => 1, # Give button darker border
> -ok => 1, # press 'Return' to click this button
> -pos => [ 25, $nexthoriz += 25 ],
> -size => [ 60, 20 ],
> );
> ...
> $DBWindowsb = $DBWindow->AddStatusBar();
> ...
> # Resize, position and display
> $DBWindow->Resize( $w, $h );
> $DBWindow->Move( $wx, $wy );
>
> $DBWindow->Show();
> return 0;
> }
> ...
> # What to do when the button is clicked #######################################
> sub DBWindowDefault_Click {
> ...
> return 0;
> }
>
> I'm just adding "package ldms_core;" at the top and "1;__END__" at the
> bottom. Any ideas?
Hi,
You are using the OEM (Old Event Model) where Win32::GUI assumes the event handlers are in the "main" name space. When you add a package to surround your code the sub DBWindowDefault_Click is actually ldms_core::DBWindowDefault_Click and therefore nothing is called when the event is fired (as Win32::GUI calls ::DBWindowDefault_Click) . If you want to use packages to encapsulate (which is the way to go IMHO) then you really need to use the NEM (New Event Model) where you specify a sub reference to the event handle on the creation of the object (or add it later). Alternatively, add "::" to the events which force them to be in the main name space.
Cheers,
Jeremy.
_________________________________________________________________
Imagine a life without walls. See the possibilities
http://clk.atdmt.com/UKM/go/122465943/direct/01/ |
|
From: Jack C. <ja...@mo...> - 2009-01-11 19:21:24
|
Hi,
I have a fairly large (>5K loc) Perl program that has a Windows UI.
I've been applying Perl::Critic recommendations to it, but packaging
the code breaks the UI (the buttons quit working and the scrollbar
disappears). Here's a sample:
sub DBWindow_Show {
...
# build window
$DBWindow = Win32::GUI::Window->new(
-name => 'DBWindow',
-text => 'ldms_core database setup',
-class => $ldms_core_class,
-dialogui => 1,
);
...
# Begin button row
$btn_DBWindowDefault = $DBWindow->AddButton(
-name => 'DBWindowDefault',
-text => 'Ok',
-tabstop => 1,
-default => 1, # Give button darker border
-ok => 1, # press 'Return' to click this button
-pos => [ 25, $nexthoriz += 25 ],
-size => [ 60, 20 ],
);
...
$DBWindowsb = $DBWindow->AddStatusBar();
...
# Resize, position and display
$DBWindow->Resize( $w, $h );
$DBWindow->Move( $wx, $wy );
$DBWindow->Show();
return 0;
}
...
# What to do when the button is clicked #######################################
sub DBWindowDefault_Click {
...
return 0;
}
I'm just adding "package ldms_core;" at the top and "1;__END__" at the
bottom. Any ideas?
thanks,
--
"I spent all me tin with the ladies drinking gin,
So across the Western ocean I must wander" -- traditional
|
|
From: Brian S. <br...@ic...> - 2008-12-23 23:03:13
|
Sean,
Many thanks for your help in pointing me in the right direction!!
Here's the partial code listing I got working.
use constant DIR_NORMALFILES => \&H0;
~
~
~
sub AddItemsToListBox1{
my $dir = "C:/*.*";
my $result=Win32::GUI::Listbox::Dir($Listbox1, $dir ,
DIR_NORMALFILES);
}
Notes:
It turns out that the VB method DirDlgList is not an issue at all, nor do I
need to use AddFile to populate the Listbox after calling ListBox::Dir.
However, the constants that you found do not seem to work. The constants
defined in http://www.vbexplorer.com/VBExplorer/SourceCode/vbs_fd.asp#tip1
as written by Gordon F. MacLeod for Visual Basic do seem to work:
' Note**, The author defined these constants, so you
' won't find them in API documentation, although they
' are based on values used with LB_DIR.
Global Const WM_USER = &H400
Global Const LB_DIR = (WM_USER + 14)
Global Const DIR_NORMALFILES = &H0
Global Const DIR_READONLY = &H8001
Global Const DIR_HIDDEN = &H8002
Global Const DIR_SYSTEM = &H8004
Global Const DIR_DIRECTORIES = &H8010
Global Const DIR_ARCHIVED = &H8020
Global Const DIR_DRIVES = &HC000
Thanks,
Brian
------------------------------
Message: 2
Date: Mon, 15 Dec 2008 17:08:07 +0100
From: Sean Healy <jal...@ho...>
Subject: Re: [perl-win32-gui-users] Filling Listbox with Dir and
AddFile
To: per...@li...
Message-ID: <COL...@ph...>
Content-Type: text/plain; charset=windows-1252; format=flowed
Brian Somers wrote:
> Basically, I?m trying to implement a dual listbox interface quite
> similar to what Eric Hansen wrote about in 1999. What I can?t find
> anywhere is how to fill the left listbox with the files in a given
> directory, although the closest I found was a tutorial in VB out on the
> web. I?m trying to use the methods Dir and AddFile, but something?s not
> working. I can?t figure out what the Dir method is supposed to return,
> nor what parameters/arguments to send. I try AddFile and my app crashes.
> I can make AddString work, though.
MSDN is your friend!
(Seriously, MSDN is your best bet for figuring out undocumented
Win32::GUI methods.)
AddFile($path)
http://msdn.microsoft.com/en-us/library/bb775165(VS.85).aspx
Take note: "The list box to which lParam is added must have been filled
by the DlgDirList function." This is presumably why you're crashing
Unfortunately, however, Win32::GUI does not expose the DlgDirList
function to Perl. (At least, a search of the source files does not find
"DlgDirList".)
Dir($path, $flags)
http://msdn.microsoft.com/en-us/library/bb775185(VS.85).aspx
Some notes:
2) The order of parameters is swapped in Win32::GUI.
3) The constants don't seem to be available via Win32::GUI::Constants,
so here they are:
DDL_READWRITE = 0x00
DDL_READONLY = 0x01
DDL_HIDDEN = 0x02
DDL_SYSTEM = 0x04
DDL_DIRECTORY = 0x10
DDL_ARCHIVE = 0x20
DDL_DRIVES = 0x4000
DDL_EXCLUSIVE = 0x8000
(I hope these are correct - I found them on the web and haven't tested
them.)
|
|
From: Ashrien <as...@es...> - 2008-12-20 03:15:48
|
With the Generic_Paint method shown below, how would I 'skip' painting
things like ComboBox controls (by skip I mean pass painting back to Windows
or Win32::GUI)
I don't know of a way to paint specific controls like that, which is why I
hadn't gone farther down that road.
On Fri, 19 Dec 2008 10:50:35 +0000, Jeremy White <jez...@ho...>
wrote:
>
> Rather than a graphic, try using a normal window that's created as a
child
> window. I do the following to draw various charts:
>
> $newwindow = new Win32::GUI::Window (
> -parent => $parent,
> -name => $name,
> -pos => $pos,
> -size => $size,
> -popstyle => WS_CAPTION | WS_SIZEBOX,
> -pushstyle => WS_CHILD | WS_CLIPCHILDREN,
> -pushexstyle => WS_EX_CLIENTEDGE,
> -hscroll => 1,
> -class => $class,
> -onScroll => \&Generic_Scroll,
> -onTimer => \&MoveOutTest,
> -onMouseMove => \&Generic_MouseMove,
> -onPaint => \&Generic_Paint,
> );
>
> You should have access to all the mouse events and it behaves just like a
> graphic window. It'll contain scroll bars and have a sunken edge, but
just
> remove those options.
>
> Cheers,
>
> Jeremy.
>
>
>> Date: Thu, 18 Dec 2008 18:16:33 -0600
>> From: as...@es...
>> To: jez...@ho...; per...@li...
>> Subject: RE: [perl-win32-gui-users] Painting non-graphical controls
>>
>> No, as Win32::GUI::Graphic controls don't provide a mouseOver or
> mouseOut
>> event, I'm stuck with trying to modify the zorder or finding an
> alternative
>> method.
>>
>> It's a form of 'trainer' (thats very very generalized) for an MMO. The
>> original application had a userbase of about 5000 people.
>>
>>
>> On Thu, 18 Dec 2008 22:14:02 +0000, Jeremy White <jez...@ho...>
>> wrote:
>> >
>> > Hi,
>> >
>> > My 2cents. Can't you create a dynamic control (within a transparent
>> > window) that is created on the fly when the user moves a mouse over an
>> > 'image' of the control?
>> >
>> > Can you say what the app is?
>> >
>> > Cheers,
>> >
>> > jez.
>> >
>> >
>> >> Date: Wed, 17 Dec 2008 02:07:40 -0600
>> >> From: as...@es...
>> >> To: per...@li...
>> >> Subject: [perl-win32-gui-users] Painting non-graphical controls
>> >>
>> >> Combobox isn't responsive to either mouse or keyboard when placed on
> top
>> > of
>> >> a background GUI::Graphic object. If placed without the graphic,
> they're
>> >> responsive.
>> >>
>> >> As far as I know, I'm forced to custom paint the images to the window
>> >> because they're .pngs with alpha.
>> >>
>> >> Method #1
>> >> Used winMain_Paint {} to draw my graphics onto the window as desired,
>> > but
>> >> non-image controls aren't displayed or rendered properly..
>> >>
>> >> Method #2
>> >> This version reads from an .ini to generate graphic controls
> on-the-fly,
>> >> assigning custom paint handlers to them while simply creating
> comboBoxes
>> >> after all graphics have been created (so they're visible, otherwise
>> > they're
>> >> covered by the graphic controls)
>> >> The problem with this method is that any controls that are placed on
> the
>> >> window after the graphic controls aren't interactive. (Doesn't
> respond
>> > to
>> >> keyboard nor mouse)
>> >>
>> >> Is there any way around either of these methods?
>> >>
>> >> The idea solution would be a way of forcing the ComboBox control to
> be
>> > 'on
>> >> top' of all other controls, I just haven't figured out a way in the
> week
>> > or
>> >> so I've been buried in this project.
>> >>
>> >> This is for a heavily skinned app that's very widely used, I'd
> greatly
>> >> appreciate any help you could offer.
>> >> -- Ash
>> >>
>> >>
>> >>
>> >
>>
>
------------------------------------------------------------------------------
>> >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
>> > Nevada.
>> >> The future of the web can't happen without you. Join us at MIX09 to
>> > help
>> >> pave the way to the Next Web now. Learn more and register at
>> >>
>> >
>>
>
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>> >> _______________________________________________
>> >> Perl-Win32-GUI-Users mailing list
>> >> Per...@li...
>> >> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>> >> http://perl-win32-gui.sourceforge.net/
>> >
>> > _________________________________________________________________
>> > Get a bird’s eye view of the world with Multimap
>> > http://clk.atdmt.com/GBL/go/115454059/direct/01/
>>
--
*{] Ashrien [}*
|
|
From: Ashrien <as...@es...> - 2008-12-19 16:16:37
|
No, as Win32::GUI::Graphic controls don't provide a mouseOver or mouseOut
event, I'm stuck with trying to modify the zorder or finding an alternative
method.
It's a form of 'trainer' (thats very very generalized) for an MMO. The
original application had a userbase of about 5000 people.
On Thu, 18 Dec 2008 22:14:02 +0000, Jeremy White <jez...@ho...>
wrote:
>
> Hi,
>
> My 2cents. Can't you create a dynamic control (within a transparent
> window) that is created on the fly when the user moves a mouse over an
> 'image' of the control?
>
> Can you say what the app is?
>
> Cheers,
>
> jez.
>
>
>> Date: Wed, 17 Dec 2008 02:07:40 -0600
>> From: as...@es...
>> To: per...@li...
>> Subject: [perl-win32-gui-users] Painting non-graphical controls
>>
>> Combobox isn't responsive to either mouse or keyboard when placed on top
> of
>> a background GUI::Graphic object. If placed without the graphic, they're
>> responsive.
>>
>> As far as I know, I'm forced to custom paint the images to the window
>> because they're .pngs with alpha.
>>
>> Method #1
>> Used winMain_Paint {} to draw my graphics onto the window as desired,
> but
>> non-image controls aren't displayed or rendered properly..
>>
>> Method #2
>> This version reads from an .ini to generate graphic controls on-the-fly,
>> assigning custom paint handlers to them while simply creating comboBoxes
>> after all graphics have been created (so they're visible, otherwise
> they're
>> covered by the graphic controls)
>> The problem with this method is that any controls that are placed on the
>> window after the graphic controls aren't interactive. (Doesn't respond
> to
>> keyboard nor mouse)
>>
>> Is there any way around either of these methods?
>>
>> The idea solution would be a way of forcing the ComboBox control to be
> 'on
>> top' of all other controls, I just haven't figured out a way in the week
> or
>> so I've been buried in this project.
>>
>> This is for a heavily skinned app that's very widely used, I'd greatly
>> appreciate any help you could offer.
>> -- Ash
>>
>>
>>
>
------------------------------------------------------------------------------
>> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> Nevada.
>> The future of the web can't happen without you. Join us at MIX09 to
> help
>> pave the way to the Next Web now. Learn more and register at
>>
>
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
>> _______________________________________________
>> Perl-Win32-GUI-Users mailing list
>> Per...@li...
>> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>> http://perl-win32-gui.sourceforge.net/
>
> _________________________________________________________________
> Get a bird’s eye view of the world with Multimap
> http://clk.atdmt.com/GBL/go/115454059/direct/01/
--
*{] Ashrien [}*
|
|
From: Jeremy W. <jez...@ho...> - 2008-12-19 10:50:38
|
Rather than a graphic, try using a normal window that's created as a child window. I do the following to draw various charts:
$newwindow = new Win32::GUI::Window (
-parent => $parent,
-name => $name,
-pos => $pos,
-size => $size,
-popstyle => WS_CAPTION | WS_SIZEBOX,
-pushstyle => WS_CHILD | WS_CLIPCHILDREN,
-pushexstyle => WS_EX_CLIENTEDGE,
-hscroll => 1,
-class => $class,
-onScroll => \&Generic_Scroll,
-onTimer => \&MoveOutTest,
-onMouseMove => \&Generic_MouseMove,
-onPaint => \&Generic_Paint,
);
You should have access to all the mouse events and it behaves just like a graphic window. It'll contain scroll bars and have a sunken edge, but just remove those options.
Cheers,
Jeremy.
> Date: Thu, 18 Dec 2008 18:16:33 -0600
> From: as...@es...
> To: jez...@ho...; per...@li...
> Subject: RE: [perl-win32-gui-users] Painting non-graphical controls
>
> No, as Win32::GUI::Graphic controls don't provide a mouseOver or mouseOut
> event, I'm stuck with trying to modify the zorder or finding an alternative
> method.
>
> It's a form of 'trainer' (thats very very generalized) for an MMO. The
> original application had a userbase of about 5000 people.
>
>
> On Thu, 18 Dec 2008 22:14:02 +0000, Jeremy White <jez...@ho...>
> wrote:
> >
> > Hi,
> >
> > My 2cents. Can't you create a dynamic control (within a transparent
> > window) that is created on the fly when the user moves a mouse over an
> > 'image' of the control?
> >
> > Can you say what the app is?
> >
> > Cheers,
> >
> > jez.
> >
> >
> >> Date: Wed, 17 Dec 2008 02:07:40 -0600
> >> From: as...@es...
> >> To: per...@li...
> >> Subject: [perl-win32-gui-users] Painting non-graphical controls
> >>
> >> Combobox isn't responsive to either mouse or keyboard when placed on top
> > of
> >> a background GUI::Graphic object. If placed without the graphic, they're
> >> responsive.
> >>
> >> As far as I know, I'm forced to custom paint the images to the window
> >> because they're .pngs with alpha.
> >>
> >> Method #1
> >> Used winMain_Paint {} to draw my graphics onto the window as desired,
> > but
> >> non-image controls aren't displayed or rendered properly..
> >>
> >> Method #2
> >> This version reads from an .ini to generate graphic controls on-the-fly,
> >> assigning custom paint handlers to them while simply creating comboBoxes
> >> after all graphics have been created (so they're visible, otherwise
> > they're
> >> covered by the graphic controls)
> >> The problem with this method is that any controls that are placed on the
> >> window after the graphic controls aren't interactive. (Doesn't respond
> > to
> >> keyboard nor mouse)
> >>
> >> Is there any way around either of these methods?
> >>
> >> The idea solution would be a way of forcing the ComboBox control to be
> > 'on
> >> top' of all other controls, I just haven't figured out a way in the week
> > or
> >> so I've been buried in this project.
> >>
> >> This is for a heavily skinned app that's very widely used, I'd greatly
> >> appreciate any help you could offer.
> >> -- Ash
> >>
> >>
> >>
> >
> ------------------------------------------------------------------------------
> >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> > Nevada.
> >> The future of the web can't happen without you. Join us at MIX09 to
> > help
> >> pave the way to the Next Web now. Learn more and register at
> >>
> >
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> >> _______________________________________________
> >> Perl-Win32-GUI-Users mailing list
> >> Per...@li...
> >> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> >> http://perl-win32-gui.sourceforge.net/
> >
> > _________________________________________________________________
> > Get a bird’s eye view of the world with Multimap
> > http://clk.atdmt.com/GBL/go/115454059/direct/01/
> --
> *{] Ashrien [}*
>
_________________________________________________________________
Get a bird’s eye view of the world with Multimap
http://clk.atdmt.com/GBL/go/115454059/direct/01/ |
|
From: Jeremy W. <jez...@ho...> - 2008-12-18 22:30:08
|
Hi,
My 2cents. Can't you create a dynamic control (within a transparent window) that is created on the fly when the user moves a mouse over an 'image' of the control?
Can you say what the app is?
Cheers,
jez.
> Date: Wed, 17 Dec 2008 02:07:40 -0600
> From: as...@es...
> To: per...@li...
> Subject: [perl-win32-gui-users] Painting non-graphical controls
>
> Combobox isn't responsive to either mouse or keyboard when placed on top of
> a background GUI::Graphic object. If placed without the graphic, they're
> responsive.
>
> As far as I know, I'm forced to custom paint the images to the window
> because they're .pngs with alpha.
>
> Method #1
> Used winMain_Paint {} to draw my graphics onto the window as desired, but
> non-image controls aren't displayed or rendered properly..
>
> Method #2
> This version reads from an .ini to generate graphic controls on-the-fly,
> assigning custom paint handlers to them while simply creating comboBoxes
> after all graphics have been created (so they're visible, otherwise they're
> covered by the graphic controls)
> The problem with this method is that any controls that are placed on the
> window after the graphic controls aren't interactive. (Doesn't respond to
> keyboard nor mouse)
>
> Is there any way around either of these methods?
>
> The idea solution would be a way of forcing the ComboBox control to be 'on
> top' of all other controls, I just haven't figured out a way in the week or
> so I've been buried in this project.
>
> This is for a heavily skinned app that's very widely used, I'd greatly
> appreciate any help you could offer.
> -- Ash
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Per...@li...
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
_________________________________________________________________
Get a bird’s eye view of the world with Multimap
http://clk.atdmt.com/GBL/go/115454059/direct/01/ |
|
From: Ashrien <as...@es...> - 2008-12-17 19:14:24
|
Combobox isn't responsive to either mouse or keyboard when placed on top of
a background GUI::Graphic object. If placed without the graphic, they're
responsive.
As far as I know, I'm forced to custom paint the images to the window
because they're .pngs with alpha.
Method #1
Used winMain_Paint {} to draw my graphics onto the window as desired, but
non-image controls aren't displayed or rendered properly..
Method #2
This version reads from an .ini to generate graphic controls on-the-fly,
assigning custom paint handlers to them while simply creating comboBoxes
after all graphics have been created (so they're visible, otherwise they're
covered by the graphic controls)
The problem with this method is that any controls that are placed on the
window after the graphic controls aren't interactive. (Doesn't respond to
keyboard nor mouse)
Is there any way around either of these methods?
The idea solution would be a way of forcing the ComboBox control to be 'on
top' of all other controls, I just haven't figured out a way in the week or
so I've been buried in this project.
This is for a heavily skinned app that's very widely used, I'd greatly
appreciate any help you could offer.
-- Ash
|
|
From: Sean H. <jal...@ho...> - 2008-12-15 16:44:09
|
Alexander (Sasha) Sirotkin wrote:
> Here is the problematic code, in case anybody cares to take a look:
>
> for ( ListWindows( ) ) {
> if ($_->{title} =~ /Firefox/) {
> $hwnd = $_->{hwnd};
> last;
> }
> }
> Win32::GUI::SetForegroundWindow($hwnd);
> my $x = Win32::GUI::ScrollPos($hwnd, 0);
> printf("Scroll pos: " . $x . "\n");
>
> Win32::GUI::Scroll($hwnd, 1, SB_PAGEDOWN);
>
> ScrollPos() returns the same value no matter what is the scroll position
> and scroll() does nothing...
You're calling these functions on the top-level window. The top-level
window usually isn't a scrolled window.
The following code will dump the child controls of the Firefox window.
You can use it as a base to write something to find the scrolled window,
but it looks to me like it will be hard to find the one you want. (Run
it and you'll see what I mean.)
use Win32::GUI;
use Win32::GUI::Constants qw(/^GW_/);
use strict;
my $hwnd = Win32::GUI::GetWindow(Win32::GUI::GetDesktopWindow, GW_CHILD);
while ($hwnd) {
last if (Win32::GUI::Text($hwnd)=~/Firefox/);
$hwnd = Win32::GUI::GetWindow($hwnd, GW_HWNDNEXT);
}
DumpWindows($hwnd);
sub DumpWindows {
my ($ph, $l) = @_;
print "\t" x $l;
my $class = Win32::GUI::GetClassName($ph);
my $text = Win32::GUI::Text($ph);
print qq([$class] "$text"\n);
my $ch = Win32::GUI::GetWindow($ph, GW_CHILD);
while ($ch) {
DumpWindows($ch, $l+1);
$ch = Win32::GUI::GetWindow($ch, GW_HWNDNEXT);
}
}
|
|
From: Sean H. <jal...@ho...> - 2008-12-15 16:08:25
|
Brian Somers wrote: > Basically, I’m trying to implement a dual listbox interface quite > similar to what Eric Hansen wrote about in 1999. What I can’t find > anywhere is how to fill the left listbox with the files in a given > directory, although the closest I found was a tutorial in VB out on the > web. I’m trying to use the methods Dir and AddFile, but something’s not > working. I can’t figure out what the Dir method is supposed to return, > nor what parameters/arguments to send. I try AddFile and my app crashes. > I can make AddString work, though. MSDN is your friend! (Seriously, MSDN is your best bet for figuring out undocumented Win32::GUI methods.) AddFile($path) http://msdn.microsoft.com/en-us/library/bb775165(VS.85).aspx Take note: "The list box to which lParam is added must have been filled by the DlgDirList function." This is presumably why you're crashing Unfortunately, however, Win32::GUI does not expose the DlgDirList function to Perl. (At least, a search of the source files does not find "DlgDirList".) Dir($path, $flags) http://msdn.microsoft.com/en-us/library/bb775185(VS.85).aspx Some notes: 2) The order of parameters is swapped in Win32::GUI. 3) The constants don't seem to be available via Win32::GUI::Constants, so here they are: DDL_READWRITE = 0x00 DDL_READONLY = 0x01 DDL_HIDDEN = 0x02 DDL_SYSTEM = 0x04 DDL_DIRECTORY = 0x10 DDL_ARCHIVE = 0x20 DDL_DRIVES = 0x4000 DDL_EXCLUSIVE = 0x8000 (I hope these are correct - I found them on the web and haven't tested them.) |
|
From: Kieren D. <Kie...@ha...> - 2008-12-15 14:26:53
|
Hi Glenn and Rob
Thank you - you've both very helpful, and I now have a combobox which
responds
appropriately to user input.
I do still have one question, though. Is there a list somewhere of the
events a type of control responds to by default? The MSDN library lists
events which can be trapped with hook, but I don't know what the lists
of events in the Win32::GUI manual are derived from.
Kieron
> -----Original Message-----
> From: Glenn W Munroe [mailto:gwm...@gm...]
> Sent: 12 December 2008 12:44
> To: 'Perl Rob'; Kieren Dunbar
> Cc: per...@li...
> Subject: RE: [perl-win32-gui-users] Perl-Win32-GUI-Users
> Digest, Vol 30,Issue 2
>
> Kieron,
>
> I'm not sure that this is exactly what you're looking for,
> but it may point
> you in the right direction. It doesn't trigger on a change
> via the drop-down
> list, but it does capture keystrokes:
>
> -start-
>
> #! perl -w
> use Win32::GUI qw(CBN_EDITCHANGE WM_COMMAND);
> use strict;
>
>
> my $x = Win32'GUI'Window->new('-size', [100, 100], '-pos', [0,0],
> '-visible', 1);
> my $y = $x->AddCombobox('-pos', [10, 10], '-size', [50, 200],
> '-dropdown',
> 1);
> $y->Add(1, 2); $y->Select(0);
>
> $y->Hook(CBN_EDITCHANGE,
> sub {
> my ($hObject, $wParam, $lParam, $iType, $iMsgCode) = @_;
> return 1 unless $iType == WM_COMMAND;
>
> print "Change: ".$y->Text."\n";
> 1;
> }
> );
>
> Win32'GUI'Dialog;
>
> -end-
>
> Cheers,
> Glenn
> -----Original Message-----
> From: Perl Rob [mailto:pe...@co...]
> Sent: 12 December 2008 01:06
> To: Kie...@ha...
> Cc: per...@li...
> Subject: Re: [perl-win32-gui-users] Perl-Win32-GUI-Users Digest, Vol
> 30,Issue 2
>
> Hi Kieron,
>
> To find out what has been selected, use the GetCurSel()
> method to get the
> index number of the currently selected item, then use the
> GetString() method
> to get the text of the item at that index:
>
> my $change = sub()
> {
> my $num = $y->GetCurSel;
> my $text = $y->GetString($num);
> print "You just selected $text\n";
> };
>
> As for your first question, I don't think a combobox listens
> for keyboard
> events by default (they're certainly not mentioned in the
> "Events" section
> of the API). I tried using the Hook() method with the
> WM_KEYUP event but
> that didn't work. Perhaps someone else knows.
>
> Regards,
> Rob
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 9 Dec 2008 16:30:37 -0000
> From: "Kieren Dunbar" <Kie...@ha...>
> Subject: [perl-win32-gui-users] Combobox problems
> To: <per...@li...>
> Message-ID: <53D...@hh...>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi All
>
> I have tried to use a combobox to do something, but I have had two
> problems.
> 1. I don't know what events are triggered if I type into the text box.
> It doesn't trigger obvious possibilities such as KeyUp, so I
> don't know
> what to look for.
> 2. If I trigger the Change trigger, box->Text contains the previous
> selection rather than the current one. How can I find
> out what the user has selected this time?
>
> I experienced this problem with ActiveState Perl 5.8.8 and Win32::GUI
> version 1.0.6. The source I used is as below. Could someone please
> suggest what I should do?
>
> Thank you.
>
> Kieron
>
> -start-
>
> my $x = Win32'GUI'Window->new('-size', [100, 100], '-pos', [0,0],
> '-visible', 1);
> my $y = $x->AddCombobox('-pos', [10, 10], '-size', [50, 200],
> '-dropdown', 1);
> $y->Add(1, 2);
> $y->Select(0);
>
> my $change = sub() {print $y->Text."\n"};
> $y->Change('-onChange', $change);
> $y->Change('-onKeyUp', $change);
>
> Win32'GUI'Dialog;
>
> -end-
>
>
>
> --------------------------------------------------------------
> --------------
> --
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las
> Vegas, Nevada.
> The future of the web can't happen without you. Join us at
> MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009
> .visitmix.com/
> _______________________________________________
> 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...> - 2008-12-15 09:43:16
|
Hi,
Ok I understand a little more of what you are trying to do.
Windows has two main drawing modes: One mode windows draws the windows itself, the other is where you draw the window (ie, supply the paint event). You can mix styles, but it gets very complicated as you have to treat the window in certain ways depending on what controls are present. Googling with "owner drawn windows" should give you more examples. If you dont need windows controls, then things will become easyer.
For performance reasons you need to use an off screen DC to keep updated (I think one of the examples does this) and then only update the the main window when necessary (blitting to an offscreen DC is much faster). Both the offscreen DC and the window would be blitted to so you should have no problem maintain 30 frames a second.
Cheers,
jeremy.
From: msj...@ho...
To: jez...@ho...; per...@li...
Date: Sat, 13 Dec 2008 16:51:16 -0500
Subject: Re: [perl-win32-gui-users] Drawing transparently.
Jeremy,
first off thank you for the reply.
The example you've given works visually, but it is not what I intended to do obtain. :-)
I think I should have given more details at the beginning. :-)
The project I am currently working on will "repaint" ca 30 times per second.
It will be a full-screen application with some data overlayed at the aforementioned sample rate.
The intention is/was to use a series of labels to transparently display the information. I say labels but it could be any other object/container that can be used within the main window and that supports transparency.
Why? The original intention was to minimize the amount of "blitting" (for performance and appearance reasons) as much as possible by using "containers" which size is limited to the changed area.
Hope this is a bit clearer and thank you again for the help.
Giuseppe
From: jez...@ho...
To: msj...@ho...; per...@li...
Subject: RE: [perl-win32-gui-users] Drawing transparently.
Date: Sat, 13 Dec 2008 18:03:18 +0000
Hi,
I think you are mixing drawing styles - try the below:
cheers,
jez.
use strict;
use warnings;
use Win32::GUI();
use Win32::GUI::DIBitmap;
use FindBin();
$|++;
my $interval = 1000;
my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp")
or die "newFromFile";
my $main = Win32::GUI::Window->new(
-name => 'Main',
-width => 150,
-height => 100,
-onTimer => \&redraw_Timer,
-onPaint => \&Main_Paint,
-text => 'Transparent Label',
);
$main->AddTimer( "redraw_Timer", $interval );
my $label = $main->AddLabel(
-text => scalar(localtime),
-addstyle => 11, # TRANSPARENT
);
#-------------------------------------------------------------------------------
$main->Show();
Win32::GUI::Dialog();
$main->Hide();
exit(0);
#-------------------------------------------------------------------------------
sub Main_Paint {
printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) );
my $self = shift;
my $dc = shift;
my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ];
$dib->StretchToDC( $dc, 0, 0, $width, $height );
$dc->BkMode(1);
$dc->TextOut(4,14,scalar(localtime));
$dc->Validate();
return 1;
}
sub Main_Terminate {
-1;
}
sub redraw_Timer {
my $temp = localtime;
$main->InvalidateRect(1); # Forces Redraw
select( undef, undef, undef, 1 / 4 );
$label->Text($temp);
}
> From: msj...@ho...
> To: per...@li...
> Date: Fri, 12 Dec 2008 08:56:27 -0800
> Subject: [perl-win32-gui-users] Drawing transparently.
>
> Hi all,
> I put together a smaller example to better show my issue.
>
> <code>
> #!/C/Perl/bin/perl.exe
> use strict;
> use warnings;
> use Win32::GUI();
> use Win32::GUI::DIBitmap;
>
> $|++;
>
> my $interval = 1000;
>
> my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp")
> or die "newFromFile";
>
> my $main = Win32::GUI::Window->new(
> -name => 'Main',
> -width => 150,
> -height => 100,
> -onTimer => \&redraw_Timer,
> -onPaint => \&Main_Paint,
> -text => 'Transparent Label',
> );
>
> $main->AddTimer( "redraw_Timer", $interval );
>
> my $label = $main->AddLabel(
> -text => scalar(localtime),
> -addstyle => 11, # TRANSPARENT
> );
>
> #-------------------------------------------------------------------------------
> $main->Show();
> Win32::GUI::Dialog();
> $main->Hide();
> exit(0);
>
> #-------------------------------------------------------------------------------
>
> sub Main_Paint {
> printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) );
> my $self = shift;
> my $dc = shift;
> my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ];
> $dib->StretchToDC( $dc, 0, 0, $width, $height );
> $dc->Validate();
> return 1;
> }
>
> sub Main_Terminate {
> -1;
> }
>
> sub redraw_Timer {
> my $temp = localtime;
> $main->InvalidateRect(1); # Forces Redraw
> select( undef, undef, undef, 1 / 4 );
> $label->Text($temp);
> }
> </code>
>
> If I remove the bitmap background (onPaint) and add a "-background => [0,255,0]," to the Main window I obtain the desired result. Unfortunately in my case I am dealing with a background obtained via DC cals.
>
> Again, thank you in advance for any help.
>
> Giuseppe
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Per...@li...
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
Take your friends with you with Mobile Messenger. Click Here!
Send e-mail faster without improving your typing skills. Get your Hotmail® account.
_________________________________________________________________
Imagine a life without walls. See the possibilities.
http://clk.atdmt.com/UKM/go/122465943/direct/01/ |
|
From: Alexander (S. S. <sas...@gm...> - 2008-12-14 00:20:44
|
For some reason functions like ScrollRange, ScrollPos, etc do not work for
me. Is there any trick (or limitation) on using these functions on windows
not created using Perl code ?
Here is the problematic code, in case anybody cares to take a look:
for ( ListWindows( ) ) {
if ($_->{title} =~ /Firefox/) {
$hwnd = $_->{hwnd};
last;
}
}
Win32::GUI::SetForegroundWindow($hwnd);
my $x = Win32::GUI::ScrollPos($hwnd, 0);
printf("Scroll pos: " . $x . "\n");
Win32::GUI::Scroll($hwnd, 1, SB_PAGEDOWN);
ScrollPos() returns the same value no matter what is the scroll position and
scroll() does nothing...
|
|
From: Giuseppe C. <msj...@ho...> - 2008-12-13 21:54:34
|
Jeremy,
first off thank you for the reply.
The example you've given works visually, but it is not what I intended to do obtain. :-)
I think I should have given more details at the beginning. :-)
The project I am currently working on will "repaint" ca 30 times per second.
It will be a full-screen application with some data overlayed at the aforementioned sample rate.
The intention is/was to use a series of labels to transparently display the information. I say labels but it could be any other object/container that can be used within the main window and that supports transparency.
Why? The original intention was to minimize the amount of "blitting" (for performance and appearance reasons) as much as possible by using "containers" which size is limited to the changed area.
Hope this is a bit clearer and thank you again for the help.
Giuseppe
From: jez...@ho...
To: msj...@ho...; per...@li...
Subject: RE: [perl-win32-gui-users] Drawing transparently.
Date: Sat, 13 Dec 2008 18:03:18 +0000
Hi,
I think you are mixing drawing styles - try the below:
cheers,
jez.
use strict;
use warnings;
use Win32::GUI();
use Win32::GUI::DIBitmap;
use FindBin();
$|++;
my $interval = 1000;
my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp")
or die "newFromFile";
my $main = Win32::GUI::Window->new(
-name => 'Main',
-width => 150,
-height => 100,
-onTimer => \&redraw_Timer,
-onPaint => \&Main_Paint,
-text => 'Transparent Label',
);
$main->AddTimer( "redraw_Timer", $interval );
my $label = $main->AddLabel(
-text => scalar(localtime),
-addstyle => 11, # TRANSPARENT
);
#-------------------------------------------------------------------------------
$main->Show();
Win32::GUI::Dialog();
$main->Hide();
exit(0);
#-------------------------------------------------------------------------------
sub Main_Paint {
printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) );
my $self = shift;
my $dc = shift;
my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ];
$dib->StretchToDC( $dc, 0, 0, $width, $height );
$dc->BkMode(1);
$dc->TextOut(4,14,scalar(localtime));
$dc->Validate();
return 1;
}
sub Main_Terminate {
-1;
}
sub redraw_Timer {
my $temp = localtime;
$main->InvalidateRect(1); # Forces Redraw
select( undef, undef, undef, 1 / 4 );
$label->Text($temp);
}
> From: msj...@ho...
> To: per...@li...
> Date: Fri, 12 Dec 2008 08:56:27 -0800
> Subject: [perl-win32-gui-users] Drawing transparently.
>
> Hi all,
> I put together a smaller example to better show my issue.
>
> <code>
> #!/C/Perl/bin/perl.exe
> use strict;
> use warnings;
> use Win32::GUI();
> use Win32::GUI::DIBitmap;
>
> $|++;
>
> my $interval = 1000;
>
> my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp")
> or die "newFromFile";
>
> my $main = Win32::GUI::Window->new(
> -name => 'Main',
> -width => 150,
> -height => 100,
> -onTimer => \&redraw_Timer,
> -onPaint => \&Main_Paint,
> -text => 'Transparent Label',
> );
>
> $main->AddTimer( "redraw_Timer", $interval );
>
> my $label = $main->AddLabel(
> -text => scalar(localtime),
> -addstyle => 11, # TRANSPARENT
> );
>
> #-------------------------------------------------------------------------------
> $main->Show();
> Win32::GUI::Dialog();
> $main->Hide();
> exit(0);
>
> #-------------------------------------------------------------------------------
>
> sub Main_Paint {
> printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) );
> my $self = shift;
> my $dc = shift;
> my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ];
> $dib->StretchToDC( $dc, 0, 0, $width, $height );
> $dc->Validate();
> return 1;
> }
>
> sub Main_Terminate {
> -1;
> }
>
> sub redraw_Timer {
> my $temp = localtime;
> $main->InvalidateRect(1); # Forces Redraw
> select( undef, undef, undef, 1 / 4 );
> $label->Text($temp);
> }
> </code>
>
> If I remove the bitmap background (onPaint) and add a "-background => [0,255,0]," to the Main window I obtain the desired result. Unfortunately in my case I am dealing with a background obtained via DC cals.
>
> Again, thank you in advance for any help.
>
> Giuseppe
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Per...@li...
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
Take your friends with you with Mobile Messenger. Click Here!
_________________________________________________________________
Send e-mail faster without improving your typing skills.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008 |
|
From: Jeremy W. <jez...@ho...> - 2008-12-13 18:03:22
|
Hi,
I think you are mixing drawing styles - try the below:
cheers,
jez.
use strict;
use warnings;
use Win32::GUI();
use Win32::GUI::DIBitmap;
use FindBin();
$|++;
my $interval = 1000;
my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp")
or die "newFromFile";
my $main = Win32::GUI::Window->new(
-name => 'Main',
-width => 150,
-height => 100,
-onTimer => \&redraw_Timer,
-onPaint => \&Main_Paint,
-text => 'Transparent Label',
);
$main->AddTimer( "redraw_Timer", $interval );
my $label = $main->AddLabel(
-text => scalar(localtime),
-addstyle => 11, # TRANSPARENT
);
#-------------------------------------------------------------------------------
$main->Show();
Win32::GUI::Dialog();
$main->Hide();
exit(0);
#-------------------------------------------------------------------------------
sub Main_Paint {
printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) );
my $self = shift;
my $dc = shift;
my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ];
$dib->StretchToDC( $dc, 0, 0, $width, $height );
$dc->BkMode(1);
$dc->TextOut(4,14,scalar(localtime));
$dc->Validate();
return 1;
}
sub Main_Terminate {
-1;
}
sub redraw_Timer {
my $temp = localtime;
$main->InvalidateRect(1); # Forces Redraw
select( undef, undef, undef, 1 / 4 );
$label->Text($temp);
}
> From: msj...@ho...
> To: per...@li...
> Date: Fri, 12 Dec 2008 08:56:27 -0800
> Subject: [perl-win32-gui-users] Drawing transparently.
>
> Hi all,
> I put together a smaller example to better show my issue.
>
> <code>
> #!/C/Perl/bin/perl.exe
> use strict;
> use warnings;
> use Win32::GUI();
> use Win32::GUI::DIBitmap;
>
> $|++;
>
> my $interval = 1000;
>
> my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp")
> or die "newFromFile";
>
> my $main = Win32::GUI::Window->new(
> -name => 'Main',
> -width => 150,
> -height => 100,
> -onTimer => \&redraw_Timer,
> -onPaint => \&Main_Paint,
> -text => 'Transparent Label',
> );
>
> $main->AddTimer( "redraw_Timer", $interval );
>
> my $label = $main->AddLabel(
> -text => scalar(localtime),
> -addstyle => 11, # TRANSPARENT
> );
>
> #-------------------------------------------------------------------------------
> $main->Show();
> Win32::GUI::Dialog();
> $main->Hide();
> exit(0);
>
> #-------------------------------------------------------------------------------
>
> sub Main_Paint {
> printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) );
> my $self = shift;
> my $dc = shift;
> my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ];
> $dib->StretchToDC( $dc, 0, 0, $width, $height );
> $dc->Validate();
> return 1;
> }
>
> sub Main_Terminate {
> -1;
> }
>
> sub redraw_Timer {
> my $temp = localtime;
> $main->InvalidateRect(1); # Forces Redraw
> select( undef, undef, undef, 1 / 4 );
> $label->Text($temp);
> }
> </code>
>
> If I remove the bitmap background (onPaint) and add a "-background => [0,255,0]," to the Main window I obtain the desired result. Unfortunately in my case I am dealing with a background obtained via DC cals.
>
> Again, thank you in advance for any help.
>
> Giuseppe
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Per...@li...
> https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> http://perl-win32-gui.sourceforge.net/
_________________________________________________________________
Are you a PC? Upload your PC story and show the world
http://clk.atdmt.com/UKM/go/122465942/direct/01/ |
|
From: Giuseppe J. C. <msj...@ho...> - 2008-12-12 17:10:21
|
Hi all,
I put together a smaller example to better show my issue.
<code>
#!/C/Perl/bin/perl.exe
use strict;
use warnings;
use Win32::GUI();
use Win32::GUI::DIBitmap;
$|++;
my $interval = 1000;
my $dib = newFromFile Win32::GUI::DIBitmap("Zapotec.bmp")
or die "newFromFile";
my $main = Win32::GUI::Window->new(
-name => 'Main',
-width => 150,
-height => 100,
-onTimer => \&redraw_Timer,
-onPaint => \&Main_Paint,
-text => 'Transparent Label',
);
$main->AddTimer( "redraw_Timer", $interval );
my $label = $main->AddLabel(
-text => scalar(localtime),
-addstyle => 11, # TRANSPARENT
);
#-------------------------------------------------------------------------------
$main->Show();
Win32::GUI::Dialog();
$main->Hide();
exit(0);
#-------------------------------------------------------------------------------
sub Main_Paint {
printf( "[%s] Main Paint Event Fired.\n", scalar(localtime) );
my $self = shift;
my $dc = shift;
my ( $width, $height ) = ( $self->GetClientRect )[ 2 .. 3 ];
$dib->StretchToDC( $dc, 0, 0, $width, $height );
$dc->Validate();
return 1;
}
sub Main_Terminate {
-1;
}
sub redraw_Timer {
my $temp = localtime;
$main->InvalidateRect(1); # Forces Redraw
select( undef, undef, undef, 1 / 4 );
$label->Text($temp);
}
</code>
If I remove the bitmap background (onPaint) and add a "-background => [0,255,0]," to the Main window I obtain the desired result. Unfortunately in my case I am dealing with a background obtained via DC cals.
Again, thank you in advance for any help.
Giuseppe
|
|
From: Glenn W M. <gwm...@gm...> - 2008-12-12 12:43:46
|
Kieron,
I'm not sure that this is exactly what you're looking for, but it may point
you in the right direction. It doesn't trigger on a change via the drop-down
list, but it does capture keystrokes:
-start-
#! perl -w
use Win32::GUI qw(CBN_EDITCHANGE WM_COMMAND);
use strict;
my $x = Win32'GUI'Window->new('-size', [100, 100], '-pos', [0,0],
'-visible', 1);
my $y = $x->AddCombobox('-pos', [10, 10], '-size', [50, 200], '-dropdown',
1);
$y->Add(1, 2); $y->Select(0);
$y->Hook(CBN_EDITCHANGE,
sub {
my ($hObject, $wParam, $lParam, $iType, $iMsgCode) = @_;
return 1 unless $iType == WM_COMMAND;
print "Change: ".$y->Text."\n";
1;
}
);
Win32'GUI'Dialog;
-end-
Cheers,
Glenn
-----Original Message-----
From: Perl Rob [mailto:pe...@co...]
Sent: 12 December 2008 01:06
To: Kie...@ha...
Cc: per...@li...
Subject: Re: [perl-win32-gui-users] Perl-Win32-GUI-Users Digest, Vol
30,Issue 2
Hi Kieron,
To find out what has been selected, use the GetCurSel() method to get the
index number of the currently selected item, then use the GetString() method
to get the text of the item at that index:
my $change = sub()
{
my $num = $y->GetCurSel;
my $text = $y->GetString($num);
print "You just selected $text\n";
};
As for your first question, I don't think a combobox listens for keyboard
events by default (they're certainly not mentioned in the "Events" section
of the API). I tried using the Hook() method with the WM_KEYUP event but
that didn't work. Perhaps someone else knows.
Regards,
Rob
------------------------------
Message: 4
Date: Tue, 9 Dec 2008 16:30:37 -0000
From: "Kieren Dunbar" <Kie...@ha...>
Subject: [perl-win32-gui-users] Combobox problems
To: <per...@li...>
Message-ID: <53D...@hh...>
Content-Type: text/plain; charset="us-ascii"
Hi All
I have tried to use a combobox to do something, but I have had two
problems.
1. I don't know what events are triggered if I type into the text box.
It doesn't trigger obvious possibilities such as KeyUp, so I don't know
what to look for.
2. If I trigger the Change trigger, box->Text contains the previous
selection rather than the current one. How can I find
out what the user has selected this time?
I experienced this problem with ActiveState Perl 5.8.8 and Win32::GUI
version 1.0.6. The source I used is as below. Could someone please
suggest what I should do?
Thank you.
Kieron
-start-
my $x = Win32'GUI'Window->new('-size', [100, 100], '-pos', [0,0],
'-visible', 1);
my $y = $x->AddCombobox('-pos', [10, 10], '-size', [50, 200],
'-dropdown', 1);
$y->Add(1, 2);
$y->Select(0);
my $change = sub() {print $y->Text."\n"};
$y->Change('-onChange', $change);
$y->Change('-onKeyUp', $change);
Win32'GUI'Dialog;
-end-
----------------------------------------------------------------------------
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
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: Perl R. <pe...@co...> - 2008-12-12 04:21:03
|
Hi Kieron,
To find out what has been selected, use the GetCurSel() method to get the
index number of the currently selected item, then use the GetString() method
to get the text of the item at that index:
my $change = sub()
{
my $num = $y->GetCurSel;
my $text = $y->GetString($num);
print "You just selected $text\n";
};
As for your first question, I don't think a combobox listens for keyboard
events by default (they're certainly not mentioned in the "Events" section
of the API). I tried using the Hook() method with the WM_KEYUP event but
that didn't work. Perhaps someone else knows.
Regards,
Rob
------------------------------
Message: 4
Date: Tue, 9 Dec 2008 16:30:37 -0000
From: "Kieren Dunbar" <Kie...@ha...>
Subject: [perl-win32-gui-users] Combobox problems
To: <per...@li...>
Message-ID: <53D...@hh...>
Content-Type: text/plain; charset="us-ascii"
Hi All
I have tried to use a combobox to do something, but I have had two
problems.
1. I don't know what events are triggered if I type into the text box.
It doesn't trigger obvious possibilities such as KeyUp, so I don't know
what to look for.
2. If I trigger the Change trigger, box->Text contains the previous
selection rather than the current one. How can I find
out what the user has selected this time?
I experienced this problem with ActiveState Perl 5.8.8 and Win32::GUI
version 1.0.6. The source I used is as below. Could someone please
suggest what I should do?
Thank you.
Kieron
-start-
my $x = Win32'GUI'Window->new('-size', [100, 100], '-pos', [0,0],
'-visible', 1);
my $y = $x->AddCombobox('-pos', [10, 10], '-size', [50, 200],
'-dropdown', 1);
$y->Add(1, 2);
$y->Select(0);
my $change = sub() {print $y->Text."\n"};
$y->Change('-onChange', $change);
$y->Change('-onKeyUp', $change);
Win32'GUI'Dialog;
-end-
|
|
From: Giuseppe J. C. <msj...@ho...> - 2008-12-12 02:16:55
|
Hi all,
While getting ready for the upcoming Xmas holidays ....
I am writing an application that collects video from network cameras and displays the content via a "Graphic" control, I would also like to display additional information over the images (i.e. Date and Time etc. etc.).
To achieve my goal I am using a second overlayed "Graphic" control with transparent background on which I write the needed information via:
<snippet>
if(defined $$refGUIObj){
my $DC = $$refGUIObj->GetDC();
# Write text trasparently
$DC->BkMode($Transparent);
$DC->SelectObject(new Win32::GUI::Font(
-name => $Font,
-size => $FontSize,
-bold => 0,
)
);
$DC->BackColor(0);
$DC->TextColor($FgColor);
$DC->TextOut($X, $Y, $Text);
$DC->Validate();
}
</snippet>
Unfortunately every new instance overwrites the previous "TextOut". I have attempted to handle it inside the Paint event via:
<snippet>
my $clip_rgn = Win32::GUI::Region->CreateRectRgn( $l, $t, $r, $b );
$dc->SelectClipRgn($clip_rgn);
</snippet>
But only to obtain a yes redrawn window but with the "default" gray background.
Thank you in advance for any assistance you can offer,
Giuseppe
PS For multiple reasons I cannot write directly on the image, hence the need for a transparent "overlay" on which to handle all extra information.
|
|
From: Brian S. <br...@ic...> - 2008-12-11 23:10:27
|
Hi, I'm a newbie trying to build my first GUI application. I've been looking through the website, Googling the web, and I haven't found an answer to my question. If this has been asked and answered previously, I apologize for missing it. Basically, I'm trying to implement a dual listbox interface quite similar to what Eric Hansen wrote about in 1999. What I can't find anywhere is how to fill the left listbox with the files in a given directory, although the closest I found was a tutorial in VB out on the web. I'm trying to use the methods Dir and AddFile, but something's not working. I can't figure out what the Dir method is supposed to return, nor what parameters/arguments to send. I try AddFile and my app crashes. I can make AddString work, though. Some sample code or guidance to point me in the right direction would be greatly appreciated. I'm using Perl 5.8.8 and Win32::GUI 1.06. Thanks, Brian Brian Somers Information Systems Support Technician |
|
From: Kieren D. <Kie...@ha...> - 2008-12-09 16:40:04
|
Hi All
I have tried to use a combobox to do something, but I have had two
problems.
1. I don't know what events are triggered if I type into the text box.
It doesn't trigger obvious possibilities such as KeyUp, so I don't know
what to look for.
2. If I trigger the Change trigger, box->Text contains the previous
selection rather than the current one. How can I find
out what the user has selected this time?
I experienced this problem with ActiveState Perl 5.8.8 and Win32::GUI
version 1.0.6. The source I used is as below. Could someone please
suggest what I should do?
Thank you.
Kieron
-start-
my $x = Win32'GUI'Window->new('-size', [100, 100], '-pos', [0,0],
'-visible', 1);
my $y = $x->AddCombobox('-pos', [10, 10], '-size', [50, 200],
'-dropdown', 1);
$y->Add(1, 2);
$y->Select(0);
my $change = sub() {print $y->Text."\n"};
$y->Change('-onChange', $change);
$y->Change('-onKeyUp', $change);
Win32'GUI'Dialog;
-end-
|
|
From: Robert M. <ro...@th...> - 2008-12-08 11:21:50
|
Ignore me. I mis-read the question, which was about the 'lock the
taskbar' functionality, not about auto-hiding the taskbar.
I have no better approach than that already found by Rob for this. I
still maintain that the WM_COMMAND values for this will not be
guaranteed between OS releases (but you might get lucky).
Rob.
2008/12/8 Robert May <ro...@th...>:
> 2008/12/8 Perl Rob <pe...@co...>:
>> It turns out that editing the registry is not necessary. I simply had to
>> send the WM_COMMAND message (which means a command was selected from a menu)
>> and a specific message number (which, for locking/unlocking the taskbar,
>> happens to be 424). Here's the code in its entirety—just 3 lines. I decided
>> to use SendMessageTimeout() in case the taskbar doesn't respond:
>>
>> use Win32::GUI qw(WM_COMMAND);
>>
>> my $taskbar = Win32::GUI::FindWindow("Shell_TrayWnd", "");
>>
>> Win32::GUI::SendMessageTimeout($taskbar, WM_COMMAND, 424, 0, 0, 1000);
>>
>> By the way, I found a list of message numbers in the 3rd post here (although
>> I'm still not sure where these message numbers are actually defined):
>>
>> http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/eb0b17d6-66de-4ce6-bb3a-0c174a17991e
>
> They are not officially defined, and you'll get no guarantee that they
> remain the same between different releases of the windows OS.
>
> The 'official' way to do this is to call the SHAppBarMessage() function:
> http://msdn.microsoft.com/en-us/library/bb762108.aspx
>
> using it to send the ABM_SETSTATE message:
> http://msdn.microsoft.com/en-us/library/bb787961(VS.85).aspx
>
> (If you just want to toggle the auto-hide bit (leaving the
> always-on-top state unchanged), then you need to call the function
> with the ABM_GETSTATE message type first, and then flit the auto-hide
> bit).
>
> Something like this:
>
> #!perl -w
> use strict;
> use warnings;
>
> # Toggle auto-hide state of windows taskbar
>
> use Win32::API qw();
>
> # Import the ShAppBarMessage() API call
> Win32::API->Import("shell32","SHAppBarMessage","LP","L") or die $^E;
>
> # Constants that we will use
> sub ABM_SETSTATE() {0x0000000A} # Set State message
> sub ABM_GETSTATE() {0x00000004} # Get State message
> sub ABS_AUTOHIDE() {0x00000001} # Auto-hide flag
>
>
> my $state = get_taskbar_state();
> $state ^= ABS_AUTOHIDE; # toggle state bit
> set_taskbar_state($state);
> exit(0);
>
> sub get_taskbar_state {
> return SHAppBarMessage(ABM_GETSTATE,
> pack("LLIIiiiiL", 32, 0, 0, 0, 0, 0, 0, 0, 0 ));
> }
>
> sub set_taskbar_state {
> my $state = shift;
> SHAppBarMessage(ABM_SETSTATE,
> pack("LLIIiiiiL", 36, 0, 0, 0, 0, 0, 0, 0, $state ));
> return;
> }
> __END__
>
> Regards,
> Rob.
>
|
|
From: Robert M. <ro...@th...> - 2008-12-08 10:50:00
|
2008/12/8 Perl Rob <pe...@co...>:
> It turns out that editing the registry is not necessary. I simply had to
> send the WM_COMMAND message (which means a command was selected from a menu)
> and a specific message number (which, for locking/unlocking the taskbar,
> happens to be 424). Here's the code in its entirety—just 3 lines. I decided
> to use SendMessageTimeout() in case the taskbar doesn't respond:
>
> use Win32::GUI qw(WM_COMMAND);
>
> my $taskbar = Win32::GUI::FindWindow("Shell_TrayWnd", "");
>
> Win32::GUI::SendMessageTimeout($taskbar, WM_COMMAND, 424, 0, 0, 1000);
>
> By the way, I found a list of message numbers in the 3rd post here (although
> I'm still not sure where these message numbers are actually defined):
>
> http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/eb0b17d6-66de-4ce6-bb3a-0c174a17991e
They are not officially defined, and you'll get no guarantee that they
remain the same between different releases of the windows OS.
The 'official' way to do this is to call the SHAppBarMessage() function:
http://msdn.microsoft.com/en-us/library/bb762108.aspx
using it to send the ABM_SETSTATE message:
http://msdn.microsoft.com/en-us/library/bb787961(VS.85).aspx
(If you just want to toggle the auto-hide bit (leaving the
always-on-top state unchanged), then you need to call the function
with the ABM_GETSTATE message type first, and then flit the auto-hide
bit).
Something like this:
#!perl -w
use strict;
use warnings;
# Toggle auto-hide state of windows taskbar
use Win32::API qw();
# Import the ShAppBarMessage() API call
Win32::API->Import("shell32","SHAppBarMessage","LP","L") or die $^E;
# Constants that we will use
sub ABM_SETSTATE() {0x0000000A} # Set State message
sub ABM_GETSTATE() {0x00000004} # Get State message
sub ABS_AUTOHIDE() {0x00000001} # Auto-hide flag
my $state = get_taskbar_state();
$state ^= ABS_AUTOHIDE; # toggle state bit
set_taskbar_state($state);
exit(0);
sub get_taskbar_state {
return SHAppBarMessage(ABM_GETSTATE,
pack("LLIIiiiiL", 32, 0, 0, 0, 0, 0, 0, 0, 0 ));
}
sub set_taskbar_state {
my $state = shift;
SHAppBarMessage(ABM_SETSTATE,
pack("LLIIiiiiL", 36, 0, 0, 0, 0, 0, 0, 0, $state ));
return;
}
__END__
Regards,
Rob.
|