destructor TTransPanel.Destroy;
begin
if Assigned(Buffer) then
Buffer.Free;
inherited;
end;
function TTransPanel.GetTransModeEx: Integer;
begin
Result := 0;
case TransMode of //case
tmNone: Result := 0;
tmSRCCOPY: Result := SRCCOPY;
tmSRCPAINT: Result := SRCPAINT;
tmSRCAND: Result := SRCAND;
tmSRCINVERT: Result := SRCINVERT;
tmSRCERASE: Result := SRCERASE;
tmNOTSRCCOPY: Result := NOTSRCCOPY;
tmNOTSRCERASE: Result := NOTSRCERASE;
tmMERGECOPY: Result := MERGECOPY;
tmMERGEPAINT: Result := MERGEPAINT;
tmPATCOPY: Result := PATCOPY;
tmPATPAINT: Result := PATPAINT;
tmPATINVERT: Result := PATINVERT;
tmDSTINVERT: Result := DSTINVERT;
tmBLACKNESS: Result := BLACKNESS;
tmWHITENESS: Result := WHITENESS;
end; // end case
end;
procedure TTransPanel.Paint;
var
Rect: TRect;
TopColor, BottomColor: TColor;
procedure AdjustColors(Bevel: TPanelBevel);
begin
TopColor := clBtnHighlight;
if Bevel = bvLowered then TopColor := clBtnShadow;
BottomColor := clBtnShadow;
if Bevel = bvLowered then BottomColor := clBtnHighlight;
end;
if Ctl3D then DrawEdge(Buffer.Canvas.Handle, Rect, BDR_RAISEDINNER, BF_RECT);
if BevelOuter <> bvNone then
begin
AdjustColors(BevelOuter);
Frame3D(Buffer.Canvas, Rect, TopColor, BottomColor, BevelWidth);
end;
if BevelInner <> bvNone then
begin
AdjustColors(BevelInner);
Frame3D(Buffer.Canvas, Rect, TopColor, BottomColor, BevelWidth);
end;