Files correlati : Ricompilazione Demo : [ ] Commento :nuovo skeylink.h delle eutron aggiunto nella OnInit delle nostre applicazioni la possibilita' di dire chi e' l'applicazione stessa (per ora serve al setup per scoprire se benetti non ha spento il server di chiavi o la barbarella ha campo acceso) git-svn-id: svn://10.65.10.50/trunk@15644 c028cbd2-c16b-5b4b-a496-9718f37d4682
73 lines
1.3 KiB
C++
Executable File
73 lines
1.3 KiB
C++
Executable File
#include "../xvaga/wxinc.h"
|
|
|
|
#include <wx/snglinst.h>
|
|
|
|
extern int xvt_main(int argc, char** argv);
|
|
|
|
class TMainApp : public wxApp
|
|
{
|
|
wxLocale m_Locale;
|
|
wxSingleInstanceChecker* m_sic;
|
|
|
|
protected:
|
|
virtual bool OnInit();
|
|
virtual int OnExit();
|
|
|
|
#if wxCHECK_VERSION(2,6,1)
|
|
virtual void OnTimer(wxTimerEvent& event);
|
|
DECLARE_EVENT_TABLE()
|
|
#endif
|
|
|
|
DECLARE_DYNAMIC_CLASS(TMainApp);
|
|
};
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS(TMainApp, wxApp)
|
|
|
|
DECLARE_APP(TMainApp)
|
|
|
|
IMPLEMENT_APP(TMainApp)
|
|
|
|
#if wxCHECK_VERSION(2,6,1)
|
|
|
|
#define TIMER_ID 883
|
|
|
|
BEGIN_EVENT_TABLE(TMainApp, wxApp)
|
|
EVT_TIMER(TIMER_ID, TMainApp::OnTimer)
|
|
END_EVENT_TABLE()
|
|
|
|
void TMainApp::OnTimer(wxTimerEvent& event)
|
|
{
|
|
xvt_main(argc, argv);
|
|
}
|
|
|
|
#endif
|
|
|
|
bool TMainApp::OnInit()
|
|
{
|
|
wxString strApp = argv[0];
|
|
const wxString strWrk = strApp.BeforeLast('.');
|
|
strApp = strWrk.Right(3);
|
|
strApp.MakeLower();
|
|
m_sic = new wxSingleInstanceChecker(strApp);
|
|
m_Locale.Init(wxLocale::GetSystemLanguage()); // wxLANGUAGE_ITALIAN
|
|
|
|
#ifdef __WXDEBUG__
|
|
// wxLog::SetTraceMask(wxTraceMessages);
|
|
#endif
|
|
|
|
#if wxCHECK_VERSION(2,6,1)
|
|
wxTimerEvent evt(TIMER_ID);
|
|
AddPendingEvent(evt);
|
|
return true;
|
|
#else
|
|
xvt_main(argc, argv);
|
|
return false;
|
|
#endif
|
|
}
|
|
|
|
int TMainApp::OnExit()
|
|
{
|
|
delete m_sic;
|
|
m_sic = NULL;
|
|
return wxApp::OnExit();
|
|
} |