标签:style blog http color os java io for ar
1、直接看代码
①测试程序1
PRO MY_EVENT2_DEFINE_BUTTONS, buttonInfo COMPILE_OPT IDL2 ENVI_DEFINE_MENU_BUTTON, buttonInfo, $ value = ‘caidan‘, uvalue = ‘哈哈‘, $ event_pro = ‘MY_EVENT2‘, $ ref_value = ‘Help‘, position = ‘last‘ END PRO MY_EVENT2,EV FILE=DIALOG_PICKFILE() RES= DIALOG_MESSAGE(FILE, /INFORMATION) END
②测试程序2
PRO MY_PROCESS_DEFINE_BUTTONS, buttonInfo
COMPILE_OPT IDL2
ENVI_DEFINE_MENU_BUTTON, buttonInfo, $
value = ‘My Menu‘, /menu, $
ref_value = ‘Basic Tools‘, $
/sibling, position = ‘after‘
ENVI_DEFINE_MENU_BUTTON, buttonInfo, $
value = ‘Option 1‘, uvalue = ‘option 1‘, $
event_pro = ‘my_process‘, $
ref_value = ‘My Menu‘, position = ‘last‘
ENVI_DEFINE_MENU_BUTTON, buttonInfo, $
value = ‘Option 2‘, uvalue = ‘option 2‘, $
event_pro = ‘my_process‘, $
ref_value = ‘My Menu‘, position = ‘last‘
ENVI_DEFINE_MENU_BUTTON, buttonInfo, $
value = ‘Option 3‘, uvalue = ‘option 3‘, $
event_pro = ‘my_process‘, $
ref_value = ‘My Menu‘, position = ‘last‘, $
/separator
END
PRO MY_PROCESS, event
COMPILE_OPT IDL2
PRINT, ‘Running the process‘
END
③示例代码3
PRO MY_EVENT2_DEFINE_BUTTONS, buttonInfo COMPILE_OPT IDL2 ENVI_DEFINE_MENU_BUTTON, buttonInfo, $ value = ‘op4‘, uvalue = ‘哈哈‘, $ event_pro = ‘MY_EVENT2‘, $ ref_value = ‘My Menu‘, position = ‘last‘ END PRO MY_EVENT2,EV FILE=DIALOG_PICKFILE() RES= DIALOG_MESSAGE(FILE, /INFORMATION) END
本例请在实验实例2之后在运行,因为在执行完成实例2之后才会有My Menu菜单,此例旨在为My Menu菜单添加一个新的在菜单op4,实验结果并未成功添加,原因在于
MY_EVENT2和MY_PROCESS的先后顺序无法指定。
2、重置、编译,在控制台输入save,filename=‘E:\temp\my_process.sav‘,/rout
3、生成的my_process.sav拷贝到C:\Program Files\Exelis\ENVI51\classic\save_add目录下
4、重启ENVI
如何给ENVI Classic添加菜单(IDL8.3+ENVI5.1)
标签:style blog http color os java io for ar
原文地址:http://www.cnblogs.com/rockman/p/3938723.html