Patch level :4.0 800

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :aggiunto un wxCheckVersion per poter mantenere le modifiche fatte per wx283


git-svn-id: svn://10.65.10.50/trunk@15691 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2007-10-08 13:45:54 +00:00
parent cffabe2571
commit 1886d71e64

View File

@ -1,23 +1,27 @@
#include "../xvaga/wxinc.h" #include "../xvaga/wxinc.h"
#if wxCHECK_VERSION(2,8,3)
#include <wx/filename.h> #include <wx/filename.h>
#include <wx/snglinst.h> #include <wx/snglinst.h>
#endif
extern int xvt_main(int argc, char** argv); extern int xvt_main(int argc, char** argv);
class TMainApp : public wxApp class TMainApp : public wxApp
{ {
wxLocale m_Locale; wxLocale m_Locale;
#if wxCHECK_VERSION(2,8,3)
wxSingleInstanceChecker* m_sic; wxSingleInstanceChecker* m_sic;
#endif
protected: protected:
virtual bool OnInit(); virtual bool OnInit();
virtual int OnExit(); virtual int OnExit();
#if wxCHECK_VERSION(2,6,1)
virtual void OnTimer(wxTimerEvent& event); virtual void OnTimer(wxTimerEvent& event);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
#endif
DECLARE_DYNAMIC_CLASS(TMainApp); DECLARE_DYNAMIC_CLASS(TMainApp);
}; };
@ -28,7 +32,6 @@ DECLARE_APP(TMainApp)
IMPLEMENT_APP(TMainApp) IMPLEMENT_APP(TMainApp)
#if wxCHECK_VERSION(2,6,1)
#define TIMER_ID 883 #define TIMER_ID 883
@ -41,33 +44,27 @@ void TMainApp::OnTimer(wxTimerEvent& event)
xvt_main(argc, argv); xvt_main(argc, argv);
} }
#endif
bool TMainApp::OnInit() bool TMainApp::OnInit()
{ {
#if wxCHECK_VERSION(2,8,3)
wxFileName strWrk = argv[0]; wxFileName strWrk = argv[0];
const wxString strApp = strWrk.GetName().Lower(); const wxString strApp = strWrk.GetName().Lower();
m_sic = new wxSingleInstanceChecker(strApp); m_sic = new wxSingleInstanceChecker(strApp);
#endif
m_Locale.Init(wxLocale::GetSystemLanguage()); // wxLANGUAGE_ITALIAN m_Locale.Init(wxLocale::GetSystemLanguage()); // wxLANGUAGE_ITALIAN
#ifdef __WXDEBUG__
// wxLog::SetTraceMask(wxTraceMessages);
#endif
#if wxCHECK_VERSION(2,6,1)
wxTimerEvent evt(TIMER_ID); wxTimerEvent evt(TIMER_ID);
AddPendingEvent(evt); AddPendingEvent(evt);
return true; return true;
#else
xvt_main(argc, argv);
return false;
#endif
} }
int TMainApp::OnExit() int TMainApp::OnExit()
{ {
#if wxCHECK_VERSION(2,8,3)
delete m_sic; delete m_sic;
m_sic = NULL; m_sic = NULL;
#endif
return wxApp::OnExit(); return wxApp::OnExit();
} }