00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "../include/MatocadApp.h"
00010 #include "../include/MainFrm.h"
00011 #include "wx/splash.h"
00012 #include "wx/image.h"
00013 #include <wx/tipdlg.h>
00014 #include <wx/file.h>
00015
00016
00017
00018 IMPLEMENT_APP(MainFrmApp)
00019
00020 bool MainFrmApp::OnInit()
00021 {
00022 wxSplashScreen* splash;
00023 wxImage bitmap;
00024
00025 bitmap.AddHandler(new wxPNGHandler);
00026 if (bitmap.LoadFile(_T("./splash.png"), wxBITMAP_TYPE_PNG))
00027 {
00028 splash = new wxSplashScreen(bitmap,
00029 wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
00030 2000, NULL, 3001, wxDefaultPosition, wxDefaultSize,
00031 wxSIMPLE_BORDER|wxSTAY_ON_TOP);
00032 splash->Show();
00033 }
00034
00035
00036 MainFrm *myFrame = new MainFrm(NULL,wxID_ANY, wxT("MatOCAD"), wxDefaultPosition, wxSize(800,600), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE);
00037 SetTopWindow(myFrame);
00038 myFrame->Show(TRUE);
00039
00040
00041
00042 if(!wxFileExists(_T("notips.log")))
00043 {
00044 wxTipProvider *tipProvider = wxCreateFileTipProvider(_T("tips.txt"), 0);
00045 if(!wxShowTip(myFrame, tipProvider))
00046 {
00047 wxFile File(_T("notips.log"),wxFile::write);
00048 File.Close();
00049 }
00050
00051 delete tipProvider;
00052 }
00053 return TRUE;
00054 }
00055
00056 int MainFrmApp::OnExit()
00057 {
00058 return 0;
00059 }