RE: [perl-win32-gui-users] no taskbar entry for a Win32::GUI program

2003-06-25 Thread Frazier, Joe Jr
> -Original Message-
> From: Glenn Linderman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 24, 2003 10:07 PM
> To: Win32 GUI
> Subject: [perl-win32-gui-users] no taskbar entry for a Win32::GUI
> program
> 
> 
>  From time to time the question has been asked on this list 
> about how to 
> have a Win32::GUI program running, but have no entry in the taskbar.
> 
> When hidden and disabled, no entry will appear, but when shown or 
> enabled, it will come back.
> 
> Unless, when you create the window, you use:
> 
>-toolwindow => 1,
> 
> There is a more complicated solution, involving creating a fake main 
> window, making a real main window with the fake main window 
> as a parent, 
> and then deleting the fake main window.  This technique also 
> works, but
> is much more complex than the option above.


Glenn, I have not tried the above, but if it is what I "think" it is, then the 
third solution (one I currently use in an application) is to have your minimize 
and maximize events explicitly call hide() and disable() / show() and Enable() 
respectivly.  I wrap these up (with other stuff) in a if ($window->IsVisable()) 
block:

sub Window_Minimize {
if ($Window->IsVisible){
logit ("Window is Visible\n") if ($debug);
$Window->Disable();
logit ("Window Disabling\n") if ($debug);
$Window->Hide();
logit ("Window Hiding\n") if ($debug);
$Window->CenterOnScreen();    Custom function added so it 
can be called as a method (it is a hack and probably not a good idea, but it 
does what I need it to do with no problems)
$Window->NI->Modify( -id => 1, -tip => "Show PCKeys");
$PopupMenu->{RestoreItem}->Enabled(1);
$PopupMenu->{CloseItem}->Enabled(0);
return 0;
}
}


Then, since it is not visable in Task bar, etc, the only way to get back is via 
my TrayIcon and here I put code to reverse the process:

ub NI_Click {  # NI is the name of the trayICON
if ($Window->IsVisible){
$Window->Disable();
$Window->Hide();
$Window->CenterOnScreen();    Custom function added so it 
can be called as a method (it is a hack and probably not a good idea, but it 
does what I need it to do with no problems)

$Window->NI->Modify( -id => 1, -tip => "Show PCKeys");
$PopupMenu->{RestoreItem}->Enabled(1);
$PopupMenu->{CloseItem}->Enabled(0);
return 1;
}
else {
$Window->NI->Modify( -id => 1,-tip => "Hide PCKeys");
$PopupMenu->{RestoreItem}->Enabled(0);
$PopupMenu->{CloseItem}->Enabled(1);
$Window->Enable();
$Window->CenterOnScreen();   Custom function added so it 
can be called as a method (it is a hack and probably not a good idea, but it 
does what I need it to do with no problems)
$Window->Show();
$Window->SetForegroundWindow();
$CBdropdown->SetFocus();
return 1;
}
}

When I get around to it, I will try your find.  Thanks!





Re: [perl-win32-gui-users] no taskbar entry for a Win32::GUI program

2003-06-25 Thread Glenn Linderman

On approximately 6/25/2003 7:04 AM, came the following characters from
the keyboard of Frazier, Joe Jr:
>>-Original Message-
>>From: Glenn Linderman [mailto:[EMAIL PROTECTED]
>>Sent: Tuesday, June 24, 2003 10:07 PM
>>To: Win32 GUI
>>Subject: [perl-win32-gui-users] no taskbar entry for a Win32::GUI
>>program
>>
>>
>> From time to time the question has been asked on this list
>>about how to
>>have a Win32::GUI program running, but have no entry in the taskbar.
>>
>>When hidden and disabled, no entry will appear, but when shown or
>>enabled, it will come back.
>>
>>Unless, when you create the window, you use:
>>
>>   -toolwindow => 1,
>>
>>There is a more complicated solution, involving creating a fake main
>>window, making a real main window with the fake main window
>>as a parent,
>>and then deleting the fake main window.  This technique also
>>works, but
>>is much more complex than the option above.
>
>
>
> Glenn, I have not tried the above, but if it is what I "think" it is, 
then the third solution (one I currently use in an application) is to 
have your minimize and maximize events explicitly call hide() and 
disable() / show() and Enable() respectivly.  I wrap these up (with 
other stuff) in a if ($window->IsVisable()) block:

>
> sub Window_Minimize {
>if ($Window->IsVisible){
>logit ("Window is Visible\n") if ($debug);
>$Window->Disable();
>logit ("Window Disabling\n") if ($debug);
>$Window->Hide();
>logit ("Window Hiding\n") if ($debug);
> 		$Window->CenterOnScreen();    Custom function added so it can 
be called as a method (it is a hack and probably not a good idea, but it 
does what I need it to do with no problems)

>$Window->NI->Modify( -id => 1, -tip => "Show PCKeys");
>$PopupMenu->{RestoreItem}->Enabled(1);
>$PopupMenu->{CloseItem}->Enabled(0);
>return 0;
>}
> }
>
>
> Then, since it is not visable in Task bar, etc, the only way to get 
back is via my TrayIcon and here I put code to reverse the process:

>
> ub NI_Click {  # NI is the name of the trayICON
>if ($Window->IsVisible){
>$Window->Disable();
>$Window->Hide();
> 		$Window->CenterOnScreen();    Custom function added so it can 
be called as a method (it is a hack and probably not a good idea, but it 
does what I need it to do with no problems)

>
>$Window->NI->Modify( -id => 1, -tip => "Show PCKeys");
>$PopupMenu->{RestoreItem}->Enabled(1);
>$PopupMenu->{CloseItem}->Enabled(0);
>return 1;
>}
>else {
>$Window->NI->Modify( -id => 1,-tip => "Hide PCKeys");
>$PopupMenu->{RestoreItem}->Enabled(0);
>$PopupMenu->{CloseItem}->Enabled(1);
>$Window->Enable();
> 		$Window->CenterOnScreen();   Custom function added so it can be 
called as a method (it is a hack and probably not a good idea, but it 
does what I need it to do with no problems)

>$Window->Show();
>$Window->SetForegroundWindow();
>$CBdropdown->SetFocus();
>return 1;
>}
> }
>
> When I get around to it, I will try your find.  Thanks!

Hi Joe,

My second paragraph attempted to briefly describe that solution
which doesn't eliminate the task bar window during use of a window, but
does eliminate it while it is hidden and disabled.  That is a nice
technique for programs that use a NotifyIcon as their interface when
they are hidden from the screen, yet would like one or more of their
windows to have task bar entries when they do appear on the screen.
That technique has been described before, which is why I gave it so
little discussion area, although it has been a good while now, so your
redscription of the technique is not inappropriate.

Rather, I was focusing on the slightly different question of how to have
a window that _never_ appears in the taskbar, which is what "-toolwindow
=> 1" achieves.  This technique is useful for programs that use the
NotifyIcon as their interface when they are hidden from the screen, and
that probably only have one window at a time displayed, and don't feel
the need to have that window appear in the task bar (perhaps clicking
the NotifyIcon brings to the the front, so the task bar entry is not
needed).

Hopefully, some of this thread might make it in to the new documentation
project, somewhat edited for the different nature of documents vs
newsthreads.

--
Glenn -- http://nevcal.com/
===
Wise men talk because they have something to say.
Fools talk because they have to say something." -- Plato




Re: [perl-win32-gui-users] no taskbar entry for a Win32::GUI program

2003-06-25 Thread Glenn Linderman

On approximately 6/25/2003 10:39 AM, came the following characters from
the keyboard of Frazier, Joe Jr:
>> -Original Message- From: Glenn Linderman
>> [mailto:[EMAIL PROTECTED]
>>
>> On approximately 6/25/2003 7:04 AM, came the following characters
>> from the keyboard of Frazier, Joe Jr:
>>
 -Original Message- From: Glenn Linderman
 [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 10:07 PM

 From time to time the question has been asked on this list
 about how to have a Win32::GUI program running, but have no
 entry in the taskbar.

 When hidden and disabled, no entry will appear, but when shown
 or enabled, it will come back.
>>>
>
> This bit here, in combination with the first sentance was what
> confused me.  My solution ( I assume someone on the list presented it
> to me over 2 years ago when I created this app) does show the icon on
> the task bar when the app is viewable on the screen, but not on the
> task bar when minimized.  I was just unclear that you mean no taskbar
> icon "ever".  Question?  is it the disable or the hide that removes
> from the taskbar?  I have never really played with various
> combinations to find out what does what in such a situation and what
> happens to the main window compaired to the task bar icon. Do not
> have time to check right now, but would make for more bulk in the
> documentation being written

It takes both "hidden" and "disabled" to remove a window's entry from 
the taskbar using this technique.  And when you "show" or "enable", the 
taskbar entry comes back.


 Unless, when you create the window, you use:

 -toolwindow => 1,

 There is a more complicated solution, involving creating a
>>>
>> fake main
>>
 window, making a real main window with the fake main window as
 a parent, and then deleting the fake main window.  This
 technique also works, but is much more complex than the option
 above.
>>>
>
> I just knowticed that this option also seems to get rid of my
> Minimize button??

Hmm.  So it does.  And it gets rid of the Maximize button too.  Except I 
see you didn't have a Maximize button already.  Looks like -toolwindow 
overrides -maximizebox, -minimizebox, and -helpbutton, eliminating them 
all, as well as getting rid of the taskbar entry.


> It also makes the "X" to close the
> window like real small (1/3-1/2 normal size).  This is on Win 2k.
> Perl 5.6.1, GUI .668.

I'm using Perl 5.8, GUI 0.0.668, for reference.

I don't notice an appreciable difference is the size of my close box "X" 
by adding the -toolwindow, for my window definitions.  I didn't try your 
window definition, though.  However, maybe that was due to the fact that 
 I specified the same -font parameter for both cases.  With a -font 
parameter, you may be picking up different sized system fonts for the 
two cases.


--
Glenn -- http://nevcal.com/
===
Like almost everyone, I receive a lot of spam every day, much of it
offering to help me get out of debt or get rich quick.  It's ridiculous.
-- Bill Gates




RE: [perl-win32-gui-users] no taskbar entry for a Win32::GUI program

2003-06-25 Thread Frazier, Joe Jr
I will take a screen shot in .bmp format tomorrow of both to show the 
difference and send to the list.

Joe Frazier, Jr.
Technical Support Engineer
Peopleclick Service Support

Tel:  +1-800-841-2365
E-Mail: mailto:[EMAIL PROTECTED]


> -Original Message-
> From: Glenn Linderman [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 25, 2003 3:48 PM
> To: Frazier, Joe Jr; Win32 GUI
> Subject: Re: [perl-win32-gui-users] no taskbar entry for a Win32::GUI
> program
> 
> 
> On approximately 6/25/2003 10:39 AM, came the following 
> characters from
> the keyboard of Frazier, Joe Jr:
>  >> -Original Message- From: Glenn Linderman
>  >> [mailto:[EMAIL PROTECTED]
>  >>
>  >> On approximately 6/25/2003 7:04 AM, came the following characters
>  >> from the keyboard of Frazier, Joe Jr:
>  >>
>   -Original Message- From: Glenn Linderman
>   [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 10:07 PM
>  
>   From time to time the question has been asked on this list
>   about how to have a Win32::GUI program running, but have no
>   entry in the taskbar.
>  
>   When hidden and disabled, no entry will appear, but when shown
>   or enabled, it will come back.
>  >>>
>  >
>  > This bit here, in combination with the first sentance was what
>  > confused me.  My solution ( I assume someone on the list 
> presented it
>  > to me over 2 years ago when I created this app) does show 
> the icon on
>  > the task bar when the app is viewable on the screen, but not on the
>  > task bar when minimized.  I was just unclear that you mean 
> no taskbar
>  > icon "ever".  Question?  is it the disable or the hide that removes
>  > from the taskbar?  I have never really played with various
>  > combinations to find out what does what in such a 
> situation and what
>  > happens to the main window compaired to the task bar 
> icon. Do not
>  > have time to check right now, but would make for more bulk in the
>  > documentation being written
> 
> It takes both "hidden" and "disabled" to remove a window's entry from 
> the taskbar using this technique.  And when you "show" or 
> "enable", the 
> taskbar entry comes back.
> 
>   Unless, when you create the window, you use:
>  
>   -toolwindow => 1,
>  
>   There is a more complicated solution, involving creating a
>  >>>
>  >> fake main
>  >>
>   window, making a real main window with the fake main window as
>   a parent, and then deleting the fake main window.  This
>   technique also works, but is much more complex than the option
>   above.
>  >>>
>  >
>  > I just knowticed that this option also seems to get rid of my
>  > Minimize button??
> 
> Hmm.  So it does.  And it gets rid of the Maximize button 
> too.  Except I 
> see you didn't have a Maximize button already.  Looks like 
> -toolwindow 
> overrides -maximizebox, -minimizebox, and -helpbutton, 
> eliminating them 
> all, as well as getting rid of the taskbar entry.
> 
>  > It also makes the "X" to close the
>  > window like real small (1/3-1/2 normal size).  This is on Win 2k.
>  > Perl 5.6.1, GUI .668.
> 
> I'm using Perl 5.8, GUI 0.0.668, for reference.
> 
> I don't notice an appreciable difference is the size of my 
> close box "X" 
> by adding the -toolwindow, for my window definitions.  I 
> didn't try your 
> window definition, though.  However, maybe that was due to 
> the fact that 
>   I specified the same -font parameter for both cases.  With a -font 
> parameter, you may be picking up different sized system fonts for the 
> two cases.
> 
> -- 
> Glenn -- http://nevcal.com/
> ===
> Like almost everyone, I receive a lot of spam every day, much of it
> offering to help me get out of debt or get rich quick.  It's 
> ridiculous.
> -- Bill Gates
> 
> 
> 



[perl-win32-gui-users] List views...How to?

2003-06-25 Thread Steven Swenson

I am trying to insert some text into a listview.

 my %item = ( -item=> 0,-text => "$text");
 $listview->InsertItem (\%item);

This doesn't work... is there some other option needed for a ,list?




Re: [perl-win32-gui-users] List views...How to?

2003-06-25 Thread Erick Bourgeois
On Wed, 25 Jun 2003 19:13:06 -0500, Steven Swenson <[EMAIL PROTECTED]> said:

> I am trying to insert some text into a listview.
> 
>   my %item = ( -item=> 0,-text => "$text");
>   $listview->InsertItem (\%item);

When sending options, you should not use a hash reference.
Instead, send the "whole" hash, e.g.

$listview->InsertItem (%item);

erick