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) TCDWSCustomPage = class(TWSCustomPage)
published published
{ class function CreateHandle(const AWinControl: TWinControl; class function CreateHandle(const AWinControl: TWinControl;
const AParams: TCreateParams): TLCLIntfHandle; override; const AParams: TCreateParams): TLCLIntfHandle; override;
class procedure UpdateProperties(const ACustomPage: TCustomPage); override;} // class procedure UpdateProperties(const ACustomPage: TCustomPage); override;}
end; end;
{ TCDWSCustomTabControl } { TCDWSCustomTabControl }
@ -259,6 +259,28 @@ type
implementation 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 } { TCDWSCustomTabControl }
class procedure TCDWSCustomTabControl.InjectCDControl( class procedure TCDWSCustomTabControl.InjectCDControl(

View File

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