win32: adjust notebook pages size after page add/remove/options change by cobines (issue #0018317)

git-svn-id: trunk@28861 -
This commit is contained in:
paul 2011-01-04 09:24:58 +00:00
parent ea3028e5b6
commit acf7b58d7b
2 changed files with 9 additions and 5 deletions

View File

@ -449,9 +449,9 @@ procedure TCustomNotebook.SetOptions(const AValue: TNoteBookOptions);
var
ChangedOptions: TNoteBookOptions;
begin
if FOptions=AValue then exit;
ChangedOptions:=(FOptions-AValue)+(AValue-FOptions);
FOptions:=AValue;
if FOptions = AValue then Exit;
ChangedOptions := (FOptions - AValue) + (AValue - FOptions);
FOptions := AValue;
if nboShowCloseButtons in ChangedOptions then
UpdateTabProperties;
if HandleAllocated then

View File

@ -474,7 +474,8 @@ begin
// clientrect possible changed, adding first tab, or deleting last
// windows should send a WM_SIZE message because of this, but it doesn't
// send it ourselves
LCLControlSizeNeedsUpdate(ANotebook, True);
if LCLControlSizeNeedsUpdate(ANotebook, True) then
AdjustSizeNotebookPages(ANotebook);
end;
end;
@ -489,6 +490,8 @@ class procedure TWin32WSCustomNotebook.RemovePage(const ANotebook: TCustomNotebo
const AIndex: integer);
begin
Windows.SendMessage(ANotebook.Handle, TCM_DELETEITEM, Windows.WPARAM(AIndex), 0);
if LCLControlSizeNeedsUpdate(ANotebook, True) then
AdjustSizeNotebookPages(ANotebook);
end;
{ -----------------------------------------------------------------------------
@ -726,7 +729,8 @@ begin
begin
SetWindowLong(ANotebook.Handle, GWL_STYLE, NewStyle);
SetWindowPos(ANoteBook.Handle, 0, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE or SWP_NOZORDER or SWP_DRAWFRAME);
LCLControlSizeNeedsUpdate(ANotebook, True);
if LCLControlSizeNeedsUpdate(ANotebook, True) then
AdjustSizeNotebookPages(ANotebook);
end;
end;