Example #1
0
// This is the mouse click handler.
static int XPPopupHandleMouseClickCB(
                                   XPLMWindowID         inWindowID,    
                                   int                  x,    
                                   int                  y,    
                                   XPLMMouseStatus      inMouse,    
                                   void *               inRefcon)
{
	// Normally we do nothing.  But when we get an up click we dismiss.
	if (inMouse == xplm_MouseUp)
	{
		XPPopupMenu_t * pmenu = (XPPopupMenu_t *) inRefcon;

		int menu_offset = XPItemForHeight(pmenu, x, y);	
		
		// If we got an item click and it is not enabled,
		// pretend nothing was picked.
		if (menu_offset >= 0 && !pmenu->enabled[menu_offset])
			menu_offset = -1;
			
		// Call the callback
		if (pmenu->function)
			pmenu->function(menu_offset, pmenu->ref);

		// cleanup
		delete pmenu;
		XPLMDestroyWindow(inWindowID);
	}
	return 1;
}
Example #2
0
PLUGIN_API void	XPluginStop(void) {
    XPLMUnregisterFlightLoopCallback(SmoothSailingCallback, NULL);

    if( DEBUG ) {
        XPLMDestroyWindow(debug_window);
    }
}
int	destroyGNSWindow()
{
    int res = 0;


    // Register so that our gauge is drawing during the Xplane gauge phase
    XPLMUnregisterDrawCallback(myDrawGNSCallback, xplm_Phase_Window, 0, NULL);
    logMessageEx("--- DrawCallback unregistered");

    // Unregister the callback
    XPLMUnregisterFlightLoopCallback(myFlightLoopCallback, NULL);
    logMessageEx("--- FlightLoopCallback unregistered");

    // Destroy GNS window
    XPLMDestroyWindow(gWindow);
    logMessageEx("--- GNS Window destroyed");

    //Gns500Intf.Close();

    gnsOpened = false;

    return res;

}
/*
 * XPluginStop
 * 
 * Our cleanup routine deallocates our window.
 * 
 */
PLUGIN_API void	XPluginStop(void)
{
	XPLMDestroyWindow(gWindow);
}
Example #5
0
/*
 * XPluginStop
 * 
 * Our cleanup routine deallocates our window.
 * 
 */
PLUGIN_API void	XPluginStop(void)
{
	//std::cout << "Stopping DIS plugin" << std::endl;
	XPLMDestroyWindow(gWindow);
}