Re: [perl-win32-gui-users] How to change window/dialogbox icon

2004-07-29 Thread Jez White
Hi,

You can use the GetIcon method of an ImageList object to return an icon from 
the original bitmap. You have to create the imagelist and load the bitmap into 
it first - a bit convoluted, but it does work.

Cheers,

jez.

  - Original Message - 
  From: Frazier, Joe Jr 
  To: Eric Hansen ; perl-win32-gui-users@lists.sourceforge.net ; [EMAIL 
PROTECTED] 
  Sent: Wednesday, July 28, 2004 11:02 PM
  Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon


  I use this in several of my applications, however, most of the time, I use 
GUILoft to build my UI.  In this case $win is my window or dialog and this 
should work exactly as if I built the window object manually:

  my $icon = new Win32::GUI::Icon('icon1.ico');
  $win->ChangeIcon($icon);

  note that it is expecting an icon object, not a bitmap object from my testing 
(I have not verified this).  Also,  if I remember correctly, icons used like 
this have to have some certain color depth and size limits or they will not 
work right.  It may be possible to convert a bmp to a properly formatted icon 
in code, but I would not know how (if someone has an example that does not 
require an external program other than a perl module, I would like to know 
about it).  I would also be interested if there is a way to create an icon from 
a dll resource file?

  Joe Frazier, Jr.
  Senior Support Engineer

  Peopleclick Service Support
  Tel:  +1-800-841-2365
  E-Mail: [EMAIL PROTECTED] 






From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Hansen
Sent: Wednesday, July 28, 2004 5:55 PM
To: perl-win32-gui-users@lists.sourceforge.net; [EMAIL PROTECTED]
Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon


Peter, thanks, but what I am really needing is an icon for a Window or 
DialogBox.

Not needing an icon for the system tray.  I was hoping to be able to use a 
small bitmap file

For the icon since I do not have an icon generator.



$Icon = new Win32::GUI::Bitmap("C:\\Bibles\\bible.bmp",1); #1 
specifies icon type

$W->Show();

$W->BringWindowToTop();

$W->SetIcon($Icon,0);  #  0 = small icon, 1 = big icon

$W->ChangeSmallIcon($Icon);



Does not do the trick.



Eric

-Original Message-
From: Peter Eisengrein [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 3:58 PM
To: 'Eric Hansen'; perl-win32-gui-users@lists.sourceforge.net
Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon



my $icon = new Win32::GUI::Icon("Icon.ico");



my $ni = $Window->AddNotifyIcon(
 -icon => $icon,
 -id => 1,
 -name => ni,
 -tip => "Mouseover shows this",
);







  -Original Message-
  From: Eric Hansen [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, July 28, 2004 4:45 PM
  To: perl-win32-gui-users@lists.sourceforge.net
  Subject: [perl-win32-gui-users] How to change window/dialogbox icon

  Can someone show me an example how to

  Change the camel (perl) icon to a user-defined icon?

  In both Windows and DialogBoxes? 



  I tried using Windows/DialogBox option   -icon  =>  $myicon,



  Where $myicon is either defined as.



  $Icon = new Win32::GUI::Icon("C:\\Bibles\\bible.bmp");

   (or)

  $Icon = new Win32::GUI::Bitmap("C:\\Bibles\\bible.bmp",1);



  But neither work.  



  Thanks,

  Eric


RE: [perl-win32-gui-users] How to change window/dialogbox icon

2004-07-29 Thread Eric Hansen
Jez, can you tell me what version of Win32::GUI you are using to be able
to use this syntax?

When I try to run the code you suggest with my version of Win32::GUI, I
get the following error:

 

  Can't locate auto/Win32/GUI/ImageList/GetIcon.al in @INC

 

I looked through the Win32::GUI docs at 

   http://jeb.ca/perl/win32-gui-docs/index.pl/win32-gui-imagelist

And don't see that syntax documented

 

Thanks,

Eric

 

-Original Message-
From: Jez White [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 29, 2004 4:28 AM
To: Frazier, Joe Jr; Eric Hansen;
perl-win32-gui-users@lists.sourceforge.net; [EMAIL PROTECTED]
Subject: Re: [perl-win32-gui-users] How to change window/dialogbox icon

 

Hi,

 

You can use the GetIcon method of an ImageList object to return an icon
from the original bitmap. You have to create the imagelist and load the
bitmap into it first - a bit convoluted, but it does work.

 

Cheers,

 

jez.

 

- Original Message - 

From: Frazier,   Joe Jr 

To: Eric   Hansen ;
perl-win32-gui-users@lists.sourceforge.net ; [EMAIL PROTECTED] 

Sent: Wednesday, July 28, 2004 11:02 PM

Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon

 

I use this in several of my applications, however, most of the time, I
use GUILoft to build my UI.  In this case $win is my window or dialog
and this should work exactly as if I built the window object manually:

 

my $icon = new Win32::GUI::Icon('icon1.ico');
$win->ChangeIcon($icon);

 

note that it is expecting an icon object, not a bitmap object from my
testing (I have not verified this).  Also,  if I remember correctly,
icons used like this have to have some certain color depth and size
limits or they will not work right.  It may be possible to convert a bmp
to a properly formatted icon in code, but I would not know how (if
someone has an example that does not require an external program other
than a perl module, I would like to know about it).  I would also be
interested if there is a way to create an icon from a dll resource file?

 

Joe Frazier, Jr.
Senior Support Engineer

Peopleclick Service Support
Tel:  +1-800-841-2365
E-Mail: [EMAIL PROTECTED] 

 

 


  _  


From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Eric Hansen
Sent: Wednesday, July 28, 2004 5:55 PM
To: perl-win32-gui-users@lists.sourceforge.net; [EMAIL PROTECTED]
Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon

Peter, thanks, but what I am really needing is an icon for a Window or
DialogBox.

Not needing an icon for the system tray.  I was hoping to be able to use
a small bitmap file

For the icon since I do not have an icon generator.

 

$Icon = new Win32::GUI::Bitmap("C:\\Bibles\\bible.bmp",1); #1
specifies icon type

$W->Show();

$W->BringWindowToTop();

$W->SetIcon($Icon,0);  #  0 = small icon, 1 = big icon

$W->ChangeSmallIcon($Icon);

 

Does not do the trick.

 

Eric

-Original Message-
From: Peter Eisengrein [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 28, 2004 3:58 PM
To: 'Eric Hansen'; perl-win32-gui-users@lists.sourceforge.net
Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon

 

my $icon = new Win32::GUI::Icon("Icon.ico");

 

my $ni = $Window->AddNotifyIcon(
 -icon => $icon,
 -id => 1,
 -name => ni,
 -tip => "Mouseover shows this",
);

 

 

 

-Original Message-
From: Eric Hansen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 28, 2004 4:45 PM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] How to change window/dialogbox icon

Can someone show me an example how to

Change the camel (perl) icon to a user-defined icon?

In both Windows and DialogBoxes? 

 

I tried using Windows/DialogBox option   -icon  =>  $myicon,

 

Where $myicon is either defined as.

 

$Icon = new Win32::GUI::Icon("C:\\Bibles\\bible.bmp");

 (or)

$Icon = new Win32::GUI::Bitmap("C:\\Bibles\\bible.bmp",1);

 

But neither work.  

 

Thanks,

Eric



Re: [perl-win32-gui-users] How to change window/dialogbox icon

2004-07-29 Thread Jez White
Arh - I'm using the latest dev build.

You can use the latest PPM from this link:

http://perso.club-internet.fr/rocherl/Win32-GUI-Dev/index.html

Cheers,

jez.


  - Original Message - 
  From: Eric Hansen 
  To: 'Jez White' ; 'Frazier, Joe Jr' ; 
perl-win32-gui-users@lists.sourceforge.net ; [EMAIL PROTECTED] 
  Sent: Thursday, July 29, 2004 3:41 PM
  Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon


  Jez, can you tell me what version of Win32::GUI you are using to be able to 
use this syntax?

  When I try to run the code you suggest with my version of Win32::GUI, I get 
the following error:



Can't locate auto/Win32/GUI/ImageList/GetIcon.al in @INC



  I looked through the Win32::GUI docs at 

 http://jeb.ca/perl/win32-gui-docs/index.pl/win32-gui-imagelist

  And don't see that syntax documented



  Thanks,

  Eric



  -Original Message-
  From: Jez White [mailto:[EMAIL PROTECTED] 
  Sent: Thursday, July 29, 2004 4:28 AM
  To: Frazier, Joe Jr; Eric Hansen; perl-win32-gui-users@lists.sourceforge.net; 
[EMAIL PROTECTED]
  Subject: Re: [perl-win32-gui-users] How to change window/dialogbox icon



  Hi,



  You can use the GetIcon method of an ImageList object to return an icon from 
the original bitmap. You have to create the imagelist and load the bitmap into 
it first - a bit convoluted, but it does work.



  Cheers,



  jez.



- Original Message - 

From: Frazier, Joe Jr 

To: Eric Hansen ; perl-win32-gui-users@lists.sourceforge.net ; [EMAIL 
PROTECTED] 

Sent: Wednesday, July 28, 2004 11:02 PM

Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon



I use this in several of my applications, however, most of the time, I use 
GUILoft to build my UI.  In this case $win is my window or dialog and this 
should work exactly as if I built the window object manually:



my $icon = new Win32::GUI::Icon('icon1.ico');
$win->ChangeIcon($icon);



note that it is expecting an icon object, not a bitmap object from my 
testing (I have not verified this).  Also,  if I remember correctly, icons used 
like this have to have some certain color depth and size limits or they will 
not work right.  It may be possible to convert a bmp to a properly formatted 
icon in code, but I would not know how (if someone has an example that does not 
require an external program other than a perl module, I would like to know 
about it).  I would also be interested if there is a way to create an icon from 
a dll resource file?



Joe Frazier, Jr.
Senior Support Engineer

Peopleclick Service Support
Tel:  +1-800-841-2365
E-Mail: [EMAIL PROTECTED] 






--

  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Eric Hansen
  Sent: Wednesday, July 28, 2004 5:55 PM
  To: perl-win32-gui-users@lists.sourceforge.net; [EMAIL PROTECTED]
  Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon

  Peter, thanks, but what I am really needing is an icon for a Window or 
DialogBox.

  Not needing an icon for the system tray.  I was hoping to be able to use 
a small bitmap file

  For the icon since I do not have an icon generator.



  $Icon = new Win32::GUI::Bitmap("C:\\Bibles\\bible.bmp",1); #1 
specifies icon type

  $W->Show();

  $W->BringWindowToTop();

  $W->SetIcon($Icon,0);  #  0 = small icon, 1 = big icon

  $W->ChangeSmallIcon($Icon);



  Does not do the trick.



  Eric

  -Original Message-
  From: Peter Eisengrein [mailto:[EMAIL PROTECTED] 
  Sent: Wednesday, July 28, 2004 3:58 PM
  To: 'Eric Hansen'; perl-win32-gui-users@lists.sourceforge.net
  Subject: RE: [perl-win32-gui-users] How to change window/dialogbox icon



  my $icon = new Win32::GUI::Icon("Icon.ico");



  my $ni = $Window->AddNotifyIcon(
   -icon => $icon,
   -id => 1,
   -name => ni,
   -tip => "Mouseover shows this",
  );







-Original Message-
From: Eric Hansen [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 28, 2004 4:45 PM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] How to change window/dialogbox icon

Can someone show me an example how to

Change the camel (perl) icon to a user-defined icon?

In both Windows and DialogBoxes? 



I tried using Windows/DialogBox option   -icon  =>  $myicon,



Where $myicon is either defined as.



$Icon = new Win32::GUI::Icon("C:\\Bibles\\bible.bmp");

 (or)

$Icon = new Win32::GUI::Bitmap("C:\\Bibles\\bible.bmp",1);



But neither work.  



Thanks,

Eric


[perl-win32-gui-users] 2 Questions

2004-07-29 Thread YorHel
Hi

I'm trying to create a label with transparent background, I know this
is asked before, but this
(http://sourceforge.net/mailarchive/message.php?msg_id=6975835)
doesn't work.
Here's what I want:

use Win32::GUI;

$win = new Win32::GUI::Window(
  -name => "testwindow",
  -title=> "Testing...",
  -pos  => [ 200, 150 ],
  -size => [ 200, 200 ],
  -OnTerminate => sub { return -1; }
);

$label1 = $win->AddLabel( 
  -name => "testlabel1",
  -pos  => [ 0, 0 ],
  -size => [ 200, 200 ],
  -background => "#FF",
  -text => "Label1", 
);

$label2 = $win->AddLabel(
  -name => "testlabel2",
  -pos  => [ 100, 10 ],
  -size => [ 80, 130 ],
  -align=> "right",
  -text => "Label2",
#  -background => "#FF",  ## That's what I want, but not that way :)
  -pushexstyle => 0x0020,  ## Doesn't make the background transparent
);
$win->Show();
Win32::GUI::Dialog();

You can still see the background of label2 above label1. I also tried
things like -expushstyle, -style, -exstyle, -pushstyle, etc...
How to get this working?



Second: I've got some problems with -tabstop and -parent, here's an example:

use Win32::GUI;

$win = new Win32::GUI::Window(
  -name => "testwindow",
  -title=> "Testing...",
  -pos  => [ 200, 150 ],
  -size => [ 200, 200 ],
  -dialogui => 1,
  -OnTerminate => sub { return -1; }
);

$groupbox = $win->AddGroupbox(  # using a groupbox as a parent
  -name => "groupbox",
  -pos  => [ 0, 0 ],
  -size => [ $win->ScaleWidth, $win->ScaleHeight ],
  -text => "Groupbox", 
);

$field1 = $win->AddTextfield(
  -name => "field1",
  -size => [ 100, 20 ],
  -pos  => [ 10, 10 ],
  -parent => $groupbox,
  -prompt=> [ "test: ", 30 ], 
  -tabstop => 1,
);

$field2 = $win->AddTextfield(
  -name => "field2",
  -size => [ 100, 20 ],
  -pos  => [ 10, 40 ],
  -parent => $groupbox,
  -prompt=> [ "test2: ", 30 ],
  -tabstop => 1,
);
$win->Show();
Win32::GUI::Dialog();

When I comment the -parent options in $field1 and $field2, it works
perfect, but I can't tab between them if I use the -parent option. Any
solutions?

Thanks, yorhel