I beg to differ.  The documentation (Trackbar.html) says:

   *|Pos([VALUE],[REDRAW=1])|*
   Set or Get maximum logical position for the slider in a trackbar

Which I take to mean that the default for REDRAW is 1, and that you have to explicitly pass 0 not to redraw. It would certainly be locical to me that redrawing be the default.

Rob.

Jez White wrote:

Hi,

I'm not sure if this is a bug, but a "feature":)

The docs seem to imply that if you want the control to redraw then you have to explicitly pass 1.

Thoughts anyone?

Cheers,

jez.
----- Original Message ----- From: "Robert May" <[EMAIL PROTECTED]>
To: <perl-win32-gui-users@lists.sourceforge.net>
Sent: Wednesday, March 16, 2005 8:44 PM
Subject: [perl-win32-gui-users] BUG Followup[1092732 ]:Slider no longer supports setting position


I have submitted a follow-up a bug report whose text I reproduce below.
http://sourceforge.net/tracker/index.php?func=detail&aid=1092732&group_id=16572&atid=116572

Regards,
Rob.

This example shows a problem with

Win32::GUI::Slider/Trackbar::Pos() method.  It creates 3
sliders,
and attempts to set them to their center point in 3
different ways
- Pos(50)
- SetPos(50)
- Pos(50,1)
The first method does not re-draw the slider in the new position
until the control is selected (click near the bottom right
of the
select area), although it's stored position is correct (can be
confirmed with GetPos()). This appears to be because when
called with one parameter the re-draw flag in the SendMessage
call is set incorrectly: forcing the redraw flag to 1 with
Pos(50,1)
solves the problem, as does using SetPos(50) which correctly
defaults its re-draw flag to 1.

Workaround:
(1) Use the 2-parameter version of Pos, forcing the redraw
flag to 1.
(2) Use SetPos method

I think (but have not tried) that the
Solution is to correct line 642 of trackbar.xs from
RETVAL = SendMessage(handle, TBM_SETPOS, 0, (LPARAM)
SvIV(ST(1)))
to
RETVAL = SendMessage(handle, TBM_SETPOS, 1, (LPARAM)
SvIV(ST(1)))

This 'bug' also appears in Min() (line 603) and Max() (line
623),
although in those functions it has no obvious visual impact.

use strict;
use warnings;

use Win32::GUI 1.0;

my $mw = new Win32::GUI::Window (
-size => [200,200],
);

my $s1 = $mw->AddSlider (
-width => $mw->ScaleHeight(),
-height => 30,
);
$s1->Pos(50);

my $s2 = $mw->AddSlider (
-width => $mw->ScaleHeight(),
-height => 30,
-top => $s1->Top() + $s1->Height(),
);
$s2->SetPos(50);

my $s3 = $mw->AddSlider (
-width => $mw->ScaleHeight(),
-height => 30,
-top => $s2->Top() + $s2->Height(),
);
$s3->Pos(50,1);

print "1: ".$s1->GetPos()."\n";
print "2: ".$s2->GetPos()."\n";
print "3: ".$s3->GetPos()."\n";

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




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users





Reply via email to