我研究了一下fastreport,发现它是在这里定义的,细节的东西还需要再研究 TfrRepEditor = class(TComponentEditor) procedure ExecuteVerb(Index: Integer); override; function GetVerb(Index: Integer): String; override; function GetVerbCount: Integer; override; end;
TComponentEditor provides the default implementation for the IComponentEditor interface.UnitDesignEditorsDescriptionUse TComponentEditor or one of its descendants as a base class when defining a design-time editor for working with a new component class. Although you can create component editors that descend directly from TBaseComponentEditor, it is convenient to use TComponentEditor, because this classs supplies a default implementation of the IComonentEditor interface.Create a new component editor class for a component class to add verbs to its context menu, change its default double-click behavior, or allow the component to use a new clipboard format. Once the component editor is defined, it can be registered to work with a particular component class. A registered component editor is created for each component of that class when it is selected in the form designer. When the component is double-clicked, the Edit method of the component editor is called. When the user right-clicks the component, the GetVerbCount and GetVerb methods of the editor are called to build context menu. To create the association between a component editor and a component class, call RegisterComponentEditor.Delphi provides a descendant of TComponentEditor (TDefaultEditor) which all components use if they have no registered association with a component editor.
能帮我看看吗?
TfrRepEditor = class(TComponentEditor)
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): String; override;
function GetVerbCount: Integer; override;
end;
http://www.csdn.net/develop/read_article.asp?id=20251
http://www.csdn.net/develop/read_article.asp?id=20252
http://www.csdn.net/develop/read_article.asp?id=20262
http://www.csdn.net/develop/read_article.asp?id=20263
function GetVerb(Index: Integer): String; override;//定义了对应右键菜单中第index个(从0开始)的内容
你定义了上面两个函数,控键的右键菜单中会自动添加进去。
procedure ExecuteVerb(Index: Integer); override; //定义了对应菜单中响应的事件,在这里调用报表设计器,其实报表设计器也是一个类,设计窗体的显示是在报表设计器这个类中实现的
接下来我该自己试一试了,希望遇到问题的时候还能得到你们的帮助!
//bow