Beispiel #1
0
	void Application::Launch()
	{
		ShowWindow(mHWnd, SW_SHOW);

		mLog->Out("Application launched!");

		OnStarted();
		onStarted.Invoke();
		o2Events.OnApplicationStarted();

		MSG msg;
		memset(&msg, 0, sizeof(msg));

		//mTimer->Reset();

		while (msg.message != WM_QUIT)
		{
			if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
			{
				TranslateMessage(&msg);
				DispatchMessage(&msg);
			}
			else
			{
				ProcessFrame();
			}
		}

		o2Events.OnApplicationClosing();
		OnClosing();
		onClosing.Invoke();
	}
Beispiel #2
0
///
/// @brief Initializes a new instance of the MainWindow class.
///
///    This class handles the main window of the application.
///
/// @param    parent        The parent widget for this window
/// @param    flags        Windows flags Qt::WindowFlags
///
MainWindow::MainWindow( QWidget* parent, Qt::WFlags flags ) :
    QMainWindow( parent, flags )
{
    // Create the UI elements designed with the QTDesigner
    ui.setupUi( this );

    // Create the GPS Map as a docked widget
    gpsMap = new GpsMap( this );
    setCentralWidget( gpsMap );

    // Set the window title
    setWindowTitle( qApp->applicationName() );

    // Create the toolbar buttons
    //toolButtonConnect = new QToolButton( this );
    //toolButtonConnect->setText( tr( "Connect" ) );
    //ui.toolBar->addWidget( toolButtonConnect );
    //toolButtonDisconnect = new QToolButton( this );
    //toolButtonDisconnect->setText( tr( "Disconnect" ) );
    //ui.toolBar->addWidget( toolButtonDisconnect );

    //// Connect the button signals
    //connect( toolButtonConnect, SIGNAL( clicked() ), this, SLOT( OnConnect() ) );
    //connect( toolButtonDisconnect, SIGNAL( clicked() ), this, SLOT( OnDisconnect() ) );

    // Do something.
    toolButtonConnect = new QToolButton( this );
    toolButtonConnect->setText( tr( "Read SST" ) );
    ui.toolBar->addWidget( toolButtonConnect );
    connect( toolButtonConnect, SIGNAL( clicked() ), this, SLOT( OnCommand() ) );

    // Set up a connection with the applications aboutToQuit event to close the
    // serial controller if required
    qApp->connect( qApp, SIGNAL( aboutToQuit() ), this, SLOT( OnClosing() ) );

    // Update the state of the controls on the window
    UpdateWindow();

    setUnifiedTitleAndToolBarOnMac( true );

    // Initialise the Navcast WM-3 NDM SDK

    tGlobal< tSiriusXmWeatherManager >::SetInstance( new tSiriusXmWeatherManager() );
    tGlobal< tSiriusXmWeatherManager >::Instance()->ConnectToModule( "partners.navcast.com", 9202 );

    //connect( tGlobal< tSiriusXmWeatherManager >::Instance(),
    //         SIGNAL( WeatherUpdated( double, double, double, double ) ),
    //         this,
    //         SLOT( OnWeatherUpdated( double, double, double, double ) ) );

    connect( tGlobal< tSiriusXmWeatherManager >::Instance(),
             SIGNAL( PrecipitationDataUpdated( double, double, double, double ) ),
             this,
             SLOT( OnWeatherUpdated( double, double, double, double ) ) );
}
Beispiel #3
0
void ff::ViewWindow::Close()
{
	assertRet(IsValid());

	OnClosing();

#if !METRO_APP
	::SendMessage(Handle(), WM_CLOSE, 0, 0);
#endif

	OnClosed();
}