mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 18:59:06 +02:00
custom controls now support child wincontrols
git-svn-id: trunk@3217 -
This commit is contained in:
parent
7e59d4ab19
commit
16c012f163
@ -84,7 +84,7 @@ var Notebook: TNoteBook;
|
|||||||
begin
|
begin
|
||||||
if (Parent is TNoteBook) then begin
|
if (Parent is TNoteBook) then begin
|
||||||
NoteBook:=TNoteBook(Parent);
|
NoteBook:=TNoteBook(Parent);
|
||||||
if NoteBook.Page[NoteBook.PageIndex]=Self then
|
if (NoteBook.PageIndex>=0) and (NoteBook.Page[NoteBook.PageIndex]=Self) then
|
||||||
inherited WMPaint(Msg);
|
inherited WMPaint(Msg);
|
||||||
end else
|
end else
|
||||||
inherited WMPaint(Msg);
|
inherited WMPaint(Msg);
|
||||||
@ -99,14 +99,16 @@ procedure TPage.SetParent(AParent: TWinControl);
|
|||||||
var
|
var
|
||||||
OldParent: TWinControl;
|
OldParent: TWinControl;
|
||||||
ParentNotebook: TCustomNotebook;
|
ParentNotebook: TCustomNotebook;
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
OldParent:=Parent;
|
OldParent:=Parent;
|
||||||
if (OldParent<>AParent) and (OldParent<>nil)
|
if (OldParent<>AParent) and (OldParent<>nil)
|
||||||
and (OldParent is TCustomNotebook) then begin
|
and (OldParent is TCustomNotebook) then begin
|
||||||
// remove from old pagelist
|
// remove from old pagelist
|
||||||
ParentNotebook:=TCustomNotebook(OldParent);
|
ParentNotebook:=TCustomNotebook(OldParent);
|
||||||
if ParentNotebook.PageList.IndexOf(Self)>=0 then
|
i:=PageIndex;
|
||||||
TNBPages(ParentNotebook.fAccess).RemovePage(PageIndex);
|
if i>=0 then
|
||||||
|
TNBPages(ParentNotebook.fAccess).RemovePage(i);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
inherited SetParent(AParent);
|
inherited SetParent(AParent);
|
||||||
@ -151,6 +153,9 @@ end;
|
|||||||
// included by extctrls.pp
|
// included by extctrls.pp
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.12 2002/12/22 22:42:55 mattias
|
||||||
|
custom controls now support child wincontrols
|
||||||
|
|
||||||
Revision 1.11 2002/09/05 12:11:43 lazarus
|
Revision 1.11 2002/09/05 12:11:43 lazarus
|
||||||
MG: TNotebook is now streamable
|
MG: TNotebook is now streamable
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user