home *** CD-ROM | disk | FTP | other *** search
- unit UFlexCelTemplateEditor;
-
- interface
-
- uses
- {$IFDEF LINUX}
- SysUtils, Classes, QGraphics, QControls, QForms, QDialogs,
- {$ENDIF}
- {$IFDEF WIN32}
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- {$ENDIF}
- {$IFDEF ConditionalExpressions}{$if CompilerVersion >= 14} //Delphi 6 or above
- DesignIntf, DesignEditors,
- {$IFEND}
- {$ELSE}
- DsgnIntf,
- {$ENDIF}
- TemplateStore, UFlxMessages, UFlxDesignHelp, UTemplateEdit;
- type
- TFlexCelTemplateEditor = class(TComponentEditor)
- private
- { Private declarations }
- protected
- { Protected declarations }
- public
- { Public declarations }
- function GetVerb(Index: Integer): String; override;
- function GetVerbCount: Integer; override;
- procedure ExecuteVerb(Index: Integer); override;
- published
- { Published declarations }
- end;
-
- procedure Register;
-
- implementation
- function TFlexCelTemplateEditor.GetVerbCount: Integer;
- begin
- Result := 3;
- end;
-
- function TFlexCelTemplateEditor.GetVerb(Index: Integer): String;
-
- begin
- case Index of
- 0: Result := 'Edit Template Store...';
- 1: Result := 'Refresh...';
- 2: Result := 'About...';
- end;
- end;
-
- procedure TFlexCelTemplateEditor.ExecuteVerb(Index: Integer);
- var
- IsModified: boolean;
- begin
- IsModified:=false;
- chdir(ExtractFilePath(GetActiveProjectFileName));
- case Index of
- 0: InvokeTemplateEditor(Component as TXLSTemplateStore, IsModified);
- 1: begin;RefreshTemplateStore(Component as TXLSTemplateStore, IsModified);showmessage(TxtTemplateStoreRefreshed);end;
- 2: ShowMessage(Format(MsgAbout,[FlexCelVersion]));
- end; //case
- if IsModified then Designer.Modified;
- end;
-
- procedure Register;
- begin
- RegisterComponentEditor(TXLSTemplateStore, TFlexCelTemplateEditor);
- end;
-
- end.
-