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 var
ChangedOptions: TNoteBookOptions; ChangedOptions: TNoteBookOptions;
begin begin
if FOptions=AValue then exit; if FOptions = AValue then Exit;
ChangedOptions:=(FOptions-AValue)+(AValue-FOptions); ChangedOptions := (FOptions - AValue) + (AValue - FOptions);
FOptions:=AValue; FOptions := AValue;
if nboShowCloseButtons in ChangedOptions then if nboShowCloseButtons in ChangedOptions then
UpdateTabProperties; UpdateTabProperties;
if HandleAllocated then if HandleAllocated then

View File

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