From d641fda8033d24d077eeaa05d6338f7b625e469a Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 19 May 2014 13:55:18 +0000 Subject: [PATCH] IDE: debug for component palette, carbon needs implementation of ShowScrollInfo git-svn-id: trunk@45094 - --- ide/componentpalette.pas | 13 +++++++++++-- lcl/include/controlscrollbar.inc | 4 ++-- lcl/interfaces/carbon/carbonwinapi.inc | 8 ++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ide/componentpalette.pas b/ide/componentpalette.pas index 76b6ef6672..d1a33c4df9 100644 --- a/ide/componentpalette.pas +++ b/ide/componentpalette.pas @@ -568,8 +568,17 @@ begin ButtonX:= ((ComponentPaletteBtnWidth*3) div 2) + 2; - //GetClientRect(ScrollBox.Handle,WSClientRect); - //debugln(['TComponentPalette.ReAlignButtons ScrollBox.Bounds=',dbgs(ScrollBox.BoundsRect),' ClientRect=',dbgs(ScrollBox.ClientRect),' WSClientRect=',dbgs(WSClientRect),' VertScrollBar.Size=',ScrollBox.VertScrollBar.Size,' ClientSizeWithoutBar=',ScrollBox.VertScrollBar.ClientSizeWithoutBar,' IsScrollBarVisible=',ScrollBox.VertScrollBar.IsScrollBarVisible]); + {GetClientRect(ScrollBox.Handle,WSClientRect); + debugln(['TComponentPalette.ReAlignButtons ScrollBox.Bounds=',dbgs(ScrollBox.BoundsRect), + ' ClientRect=',dbgs(ScrollBox.ClientRect),' WSClientRect=',dbgs(WSClientRect), + ' VertScrollBar.Size=',ScrollBox.VertScrollBar.Size, + ' ClientSizeWithoutBar=',ScrollBox.VertScrollBar.ClientSizeWithoutBar, + ' IsScrollBarVisible=',ScrollBox.VertScrollBar.IsScrollBarVisible, + ' HorzScrollBar.Size=',ScrollBox.HorzScrollBar.Size, + ' Page=',ScrollBox.HorzScrollBar.Page, + ' Range=',ScrollBox.HorzScrollBar.Range, + ' IsScrollBarVisible=',ScrollBox.HorzScrollBar.IsScrollBarVisible + ]);} MaxBtnPerRow:=((ScrollBox.VertScrollBar.ClientSizeWithoutBar - ButtonX) div ComponentPaletteBtnWidth); // If we need to wrap, make sure we have space for the scrollbar if MaxBtnPerRow < ButtonTree.Count then diff --git a/lcl/include/controlscrollbar.inc b/lcl/include/controlscrollbar.inc index 9ccf158815..af725d69cf 100644 --- a/lcl/include/controlscrollbar.inc +++ b/lcl/include/controlscrollbar.inc @@ -233,10 +233,10 @@ begin ScrollInfo.nTrackPos := TrackToPolicyMap[FTracking]; SetScrollInfo(ControlHandle, IntfBarKind[Kind], ScrollInfo, NewVisible); end; - ShowScrollBar(FControl.Handle, IntfBarKind[Kind], NewVisible); + ShowScrollBar(ControlHandle, IntfBarKind[Kind], NewVisible); {$IFDEF VerboseScrollingWinControl} //if DebugCondition then - DebugLn(['TControlScrollBar.UpdateScrollBar ',DbgSName(FControl),' ',DbgSName(Self),' ',dbgs(Kind),' FVisible=',FVisible,' Range=',FRange,' FPosition=',FPosition,' FPage=',FPage,' FAutoRange=',FAutoRange,' ShouldVisible=',NewVisible]); + DebugLn(['TControlScrollBar.UpdateScrollBar ',DbgSName(FControl),' ',DbgSName(Self),' ',dbgs(Kind),' FVisible=',FVisible,' Range=',FRange,' FPosition=',FPosition,' FPage=',FPage,' FAutoRange=',FAutoRange,' ShouldVisible=',NewVisible,' IsVisible=',IsScrollBarVisible]); {$ENDIF} end; diff --git a/lcl/interfaces/carbon/carbonwinapi.inc b/lcl/interfaces/carbon/carbonwinapi.inc index 7f64bfa1cb..080bd4180d 100644 --- a/lcl/interfaces/carbon/carbonwinapi.inc +++ b/lcl/interfaces/carbon/carbonwinapi.inc @@ -3927,7 +3927,15 @@ end; function TCarbonWidgetSet.ShowScrollBar(Handle: HWND; wBar: Integer; bShow: Boolean): Boolean; +var + CarbonControl: TCarbonControl; begin + Result:=false; + + CarbonControl := TCarbonControl(Handle); + + // ToDo: + Result:=inherited ShowScrollBar(Handle, wBar, bShow); end;