> -----Original Message-----
> From: Jeremy White [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 23, 2003 3:59 PM
> To: [EMAIL PROTECTED];
> perl-win32-gui-users@lists.sourceforge.net
> Subject: Re: [perl-win32-gui-users] Progress bar's [coloring]
> 
> 
> >From: Jonathan Southwick <[EMAIL PROTECTED]>
> >I have been wanting to do this forever myself but never was 
> able to ... 
> >until today!!!
> >
> >I figured out a way to do it and its rather simple.  You need to use 
> >SendMessage though but it works.
> >
> >Here is the answer:
> >
> >$result = SendMessage($hWndControl, PBM_SETBARCOLOR, 0, $color);
> 
> Nice work. This may be a little cheeky but could you turn 
> this into a method 
> (SetColor?) so it could be added to the next build of 
> win32::gui? Might as 
> well try and get all these enhancements into the core as they 
> are solved.
> 
> Cheers,
> 
> jez.
> 

I would have to agree.  Can this be added to the next Dev Branch of the app as 
both compile time properties and also as methods?

Johan, is there any way these can also be added as properties to TGL?  
Depending on how long it will be before the next release will come out, you may 
want to do it yourself if the code, or wait for the whole thing in the next 
version of Win32::GUI and call the native functions.

My hope now that we have several very committed users to developing this, we 
will see releases at least once a month or so...

In the meantime, what I do is something like this:

package Win32::GUI;
sub CenterOnScreen{
         my ($window) = shift;
         #my $desk = $window->GetDesktopWindow();
         #my(undef, undef, $d_width, $d_height)= 
Win32::GUI::GetWindowRect($desk);
         my ($win_width)= $window->ScaleWidth();
         my ($win_height) = $window->ScaleHeight();
         my $delta_w = ($d_width  /2) - ($win_width/ 2);
         my $delta_h = ($d_height / 2) - ($win_height / 2);
         $window->Move($delta_w, $delta_h);
         return 1;
}
package somethingelse

my $Window = new Win32::GUI::Window (
                #set everything here.  I left out for brevity...
)
$Window->CenterOnScreen();
$Window->Enable();
$Window->Show();
Win32::GUI::Dialog();

so that I can have a single method for doing centered window placement.  You 
could just as easily have other methods which do things simular and be called 
as native object methods.  Of course, this is not a complete working example, 
but it gives you the idea.  I do not know if this is a "good" practice, but it 
works.  If someone would like to translate this into a proper Win32::GUI 
method, I would expect this would be more efficient in xs with a perl method 
calling the xs function.

Reply via email to