win32(ce): fix deletion of notebook/pagecontrol page by RemovePage

git-svn-id: trunk@12519 -
This commit is contained in:
paul 2007-10-19 11:20:22 +00:00
parent c114b0811b
commit 6ccb6125c6
2 changed files with 16 additions and 4 deletions

View File

@ -236,6 +236,10 @@ implementation
uses
Forms, LMessages, ShellAPI;
type
TCustomPageAccess = class(TCustomPage)
end;
function IsNotebookGroupFocused(const ANotebook: TCustomNotebook): boolean;
var
lNotebookHandle, lWindow: HWND;
@ -329,8 +333,10 @@ var
PageIndex: integer;
PageControlHandle: HWND;
begin
// remove tab from pagecontrol
if (AWinControl.Parent <> nil) and (AWinControl.Parent.HandleAllocated) then
// remove tab from pagecontrol only if not pfRemoving is set
// if pfRemoving is set then Tab has been deleted by RemovePage
if (AWinControl.Parent <> nil) and (AWinControl.Parent.HandleAllocated) and
not (pfRemoving in TCustomPageAccess(AWinControl).Flags) then
begin
PageControlHandle := AWinControl.Parent.Handle;
PageIndex := TCustomPage(AWinControl).PageIndex;

View File

@ -223,6 +223,10 @@ implementation
uses
LMessages;
type
TCustomPageAccess = class(TCustomPage)
end;
function IsNotebookGroupFocused(const ANotebook: TCustomNotebook): boolean;
var
lNotebookHandle, lWindow: HWND;
@ -309,8 +313,10 @@ var
PageIndex: integer;
PageControlHandle: HWND;
begin
// remove tab from pagecontrol
if (AWinControl.Parent <> nil) and (AWinControl.Parent.HandleAllocated) then
// remove tab from pagecontrol only if not pfRemoving is set
// if pfRemoving is set then Tab has been deleted by RemovePage
if (AWinControl.Parent <> nil) and (AWinControl.Parent.HandleAllocated) and
not (pfRemoving in TCustomPageAccess(AWinControl).Flags) then
begin
PageControlHandle := AWinControl.Parent.Handle;
PageIndex := TCustomPage(AWinControl).PageIndex;