RE: [perl-win32-gui-users] Skins in Win32-GUI

2006-02-27 Thread Jeremy White

Here's a much improved version.


Nice example:)

If you come across functions that are "missing" from Win32-GUI, make a list 
of them as they can be added (in most cases) very easily.


Cheers,

jez.





RE: [perl-win32-gui-users] Skins in Win32-GUI

2006-02-27 Thread Plum, Jason
 From the examples I have sen on non-perl sites, the pixel lineup issue
is actually a pre XP vs XP issue. I'll try to find it again to see what
we can do to make the alignments. Something about the applications'
theming in XP.

The adjustment is soemthing in the order of 2-4 pixels.

Jason P.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Brian Millham
Sent: Monday, February 27, 2006 12:48 AM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: RE: [perl-win32-gui-users] Skins in Win32-GUI

Here's a much improved version.

The 2 errors still show when switching to skin mode.

You can you switch between window and skin mode by right clicking the
mouse.

I need to add the code to move the window when in skin mode.

The skin isn't lined up right yet.  It's off by a few pixels at the top.

I've also found some sample code (in C++) to read a bitmap, and create
the regions from the bitmap.  I'll work on that next.

Brian Millham
This message traveled at least 44,000 miles to reach you!
Creator of the DW6000 Monitor
http://www.millham.net/dw6000
[EMAIL PROTECTED] 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Brian Millham
Sent: Sunday, February 26, 2006 7:22 PM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Skins in Win32-GUI

Hi all,
I've been playing with this a little bit this afternoon, and
have a very simple, incomplete app that is sort-of skinned.

The skin bitmap is not properly positioned (I'm not sure how to move it
yet, it needs to cover the complete window, including the title bar) and
there are 2 errors when you start the program complaining about the
CreateEllipticRgn sub.  Oh, and there's no way to close it, you have to
Ctrl-C it from the command line.

To run this, just save the script and the bmp file in the same
directory.

Over all, this shows that it's not to difficult to create a
skinned app with perl and Win32::GUI.

I hope that this helps someone, and I'll send an updated version
once I figure out the glitches.

Brian Millham
This message traveled at least 44,000 miles to reach you!
Creator of the DW6000 Monitor
http://www.millham.net/dw6000
[EMAIL PROTECTED] 

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0608-1, 02/23/2006 Tested on: 2/26/2006 7:21:50 PM
avast! is copyright (c) 2000-2003 ALWIL Software.
http://www.avast.com




---
avast! Antivirus: Inbound message clean.
Virus Database (VPS): 0608-1, 02/23/2006 Tested on: 2/26/2006 8:00:43 PM
avast! is copyright (c) 2000-2003 ALWIL Software.
http://www.avast.com




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0608-1, 02/23/2006 Tested on: 2/27/2006 12:47:39
AM avast! is copyright (c) 2000-2003 ALWIL Software.
http://www.avast.com








Re: [perl-win32-gui-users] Change()

2006-02-27 Thread Octavian Rasnita
From: "Glenn Linderman" <[EMAIL PROTECTED]>

> > Does anyone have an example of using the Change() method (or another
way)
> > for modifying the text that appears in the menus?
>
>$m_config->{'sGetDataDir'}->Change( -text =>
>  "&reset data directory ($datadir)" );
>
> where $m_config is the configuration menu, sGetDataDir is one entry in
> that menu, and this supplies new text, as well as a new hotkey character
> for the text.
>

Hi,

I have tried the following test program, but it doesn't work. After choosing
the "Test" option menu, the program should change the "File" menu to
"Something" but it doesn't do it.


use strict;
use Win32::GUI;

my $Menu = Win32::GUI::MakeMenu(
"&File" => "File",
"> &Test" => {-name => "Test", -onClick => \&test},
);

my $Win = Win32::GUI::Window->new(
-title => "Test",
-pos => [100, 100],
-size => [400, 400],
-menu => $Menu,
-dialogui => 1,
);

$Win->Show();
Win32::GUI::Dialog();

sub Win_Terminate{-1}

sub test {
$Menu->{File}->Change(-text => "Something");
$Win->InvalidateRect(1);
}


Teddy




Re: [perl-win32-gui-users] Change()

2006-02-27 Thread Octavian Rasnita
From: "Glenn Linderman" <[EMAIL PROTECTED]>

>
> didn't help either.  I'm out of my depth here; given that this stuff
> doesn't work in the case you are trying (which I had never tried), but
> does work in other cases (like I use all over the place, and as above,
> for Test, I don't have any more ideas.

Ok, thank you. I think it is a bug in Win32::GUI because the submenus can be
changed that way, but not the top menus. I will create 2 separate menus and
I will replace the entire menu using

$Win->Change(-menu => $second_menu)

because it works that way. Not very nice, but it works.

Teddy




Re: [perl-win32-gui-users] global destruction

2006-02-27 Thread Robert May

Octavian Rasnita wrote:

I have tried to set an event handler -onLostFocus, but if the control loses
the focus when the application closes (alt+F4), it gives the following
error:

Can't call method "Text" on an undefined value at E:\lucru\agenda\agenda.pl
line 68 during global destruction.

How can I detect if the control loses the focus because I have pressed the
tab key, or that if the whole application was closed?


I you can post a short and complete example that I can run and see what 
you're doing then I'll have a look to see if you're doing something 
wrong, or whether we have a bug.  You have not posted enough information 
for me to see what you're trying to do.


Regards,
Rob.
--
Robert May

Win32::GUI, a perl extension for native Win32 applications

http://perl-win32-gui.sourceforge.net/



Re: [perl-win32-gui-users] global destruction

2006-02-27 Thread Octavian Rasnita
From: "Robert May" <[EMAIL PROTECTED]>
> Octavian Rasnita wrote:
> > I have tried to set an event handler -onLostFocus, but if the control
loses
> > the focus when the application closes (alt+F4), it gives the following
> > error:
> >
> > Can't call method "Text" on an undefined value at
E:\lucru\agenda\agenda.pl
> > line 68 during global destruction.
> >
> > How can I detect if the control loses the focus because I have pressed
the
> > tab key, or that if the whole application was closed?
>
> I you can post a short and complete example that I can run and see what
> you're doing then I'll have a look to see if you're doing something
> wrong, or whether we have a bug.  You have not posted enough information
> for me to see what you're trying to do.
>

Ok, here is a simple test program.


use strict;
use Win32::GUI;

my $Win = new Win32::GUI::Window(
-title => 'Test',
-pos => [100, 100],
-size => [400, 400],
-dialogui => 1,
);

$Win->AddButton(
-name => 'But',
-text => "&Ok",
-pos => [10, 10],
-size => [100, 20],
-tabstop => 1,
);

my $Field = $Win->AddTextfield(
-name => 'Field',
-pos => [10, 50],
-size => [100, 20],
-tabstop => 1,
);

$Win->Show();
Win32::GUI::Dialog();

sub Win_Terminate {-1}

sub Field_LostFocus {
$Win->But->Text("New text");
}

__END__

The program works fine, and if I press the tab key when the focus is on the
textfield, the focus moves to the button and the text of the button is
changed.
If I close the application in that moment, it closes without errors. But if
I press agan the tab key and the focus moves again to the text field, and
only after this I close the application, it gives an error, because the
onLostFocus event is fired when the application closes.

I have seen that if I give a name to the textfield using:

my $Field = $Win->Textfield(...

and then I use

$Field->Text("...");

instead of

$Win->But->Text("New text");

the program doesn't give an error. But why does it give an error when using
$Win->Field->Text(...)?

Thank you.