菜鸟----5th 菜单问题!
我新建了个“GUI Application with UI Designer”项目,模板选用 “Form”,自动生成的文件有:
BluetoothSampleApplication.cpp
BluetoothSampleAppUi.cpp
BluetoothSampleDocument.cpp
BluetoothSampleForm.cpp
BluetoothSampleFormView.cpp
现在我想添加自己的菜单,我是这样操作的:
先在 data 下面的 BluetoothSampleForm.rssi 里面添加:
RESOURCE AVKON_VIEW r_bluetooth_sample_form_bluetooth_sample_form_view { menubar = r_bluetooth_sample_menu; cba = R_AVKON_SOFTKEYS_OPTIONS_BACK; }RESOURCE MENU_BAR r_bluetooth_sample_menu{ titles = { MENU_TITLE {menu_pane = r_bluetooth_sample_menuitems; txt = STR_MENU_OPERATE; } };}RESOURCE MENU_PANE r_bluetooth_sample_menuitems{ items = { MENU_ITEM {command = EBluetoothSampleStart; txt = STR_MENUITEM_START; }, MENU_ITEM {command = EBluetoothSampleStop; txt = STR_MENUITEM_STOP; } };}
#define STR_MENU_OPERATE "操作"#define STR_MENUITEM_START "启动"#define STR_MENUITEM_STOP "停止"
enum TBluetoothSampleCommandIds{ // 启动 EBluetoothSampleStart = 1, // 停止 EBluetoothSampleStop = 2 };