diff --git a/lcl/grids.pas b/lcl/grids.pas index 4b5280b6b5..3f09bb8996 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -1003,6 +1003,7 @@ type procedure DoOPMoveColRow(IsColumn: Boolean; FromIndex, ToIndex: Integer); procedure DoPasteFromClipboard; virtual; procedure DoPrepareCanvas(aCol,aRow:Integer; aState: TGridDrawState); virtual; + procedure DoOnResize; override; procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); override; function DoUTF8KeyPress(var UTF8Key: TUTF8Char): boolean; override; procedure DrawBorder; @@ -7179,6 +7180,13 @@ begin OnPrepareCanvas(Self, aCol, aRow, aState); end; +procedure TCustomGrid.DoOnResize; +begin + inherited DoOnResize; + if FUpdateCount=0 then + TWSCustomGridClass(WidgetSetClass).Invalidate(Self); +end; + procedure TCustomGrid.DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); begin FLastWidth := ClientWidth; diff --git a/lcl/interfaces/gtk2/gtk2wsgrids.pp b/lcl/interfaces/gtk2/gtk2wsgrids.pp index 5f41030afe..f0548195f0 100644 --- a/lcl/interfaces/gtk2/gtk2wsgrids.pp +++ b/lcl/interfaces/gtk2/gtk2wsgrids.pp @@ -39,6 +39,7 @@ type published class function GetEditorBoundsFromCellRect(ACanvas: TCanvas; const ACellRect: TRect; const AColumnLayout: TTextLayout): TRect; override; + class procedure Invalidate(sender: TCustomGrid); override; end; implementation @@ -65,4 +66,9 @@ begin Result.Bottom:=Result.Top+TextHeight; end; +class procedure TGtk2WSCustomGrid.Invalidate(sender: TCustomGrid); +begin + Sender.Invalidate; +end; + end. diff --git a/lcl/widgetset/wsgrids.pp b/lcl/widgetset/wsgrids.pp index d454305077..d8866d81cc 100644 --- a/lcl/widgetset/wsgrids.pp +++ b/lcl/widgetset/wsgrids.pp @@ -50,6 +50,7 @@ type published class procedure SendCharToEditor(AEditor:TWinControl; Ch: TUTF8Char); virtual; class function InvalidateStartY(const FixedHeight, RowOffset: Integer): integer; virtual; + class procedure Invalidate(sender: TCustomGrid); virtual; class function GetEditorBoundsFromCellRect(ACanvas: TCanvas; const ACellRect: TRect; const AColumnLayout: TTextLayout): TRect; virtual; end; @@ -122,6 +123,11 @@ begin result := FixedHeight; end; +class procedure TWSCustomGrid.Invalidate(sender: TCustomGrid); +begin + // override in widgetset level if needed +end; + { WidgetSetRegistration } function RegisterCustomGrid: Boolean;