LCL, TCoolbar: Replace Resize with WMSize. Issue #26096, patch from Vojtech Cihak.

git-svn-id: trunk@44994 -
This commit is contained in:
juha 2014-05-10 14:40:17 +00:00
parent 6ec7357462
commit 8dc1a9ed65
2 changed files with 6 additions and 18 deletions

View File

@ -2361,8 +2361,6 @@ type
FDragBand: TDragBand;
FDraggedBandIndex: Integer; // -1 .. space below the last row; other negative .. invalid area
FDragInitPos: Integer; // Initial mouse X - position (for resizing Bands)
FPrevHeight: Integer;
FPrevWidth: Integer;
FTextHeight: Integer;
procedure AlignControls(AControl: TControl; var RemainingClientRect: TRect); override;
procedure BitmapOrImageListChange(Sender: TObject);
@ -2383,8 +2381,8 @@ type
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Paint; override;
procedure Resize; override;
procedure SetAlign(aValue: TAlign); reintroduce;
procedure WMSize(var Message: TLMSize); message LM_SIZE;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;

View File

@ -504,8 +504,6 @@ begin
if aCountM1 >= 0 then EnableAutoSizing;
dec(FUpdateCount);
end;
FPrevWidth := Width;
FPrevHeight := Height;
end;
procedure TCustomCoolBar.CalculatePreferredSize(var PreferredWidth, PreferredHeight: Integer;
@ -957,19 +955,11 @@ begin
end;
end;
procedure TCustomCoolBar.Resize;
var aWidth, aHeight: Integer;
procedure TCustomCoolBar.WMSize(var Message: TLMSize);
begin
//DebugLn('Resize');
inherited Resize;
aWidth := Width;
aHeight := Height;
if ((aWidth <> FPrevWidth) or (aHeight <> FPrevHeight))
and (aWidth*aHeight > 0) and HandleAllocated then
begin
//DebugLn('Resize calls CalcAndAlign');
//DebugLn('WMSize');
inherited WMSize(Message);
CalculateAndAlign;
Invalidate; //Required by GTK2
end;
end;