mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 14:39:22 +02:00
Win32: fix drawing selection range if TTrackBar.Reversed is True. Resolves issue #40080.
(cherry picked from commit 0e8088ef64
)
This commit is contained in:
parent
f65827c58b
commit
35d60a2bb6
@ -1008,11 +1008,19 @@ begin
|
||||
if ((SelStart = 0) and (SelEnd = 0)) or not ShowSelRange then
|
||||
Windows.SendMessage(wHandle, TBM_CLEARSEL, Windows.WPARAM(True), 0)
|
||||
else
|
||||
begin
|
||||
if (GetWindowLong(ATrackBar.Handle, GWL_STYLE) and TBS_REVERSED) <> 0 then
|
||||
begin
|
||||
Windows.SendMessage(wHandle, TBM_SETSELSTART, Windows.WParam(False), ATrackBar.Max-SelEnd); //SelStart/SelEnd are not relative to Min/Max
|
||||
Windows.SendMessage(wHandle, TBM_SETSELEND, Windows.WParam(True), ATrackBar.Max-SelStart)
|
||||
end
|
||||
else
|
||||
begin
|
||||
Windows.SendMessage(wHandle, TBM_SETSELSTART, Windows.WParam(False), SelStart);
|
||||
Windows.SendMessage(wHandle, TBM_SETSELEND, Windows.WParam(True), SelEnd)
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
class function TWin32WSTrackBar.GetPosition(const ATrackBar: TCustomTrackBar): integer;
|
||||
|
Loading…
Reference in New Issue
Block a user