LCL-CustomDrawn: Advances the support for TPageControl, not yet fully working

git-svn-id: trunk@38251 -
This commit is contained in:
sekelsenmat 2012-08-15 18:50:43 +00:00
parent b44a2ec7f3
commit fcbbb972cb
2 changed files with 29 additions and 4 deletions

View File

@ -42,9 +42,9 @@ type
TCDWSCustomPage = class(TWSCustomPage)
published
{ class function CreateHandle(const AWinControl: TWinControl;
class function CreateHandle(const AWinControl: TWinControl;
const AParams: TCreateParams): TLCLIntfHandle; override;
class procedure UpdateProperties(const ACustomPage: TCustomPage); override;}
// class procedure UpdateProperties(const ACustomPage: TCustomPage); override;}
end;
{ TCDWSCustomTabControl }
@ -259,6 +259,28 @@ type
implementation
{ TCDWSCustomPage }
// Return the handle of the page installed in the TCDPageControl instead of creating a new one
class function TCDWSCustomPage.CreateHandle(const AWinControl: TWinControl;
const AParams: TCreateParams): TLCLIntfHandle;
var
lPageControlHandle: TCDWinControl;
begin
if AWinControl is TTabSheet then
begin
lPageControlHandle := TCDWinControl(TTabSheet(AWinControl).PageControl.Handle);
if not lPageControlHandle.CDControlInjected then
begin
TCDWSCustomTabControl.InjectCDControl(AWinControl, lPageControlHandle.CDControl);
lPageControlHandle.CDControlInjected := True;
end;
Result := lPageControlHandle.CDControl.Handle;
end
else
Result := TCDWSWinControl.CreateHandle(AWinControl, AParams);
end;
{ TCDWSCustomTabControl }
class procedure TCDWSCustomTabControl.InjectCDControl(

View File

@ -168,7 +168,8 @@ end;
function RegisterTabSheet: Boolean; alias : 'WSRegisterTabSheet';
begin
Result := False;
RegisterWSComponent(TCustomPage, TCDWSCustomPage);
Result := True;
end;
function RegisterPageControl: Boolean; alias : 'WSRegisterPageControl';
@ -342,12 +343,14 @@ begin
end;
// extctrls
// Already registered in function RegisterTabSheet: Boolean;
function RegisterCustomPage: Boolean; alias : 'WSRegisterCustomPage';
begin
// RegisterWSComponent(TCustomPage, TWinCEWSCustomPage);
//RegisterWSComponent(TCustomPage, TCDWSCustomPage);
Result := False;
end;
// Already registered in function RegisterPageControl: Boolean;
function RegisterCustomNotebook: Boolean; alias : 'WSRegisterCustomNotebook';
begin
// RegisterWSComponent(TCustomTabControl, TWinCEWSCustomNotebook);