mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 17:19:22 +02:00
- TLCLHandleComponent modified: added 2 virtual methods: WSCreateHandle and WSDestroyHandle
git-svn-id: trunk@10921 -
This commit is contained in:
parent
0e86c269a0
commit
1119942290
@ -33,8 +33,8 @@ uses
|
|||||||
// To get as little as posible circles,
|
// To get as little as posible circles,
|
||||||
// uncomment only when needed for registration
|
// uncomment only when needed for registration
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
Windows, SysUtils, ImgList, GraphType, Graphics, LCLType,
|
Windows, SysUtils, Classes, ImgList, GraphType, Graphics, LCLType,
|
||||||
WinExt,
|
WinExt,
|
||||||
////////////////////////////////////////////////////
|
////////////////////////////////////////////////////
|
||||||
WSImgList, WSLCLClasses, WSProc;
|
WSImgList, WSLCLClasses, WSProc;
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ type
|
|||||||
class function CreateHandle(AList: TCustomImageList; ACount, AGrow, AWidth,
|
class function CreateHandle(AList: TCustomImageList; ACount, AGrow, AWidth,
|
||||||
AHeight: Integer; AData: PRGBAQuad): TLCLIntfHandle; override;
|
AHeight: Integer; AData: PRGBAQuad): TLCLIntfHandle; override;
|
||||||
class procedure Delete(AList: TCustomImageList; AIndex: Integer); override;
|
class procedure Delete(AList: TCustomImageList; AIndex: Integer); override;
|
||||||
class procedure DestroyHandle(AList: TCustomImageList); override;
|
class procedure DestroyHandle(AComponent: TComponent); override;
|
||||||
class procedure Draw(AList: TCustomImageList; AIndex: Integer; ACanvas: TCanvas;
|
class procedure Draw(AList: TCustomImageList; AIndex: Integer; ACanvas: TCanvas;
|
||||||
ABounds: TRect; AEnabled: Boolean; AStyle: TDrawingStyle); override;
|
ABounds: TRect; AEnabled: Boolean; AStyle: TDrawingStyle); override;
|
||||||
class procedure Insert(AList: TCustomImageList; AIndex: Integer; AData: PRGBAQuad); override;
|
class procedure Insert(AList: TCustomImageList; AIndex: Integer; AData: PRGBAQuad); override;
|
||||||
@ -107,11 +107,11 @@ begin
|
|||||||
ImageList_Remove(HImageList(AList.Handle), AIndex);
|
ImageList_Remove(HImageList(AList.Handle), AIndex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomImageList.DestroyHandle(AList: TCustomImageList);
|
class procedure TWin32WSCustomImageList.DestroyHandle(AComponent: TComponent);
|
||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(AList, 'DestroyHandle')
|
if not WSCheckHandleAllocated(TCustomImageList(AComponent), 'DestroyHandle')
|
||||||
then Exit;
|
then Exit;
|
||||||
ImageList_Destroy(AList.Handle);
|
ImageList_Destroy(TCustomImageList(AComponent).Handle);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomImageList.Draw(AList: TCustomImageList; AIndex: Integer;
|
class procedure TWin32WSCustomImageList.Draw(AList: TCustomImageList; AIndex: Integer;
|
||||||
|
@ -60,9 +60,11 @@ type
|
|||||||
protected
|
protected
|
||||||
procedure CreateHandle;
|
procedure CreateHandle;
|
||||||
procedure CreateParams(var AParams: TCreateParams); virtual;
|
procedure CreateParams(var AParams: TCreateParams); virtual;
|
||||||
procedure DestroyHandle;
|
procedure DestroyHandle;
|
||||||
procedure HandleCreated; virtual; // gets called after the Handle is created
|
procedure HandleCreated; virtual; // gets called after the Handle is created
|
||||||
procedure HandleDestroying; virtual; // gets called before the Handle is destroyed
|
procedure HandleDestroying; virtual; // gets called before the Handle is destroyed
|
||||||
|
function WSCreateHandle(AParams: TCreateParams): TLCLIntfHandle; virtual;
|
||||||
|
procedure WSDestroyHandle; virtual;
|
||||||
protected
|
protected
|
||||||
property Handle: TLCLIntfHandle read GetHandle;
|
property Handle: TLCLIntfHandle read GetHandle;
|
||||||
public
|
public
|
||||||
@ -145,7 +147,7 @@ var
|
|||||||
Params: TCreateParams;
|
Params: TCreateParams;
|
||||||
begin
|
begin
|
||||||
CreateParams(Params);
|
CreateParams(Params);
|
||||||
// TODO: some WScall here
|
FHandle := WSCreateHandle(Params);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TLCLHandleComponent.CreateParams(var AParams: TCreateParams);
|
procedure TLCLHandleComponent.CreateParams(var AParams: TCreateParams);
|
||||||
@ -155,7 +157,7 @@ end;
|
|||||||
procedure TLCLHandleComponent.DestroyHandle;
|
procedure TLCLHandleComponent.DestroyHandle;
|
||||||
begin
|
begin
|
||||||
HandleDestroying;
|
HandleDestroying;
|
||||||
// TODO: some WScall here
|
WSDestroyHandle;
|
||||||
FHandle := 0;
|
FHandle := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -167,6 +169,17 @@ procedure TLCLHandleComponent.HandleDestroying;
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TLCLHandleComponent.WSCreateHandle(AParams: TCreateParams): TLCLIntfHandle;
|
||||||
|
begin
|
||||||
|
// this function should be overriden in derrived class
|
||||||
|
Result := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TLCLHandleComponent.WSDestroyHandle;
|
||||||
|
begin
|
||||||
|
TWSLCLHandleComponentClass(WidgetSetClass).DestroyHandle(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
function TLCLHandleComponent.HandleAllocated: Boolean;
|
function TLCLHandleComponent.HandleAllocated: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := FHandle <> 0;
|
Result := FHandle <> 0;
|
||||||
|
@ -52,7 +52,6 @@ type
|
|||||||
AHeight: Integer; AData: PRGBAQuad): TLCLIntfHandle; virtual;
|
AHeight: Integer; AData: PRGBAQuad): TLCLIntfHandle; virtual;
|
||||||
|
|
||||||
class procedure Delete(AList: TCustomImageList; AIndex: Integer); virtual;
|
class procedure Delete(AList: TCustomImageList; AIndex: Integer); virtual;
|
||||||
class procedure DestroyHandle(AList: TCustomImageList); virtual;
|
|
||||||
class procedure Draw(AList: TCustomImageList; AIndex: Integer; ACanvas: TCanvas;
|
class procedure Draw(AList: TCustomImageList; AIndex: Integer; ACanvas: TCanvas;
|
||||||
ABounds: TRect; AEnabled: Boolean; AStyle: TDrawingStyle); virtual;
|
ABounds: TRect; AEnabled: Boolean; AStyle: TDrawingStyle); virtual;
|
||||||
|
|
||||||
@ -83,10 +82,6 @@ class procedure TWSCustomImageList.Delete(AList: TCustomImageList;
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWSCustomImageList.DestroyHandle(AList: TCustomImageList);
|
|
||||||
begin
|
|
||||||
end;
|
|
||||||
|
|
||||||
class procedure TWSCustomImageList.Draw(AList: TCustomImageList; AIndex: Integer;
|
class procedure TWSCustomImageList.Draw(AList: TCustomImageList; AIndex: Integer;
|
||||||
ACanvas: TCanvas; ABounds: TRect; AEnabled: Boolean; AStyle: TDrawingStyle);
|
ACanvas: TCanvas; ABounds: TRect; AEnabled: Boolean; AStyle: TDrawingStyle);
|
||||||
begin
|
begin
|
||||||
|
@ -67,7 +67,9 @@ type
|
|||||||
{ TWSLCLHandleComponent }
|
{ TWSLCLHandleComponent }
|
||||||
|
|
||||||
TWSLCLHandleComponent = class(TWSLCLComponent)
|
TWSLCLHandleComponent = class(TWSLCLComponent)
|
||||||
|
class procedure DestroyHandle(AComponent: TComponent); virtual;
|
||||||
end;
|
end;
|
||||||
|
TWSLCLHandleComponentClass = class of TWSLCLHandleComponent;
|
||||||
|
|
||||||
|
|
||||||
function FindWSComponentClass(const AComponent: TComponentClass): TWSLCLComponentClass;
|
function FindWSComponentClass(const AComponent: TComponentClass): TWSLCLComponentClass;
|
||||||
@ -430,6 +432,12 @@ begin
|
|||||||
Result := TWSPrivateClass(PClass(Pointer(Self) + vmtWSPrivate)^);
|
Result := TWSPrivateClass(PClass(Pointer(Self) + vmtWSPrivate)^);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TWSLCLHandleComponent }
|
||||||
|
|
||||||
|
class procedure TWSLCLHandleComponent.DestroyHandle(AComponent: TComponent);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
DoInitialization;
|
DoInitialization;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user