Index: objectinspector.pp =================================================================== --- objectinspector.pp (revision 59606) +++ objectinspector.pp (working copy) @@ -312,6 +312,7 @@ FKeySearchText: string; FHideClassNames: Boolean; FPropNameFilter : String; + FPaintRc: TRect; // hint stuff FLongHintTimer: TTimer; @@ -435,6 +436,7 @@ protected procedure CreateParams(var Params: TCreateParams); override; procedure CreateWnd; override; + procedure Notification(AComponent: TComponent; Operation: TOperation); override; function DoMouseWheel(Shift: TShiftState; WheelDelta: Integer; MousePos: TPoint): Boolean; override; @@ -701,6 +703,8 @@ FOnShowOptions: TNotifyEvent; FOnUpdateRestricted: TNotifyEvent; FOnViewRestricted: TNotifyEvent; + FLastTreeSize: TRect; + // These event handlers are assigned at run-time, no need for default published section. procedure ComponentTreeDblClick(Sender: TObject); procedure ComponentTreeGetNodeImageIndex(APersistent: TPersistent; var AIndex: integer); @@ -1218,7 +1222,7 @@ if TopY > ATopMax then TopY := ATopMax; ScrollInfo.nPos := TopY; - ShowScrollBar(Handle, SB_VERT, True); + // ShowScrollBar(Handle, SB_VERT, True); SetScrollInfo(Handle, SB_VERT, ScrollInfo, True); end; end; @@ -1277,6 +1281,7 @@ begin inherited CreateWnd; // handle just created, set scrollbar + ShowScrollBar(Handle, SB_VERT, True); UpdateScrollBar; end; @@ -2751,7 +2756,7 @@ procedure TOICustomPropertyGrid.SetTopY(const NewValue:integer); var NewTopY, d: integer; - r: TRect; +// r: TRect; f: UINT; begin NewTopY := TopMax; @@ -2760,7 +2765,7 @@ if NewTopY < 0 then NewTopY := 0; if FTopY<>NewTopY then begin - r := ClientRect; +// r := ClientRect; f := SW_INVALIDATE; d := FTopY-NewTopY; // SW_SCROLLCHILDREN can only be used, if the active editor is not @@ -2770,7 +2775,8 @@ ( (d < 0) and (FCurrentEdit.Top < Height - FCurrentEdit.Height) ) then f := f + SW_SCROLLCHILDREN; - if not ScrollWindowEx(Handle,0,d,@r,@r,0,nil, f) then +// if not ScrollWindowEx(Handle,0,d,@r,nil,0,nil, f) then + if not ScrollWindowEx(Handle,0,d,nil,nil,0,nil, f) then Invalidate; FTopY:=NewTopY; UpdateScrollBar; @@ -2902,8 +2908,13 @@ {$ENDIF} end; //debugln('TOICustomPropertyGrid.AlignEditComponents A ',dbgsName(FCurrentEdit),' ',dbgs(EditCompRect)); - if FCurrentEdit.BoundsRect <> EditCompRect then + if ( ( (FCurrentEdit.BoundsRect.Bottom >= 0) and (FCurrentEdit.BoundsRect.Top <= Height) ) or + ( (EditCompRect.Bottom >= 0) and (EditCompRect.Top <= Height) ) ) and + ( FCurrentEdit.BoundsRect <> EditCompRect ) + then begin +//DebugLn([' ',FCurrentEdit.BoundsRect.Top , ' >> ', EditCompRect.Top]); FCurrentEdit.BoundsRect := EditCompRect; + end; end; end; end; @@ -3067,6 +3078,8 @@ begin CurRow := Rows[ARow]; FullRect := RowRect(ARow); + if (FullRect.Bottom < FPaintRc.Top) or (FullRect.Top > FPaintRc.Bottom) then + exit; NameRect := FullRect; ValueRect := FullRect; Inc(FullRect.Bottom, FRowSpacing); @@ -3173,6 +3186,9 @@ SpaceRect: TRect; GutterX: Integer; begin + FPaintRc := Canvas.ClipRect; + debugln([' PAINT ',FPaintRc.Top, ' - ', FPaintRc.Bottom, ' / ', FPaintRc.Bottom-FPaintRc.Top]); + BuildPropertyList(true); if not PaintOnlyChangedValues then begin @@ -5616,8 +5632,12 @@ procedure TObjectInspectorDlg.Resize; begin inherited Resize; - if Assigned(ComponentTree) then + // BUG: resize gets called, even if nothing changed + if Assigned(ComponentTree) and (FLastTreeSize <> ComponentTree.BoundsRect) then begin + debugln('Resize dlg'); ComponentTree.Invalidate; // Update Scrollbars. + FLastTreeSize := ComponentTree.BoundsRect; + end; end; procedure TObjectInspectorDlg.ComponentTreeModified(Sender: TObject);