mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:19:24 +02:00
LCL carbon: fixed #0012250: Scrollbox range in Carbon by skalogryyz - return updated position in SetScrollInfo
git-svn-id: trunk@17171 -
This commit is contained in:
parent
78b010d112
commit
618134b3a2
@ -877,7 +877,7 @@ end;
|
|||||||
Method: TCarbonCustomControl.SetScrollInfo
|
Method: TCarbonCustomControl.SetScrollInfo
|
||||||
Params: SBStyle - Scrollbar type (SB_VERT, SB_HORZ)
|
Params: SBStyle - Scrollbar type (SB_VERT, SB_HORZ)
|
||||||
ScrollInfo - Scrolling info
|
ScrollInfo - Scrolling info
|
||||||
Returns: The old scroll bar position
|
Returns: The new scroll bar position
|
||||||
|
|
||||||
Sets the scrolling info of the specified scroll bar
|
Sets the scrolling info of the specified scroll bar
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
@ -893,11 +893,6 @@ begin
|
|||||||
' SBStyle: ' + DbgS(SBStyle) + ' ' + DbgS(ScrollInfo));
|
' SBStyle: ' + DbgS(SBStyle) + ' ' + DbgS(ScrollInfo));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
if SBStyle = SB_HORZ then
|
|
||||||
Result := Round(FScrollOrigin.X);
|
|
||||||
if SBStyle = SB_VERT then
|
|
||||||
Result := Round(FScrollOrigin.Y);
|
|
||||||
|
|
||||||
if (SIF_RANGE and ScrollInfo.fMask) > 0 then
|
if (SIF_RANGE and ScrollInfo.fMask) > 0 then
|
||||||
begin
|
begin
|
||||||
if SBStyle = SB_HORZ then
|
if SBStyle = SB_HORZ then
|
||||||
@ -928,6 +923,11 @@ begin
|
|||||||
FScrollPageSize.Y := ScrollInfo.nPage;
|
FScrollPageSize.Y := ScrollInfo.nPage;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if SBStyle = SB_HORZ then
|
||||||
|
Result := Round(FScrollOrigin.X);
|
||||||
|
if SBStyle = SB_VERT then
|
||||||
|
Result := Round(FScrollOrigin.Y);
|
||||||
|
|
||||||
if (SBStyle in [SB_HORZ, SB_VERT]) and
|
if (SBStyle in [SB_HORZ, SB_VERT]) and
|
||||||
((ScrollInfo.fMask and (SIF_RANGE or SIF_POS or SIF_PAGE)) > 0) then
|
((ScrollInfo.fMask and (SIF_RANGE or SIF_POS or SIF_PAGE)) > 0) then
|
||||||
begin
|
begin
|
||||||
|
@ -3092,7 +3092,7 @@ end;
|
|||||||
SBStyle - Scroll bar flag
|
SBStyle - Scroll bar flag
|
||||||
ScrollInfo - Scrolling info
|
ScrollInfo - Scrolling info
|
||||||
bRedraw - Redraw the scroll bar?
|
bRedraw - Redraw the scroll bar?
|
||||||
Returns: The old position value
|
Returns: The new position value
|
||||||
|
|
||||||
Sets the parameters of a scroll bar
|
Sets the parameters of a scroll bar
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
@ -3113,7 +3113,6 @@ begin
|
|||||||
if not CheckWidget(Handle, 'SetScrollInfo', TCarbonControl) then Exit;
|
if not CheckWidget(Handle, 'SetScrollInfo', TCarbonControl) then Exit;
|
||||||
|
|
||||||
CarbonControl := TCarbonControl(Handle);
|
CarbonControl := TCarbonControl(Handle);
|
||||||
Result := CarbonControl.GetValue;
|
|
||||||
|
|
||||||
if (SIF_RANGE and ScrollInfo.fMask) > 0 then
|
if (SIF_RANGE and ScrollInfo.fMask) > 0 then
|
||||||
begin
|
begin
|
||||||
@ -3124,6 +3123,8 @@ begin
|
|||||||
CarbonControl.SetValue(ScrollInfo.nPos);
|
CarbonControl.SetValue(ScrollInfo.nPos);
|
||||||
if (SIF_PAGE and ScrollInfo.fMask) > 0 then
|
if (SIF_PAGE and ScrollInfo.fMask) > 0 then
|
||||||
CarbonControl.SetViewSize(ScrollInfo.nPage);
|
CarbonControl.SetViewSize(ScrollInfo.nPage);
|
||||||
|
|
||||||
|
Result := CarbonControl.GetValue;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user