From 618134b3a26abe7c6604cd2335c5537d55d7f99d Mon Sep 17 00:00:00 2001 From: tombo Date: Sat, 1 Nov 2008 15:17:43 +0000 Subject: [PATCH] LCL carbon: fixed #0012250: Scrollbox range in Carbon by skalogryyz - return updated position in SetScrollInfo git-svn-id: trunk@17171 - --- lcl/interfaces/carbon/carbonprivate.pp | 12 ++++++------ lcl/interfaces/carbon/carbonwinapi.inc | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lcl/interfaces/carbon/carbonprivate.pp b/lcl/interfaces/carbon/carbonprivate.pp index 53f4348c2c..17794b4144 100644 --- a/lcl/interfaces/carbon/carbonprivate.pp +++ b/lcl/interfaces/carbon/carbonprivate.pp @@ -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 diff --git a/lcl/interfaces/carbon/carbonwinapi.inc b/lcl/interfaces/carbon/carbonwinapi.inc index f944e802ae..a07de8fda4 100644 --- a/lcl/interfaces/carbon/carbonwinapi.inc +++ b/lcl/interfaces/carbon/carbonwinapi.inc @@ -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