mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-22 22:45:59 +02:00
lcl: grids: ignore WMSIZE when updating scrollbars. Solves part of issue #31715
git-svn-id: trunk@54817 -
This commit is contained in:
parent
43e271b439
commit
76e4dccfaa
@ -155,7 +155,7 @@ type
|
||||
TGridFlagsOption = (gfEditorUpdateLock, gfNeedsSelectActive, gfEditorTab,
|
||||
gfRevEditorTab, gfVisualChange, gfColumnsLocked,
|
||||
gfEditingDone, gfSizingStarted, gfPainting, gfUpdatingSize, gfClientRectChange,
|
||||
gfAutoEditPending);
|
||||
gfAutoEditPending, gfUpdatingScrollbar);
|
||||
TGridFlags = set of TGridFlagsOption;
|
||||
|
||||
TSortOrder = (soAscending, soDescending);
|
||||
@ -1122,6 +1122,7 @@ type
|
||||
procedure UpdateBorderStyle;
|
||||
function ValidateEntry(const ACol,ARow:Integer; const OldValue:string; var NewValue:string): boolean; virtual;
|
||||
procedure VisualChange; virtual;
|
||||
procedure WMSize(var Message: TLMSize); message LM_SIZE;
|
||||
procedure WMHScroll(var message : TLMHScroll); message LM_HSCROLL;
|
||||
procedure WMVScroll(var message : TLMVScroll); message LM_VSCROLL;
|
||||
procedure WMKillFocus(var message: TLMKillFocus); message LM_KILLFOCUS;
|
||||
@ -3305,7 +3306,12 @@ begin
|
||||
{$Ifdef DbgScroll}
|
||||
DebugLn('ScrollbarShow: Which=',SbToStr(Which), ' Avalue=',dbgs(AValue));
|
||||
{$endif}
|
||||
ShowScrollBar(Handle,Which,aValue);
|
||||
Include(FGridFlags, gfUpdatingScrollbar);
|
||||
try
|
||||
ShowScrollBar(Handle,Which,aValue);
|
||||
finally
|
||||
Exclude(FGridFlags, gfUpdatingScrollbar);
|
||||
end;
|
||||
if Which in [SB_BOTH, SB_VERT] then FVSbVisible := Ord(AValue);
|
||||
if Which in [SB_BOTH, SB_HORZ] then FHSbVisible := Ord(AValue);
|
||||
end;
|
||||
@ -4610,6 +4616,13 @@ begin
|
||||
InvalidateFocused;
|
||||
end;
|
||||
|
||||
procedure TCustomGrid.WMSize(var Message: TLMSize);
|
||||
begin
|
||||
if gfUpdatingScrollbar in FGridFlags then // ignore WMSize when updating scrollbars. issue #31715
|
||||
Exit;
|
||||
inherited WMSize(Message);
|
||||
end;
|
||||
|
||||
class procedure TCustomGrid.WSRegisterClass;
|
||||
begin
|
||||
inherited WSRegisterClass;
|
||||
|
Loading…
Reference in New Issue
Block a user