MenuItem[i].OnClick:=AboutForm;
end;
end;
NewMenu.Add(MenuItem[i]);//添加菜单项
end;
FMainMenu.Items.Add(NewMenu);//最后添加我们的菜单到IDE主菜单
end;
procedure TNTATest.ReCodeEditer(sender:TObject);
var
Module:IOTAModuleServices;
CurentMoudle: IOTAModule;
IntfEditor:IOTAEditor;
Editor:IOTASourceEditor;
EditView:IOTAEditView;
EditWriterPos:IOTAEditPosition;
i:integer;
begin
Module:=BorlandIDEServices as IOTAModuleServices;
CurentMoudle:=Module.CurrentModule;
//使用IOTAModuleServices的CurrentModule方法得到当前打开的工程模块
if CurentMoudle=nil then
begin
messagebox(IDEHandle,''''当前没有打开项目文件'''',''''hkTest'''',MB_ICONINFORMATION);
exit;
end;
//遍历已打开工程中所有的文件
for i:=0 to CurentMoudle.ModuleFileCount-1 do
begin
IntfEditor:=CurentMoudle.ModuleFileEditors[i];
//IOTAModule的ModuleFileEditors[]属性得到一个IOTAEditor
if IntfEditor.QueryInterface(IOTASourceEditor,Editor)=S_OK then
//查看遍历到的文件是否是代码文件并已开始在代码编辑器中编辑。
//如果是便通过一个out参数Editor得到一个实现IOTASourceEditor的实例
break;
end;
if Editor=nil then
begin
messagebox(IDEHandle,''''当前没有代码编辑窗口'''',''''hkTest'''',MB_ICONINFORMATION);
上一页 [1] [2] [3] [4] [5] [6] 下一页 [办公软件]Word编程之WindowActivate、DocumentOpen和Docume… [电脑技术]HP打印复印机出现Jam in print pager path和op… [系统软件]InstallShield Express for delphi制作安装程序定… [系统软件]OPEN SERVER 5.0.5安装EXP300阵列柜 [常用软件]InstallShield Express制作Delphi数据库安装程序 [常用软件]Open Desktop 开放着 美丽着 [常用软件]族门新秀:ACD mPower Tools [常用软件][媒体]虚拟光驱Daemon Tools实用教程 [Delphi程序]为什么选择Delphi.Net ? [Delphi程序]《关于VisiBroker For Delphi的使用》(4)
|