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:
tombo 2008-11-01 15:17:43 +00:00
parent 78b010d112
commit 618134b3a2
2 changed files with 9 additions and 8 deletions

View File

@ -877,7 +877,7 @@ end;
Method: TCarbonCustomControl.SetScrollInfo
Params: SBStyle - Scrollbar type (SB_VERT, SB_HORZ)
ScrollInfo - Scrolling info
Returns: The old scroll bar position
Returns: The new scroll bar position
Sets the scrolling info of the specified scroll bar
------------------------------------------------------------------------------}
@ -893,11 +893,6 @@ begin
' SBStyle: ' + DbgS(SBStyle) + ' ' + DbgS(ScrollInfo));
{$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
begin
if SBStyle = SB_HORZ then
@ -927,6 +922,11 @@ begin
if SBStyle = SB_VERT then
FScrollPageSize.Y := ScrollInfo.nPage;
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
((ScrollInfo.fMask and (SIF_RANGE or SIF_POS or SIF_PAGE)) > 0) then

View File

@ -3092,7 +3092,7 @@ end;
SBStyle - Scroll bar flag
ScrollInfo - Scrolling info
bRedraw - Redraw the scroll bar?
Returns: The old position value
Returns: The new position value
Sets the parameters of a scroll bar
------------------------------------------------------------------------------}
@ -3113,7 +3113,6 @@ begin
if not CheckWidget(Handle, 'SetScrollInfo', TCarbonControl) then Exit;
CarbonControl := TCarbonControl(Handle);
Result := CarbonControl.GetValue;
if (SIF_RANGE and ScrollInfo.fMask) > 0 then
begin
@ -3124,6 +3123,8 @@ begin
CarbonControl.SetValue(ScrollInfo.nPos);
if (SIF_PAGE and ScrollInfo.fMask) > 0 then
CarbonControl.SetViewSize(ScrollInfo.nPage);
Result := CarbonControl.GetValue;
end
else
begin