Changeset 43:d05df1944444 in xplra for src/plugin
- Timestamp:
- 02/15/13 18:40:40 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/plugin/src/xplra
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/plugin/src/xplra/Makefile.am
r39 r43 19 19 ReloadPluginsRequest.cc \ 20 20 MessageWindow.cc \ 21 MessageRequest.cc 21 MessageRequest.cc \ 22 Menu.cc 22 23 23 24 noinst_HEADERS= \ … … 37 38 ReloadPluginsRequest.h \ 38 39 MessageWindow.h \ 39 MessageRequest.h 40 MessageRequest.h \ 41 Menu.h 40 42 41 43 if TARGET_API_POSIX -
src/plugin/src/xplra/plugin.cc
r42 r43 32 32 33 33 #include "MessageWindow.h" 34 #include "Menu.h" 34 35 35 36 #include <hu/varadiistvan/xplcommon/Util.h> … … 53 54 using xplra::ListenThread; 54 55 using xplra::MessageWindow; 56 using xplra::Menu; 55 57 56 58 using hu::varadiistvan::xplcommon::Util; … … 64 66 65 67 /** 68 * The menu. 69 */ 70 static Menu* menu = 0; 71 72 /** 66 73 * The thread to use to listen for incoming connections. 67 74 */ 68 75 static ListenThread* listenThread = 0; 69 70 /**71 * The ID of the menu of the plugin.72 */73 static XPLMMenuID menuID = 0;74 75 /**76 * The index of the show message area menu item.77 */78 static int showMessageAreaIndex = 0;79 80 //------------------------------------------------------------------------------81 82 static void menuHandler(void* /*menuRef*/, void* /*itemRef*/)83 {84 // Util::debug("hu.varadiistvan.xplra menuHandler called\n");85 XPLMMenuCheck checked = xplm_Menu_NoCheck;86 XPLMCheckMenuItemState(menuID, showMessageAreaIndex, &checked);87 if (checked==xplm_Menu_Unchecked) {88 XPLMCheckMenuItem(menuID, showMessageAreaIndex, xplm_Menu_Checked);89 messageWindow->show();90 } else if (checked==xplm_Menu_Checked) {91 XPLMCheckMenuItem(menuID, showMessageAreaIndex, xplm_Menu_Unchecked);92 messageWindow->hide();93 }94 }95 76 96 77 //------------------------------------------------------------------------------ … … 124 105 XPLMGetVersions(&xplaneVersion, &xplmVersion, &hostID); 125 106 126 int menuIndex = XPLMAppendMenuItem(XPLMFindPluginsMenu(),127 "Remote Access", NULL, 1);128 menuID = XPLMCreateMenu("Remote Access", XPLMFindPluginsMenu(), menuIndex,129 &menuHandler, 0);130 showMessageAreaIndex = XPLMAppendMenuItem(menuID, "Show message area",131 0, 1);132 XPLMCheckMenuItem(menuID, showMessageAreaIndex, xplm_Menu_Unchecked);133 134 107 messageWindow = new MessageWindow(); 108 menu = new Menu(*messageWindow); 135 109 136 110 listenThread = new ListenThread(xplaneVersion, xplmVersion, … … 160 134 } 161 135 136 delete menu; menu = 0; 162 137 delete messageWindow; messageWindow = 0; 163 138 }
Note:
See TracChangeset
for help on using the changeset viewer.