Changeset 42:719f590e4878 in xplra for src/plugin/src/xplra/plugin.cc
- Timestamp:
- 02/14/13 19:09:26 (11 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/plugin/src/xplra/plugin.cc
r38 r42 39 39 #include <XPLMUtilities.h> 40 40 #include <XPLMProcessing.h> 41 #include <XPLMMenus.h> 41 42 42 43 #include <cstdio> … … 66 67 */ 67 68 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 } 68 95 69 96 //------------------------------------------------------------------------------ … … 96 123 XPLMHostApplicationID hostID = 0; 97 124 XPLMGetVersions(&xplaneVersion, &xplmVersion, &hostID); 125 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); 98 133 99 134 messageWindow = new MessageWindow();
Note:
See TracChangeset
for help on using the changeset viewer.