MMENVPRP.PAS
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:5k
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Tel.: +0351-8012255 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/mmtools.html =}
- {========================================================================}
- {= This code is for reference purposes only and may not be copied or =}
- {= distributed in any format electronic or otherwise except one copy =}
- {= for backup purposes. =}
- {= =}
- {= No Delphi Component Kit or Component individually or in a collection=}
- {= subclassed or otherwise from the code in this unit, or associated =}
- {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
- {= without express permission from SwiftSoft. =}
- {= =}
- {= For more licence informations please refer to the associated =}
- {= HelpFile. =}
- {========================================================================}
- {= $Date: 20.01.1998 - 18:00:00 $ =}
- {========================================================================}
- unit MMEnvPrp;
- {$I COMPILER.INC}
- interface
- uses
- {$IFDEF WIN32}
- Windows,
- {$ELSE}
- WinTypes,
- WinProcs,
- {$ENDIF}
- {$IFDEF DELPHI6}
- DesignIntf,
- DesignEditors,
- {$ELSE}
- DsgnIntf,
- {$ENDIF}
- SysUtils,
- Messages,
- Consts,
- Classes,
- Controls,
- MMEnvelp,
- MMEnvDlg;
- type
- {-- TMMEnvelopePointProperty ------------------------------------------}
- TMMEnvelopePointProperty = class(TClassProperty)
- public
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- end;
- {-- TMMEnvelopeEditor -------------------------------------------------}
- TMMEnvelopeEditor = class(TComponentEditor)
- public
- procedure ExecuteVerb(Index: Integer); override;
- function GetVerb(Index: Integer): string; override;
- function GetVerbCount: Integer; override;
- end;
- implementation
- {== TMMEnvelopePointProperty ============================================}
- function TMMEnvelopePointProperty.GetAttributes: TPropertyAttributes;
- begin
- Result := [paDialog];
- end;
- {-- TMMEnvelopePointProperty --------------------------------------------}
- procedure TMMEnvelopePointProperty.Edit;
- begin
- with TMMEnvelopeDlg.Create(nil) do
- try
- with (GetComponent(0) as TMMEnvelope) do
- begin
- SetAllRanges(RangeMinX,RangeMaxX,RangeMinY,RangeMaxY,BaseY);
- Envelope.MoveFirstPoint := MoveFirstPoint;
- Envelope.MoveLastPoint := MoveLastPoint;
- end;
- Envelope.Points := TMMEnvelopePointList(GetOrdValue);
- if ShowModal = mrOK then
- begin
- SetOrdValue(Longint(Envelope.Points));
- Self.Designer.Modified;
- end;
- finally
- Free;
- end;
- end;
- {== TMMEnvelopeEditor ===================================================}
- procedure TMMEnvelopeEditor.ExecuteVerb(Index: Integer);
- begin
- with TMMEnvelopeDlg.Create(nil) do
- try
- with (Component as TMMEnvelope) do
- begin
- SetAllRanges(RangeMinX,RangeMaxX,RangeMinY,RangeMaxY,BaseY);
- end;
- Envelope.Points := (Component as TMMEnvelope).Points;
- Envelope.MoveFirstPoint := (Component as TMMEnvelope).MoveFirstPoint;
- Envelope.MoveLastPoint := (Component as TMMEnvelope).MoveLastPoint;
- if ShowModal = mrOK then
- begin
- (Component as TMMEnvelope).Points := Envelope.Points;
- Self.Designer.Modified;
- end;
- finally
- Free;
- end;
- end;
- {-- TMMEnvelopeEditor ---------------------------------------------------}
- function TMMEnvelopeEditor.GetVerb(Index: Integer): string;
- begin
- Result := 'Envelope Editor...';
- end;
- {-- TMMEnvelopeEditor ---------------------------------------------------}
- function TMMEnvelopeEditor.GetVerbCount: Integer;
- begin
- Result := 1;
- end;
- end.