Example #1
0
bool YmgyrchApp::OnInit()
{
	MainFrame *frame = new MainFrame(0);
	frame->Show(TRUE);
	SetTopWindow(frame);
	return true;
}
Example #2
0
// int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) {
int main() {
	
	try {
		DesignerApplication app;
		
		MainFrame frame;
		
		frame.Create(L"wcl Designer", WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS, CW_USEDEFAULT, CW_USEDEFAULT, 400, 300, NULL, NULL);
		frame.Show(SW_NORMAL);
		
		return app.Run();
	} catch (const wcl::Exception &e) {
		MessageBoxA(NULL, e.what(), "Designer - Windows Exception", MB_OK|MB_ICONERROR);

		return 1;
	} catch (const std::exception &e) {
		MessageBoxA(NULL, e.what(), "Designer - C++ Exception", MB_OK|MB_ICONERROR);

		return 2;
	} catch (...) {
		MessageBoxA(NULL, "Unknown fatal error", "Designer - C++ Exception", MB_OK|MB_ICONERROR);

		return 3;
	}
}
Example #3
0
bool sQ1App::OnInit()
{
	sq1::InitVariables();
	// open CAN channel:
	if (!sq1::OpenCAN())
		return false;
	sq1::DriveReset();
	sq1::DriveInit();


	wxInitAllImageHandlers();

	int width = 285;
	int height = 540;
	MainFrame *pFrame = new MainFrame(wxT("sQ1 Control Panel"), width, height);
	
	wxCmdLineParser parser(argc, argv);
	OnInitCmdLine(parser);
	parser.Parse();
	OnCmdLineParsed(parser);
	
	pFrame->Show(true);
	SetTopWindow(pFrame);
	
	Connect( wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(sQ1App::OnIdle) );

	return true;
};
Example #4
0
/**
 * @return bool
 */
bool MainApp::OnInit()
{
  MainFrame* mainFrame = new MainFrame(_T("EGF Editor"));
  mainFrame->Show();

  return true;
}
Example #5
0
bool App::OnInit() {
   SetAppName(u8"flutterrust");
   SetAppDisplayName(u8"flutterrust");

   const wxFileName exeFileName{wxStandardPaths::Get().GetExecutablePath()};
   const std::string exePath = exeFileName.GetPath().ToStdString();
   try {
      Creature::loadTypes(exePath + static_cast<char>(wxFileName::GetPathSeparator()) +
                          u8"CreatureTable.txt");
      mainFrame = new MainFrame{exePath};
   } catch (const std::exception& e) {
      wxMessageDialog dialog{nullptr, u8"Exception caught.  Terminating.\n",
                             u8"Fatal error", wxICON_ERROR | wxOK};
      dialog.SetExtendedMessage(std::string{typeid(e).name()} + ": \"" + e.what() + '"');
      dialog.ShowModal();
      return false;  // Exit the application immediately.
   } catch (...) {
      wxMessageDialog(nullptr, u8"Unknown exception caught.  Terminating.",
                      u8"Fatal error", wxICON_ERROR | wxOK)
          .ShowModal();
      return false;
   }

   mainFrame->Show(true);
   SetTopWindow(mainFrame);

   return true;  // Continue processing.
}
Example #6
0
bool App::OnInit()
{
   SetAppName(u8"TrackHack");
   SetAppDisplayName(u8"TrackHack");

   wxFileName localFileName = wxFileConfig::GetLocalFile("track_hack.ini",
      wxCONFIG_USE_SUBDIR);
   if (!localFileName.FileExists() && // Does the user-specific configuration file exist?
       !localFileName.DirExists())    // If not, does the directory where it would have
                                      // been not exist either?
   {
      // Create that directory.
      bool success = wxFileName::Mkdir(localFileName.GetPath(), wxS_DIR_DEFAULT,
         wxPATH_MKDIR_FULL);

      if (!success) { // Assert success in creating it; otherwise terminate.
         ::wxLogFatalError("Failed to create local configuration directory: "
            "%s\n\nTerminating.", localFileName.GetPath());
      }
   }

   wxConfigBase::Set(new wxFileConfig{u8"TrackHack", wxEmptyString, u8"track_hack.ini",
      u8"track_hack.ini", wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE |
      wxCONFIG_USE_SUBDIR});

   // No wxInitAllImageHandlers() as for now, only the BMP/DIB file format is supported.

   mainFrame = new MainFrame(wxDefaultPosition, wxSize(640, 720));

   mainFrame->Show(true);
   SetTopWindow(mainFrame);

   return true;
}
bool SettingsSampleApp::OnInit()
{
	// load application settings if the configuration file exists, otherwise default
	// values are used

	// initialize serializer
	m_XmlIO.SetSerializerOwner(wxT("StaticSettingsSampleApp"));
	m_XmlIO.SetSerializerRootName(wxT("settings"));
	m_XmlIO.SetSerializerVersion(wxT("1.0.0"));

    // tell the serializer's root node it should serialize static 'Settings' class instance as a
    // standard property (the 'Settings' class instance is not created at the runtime, only its
    // properties are serialized).
    m_XmlIO.GetRootItem()->AddProperty(new xsProperty(&m_Settings, wxT("serializablestatic"), wxT("app_settings")));

	if( wxFileExists(wxT("settings.xml")) )
	{		// load settings from configuration file
		m_XmlIO.DeserializeFromXml(wxT("settings.xml"));
	}

    // create and show main application frame
    MainFrame *frame = new MainFrame(NULL);
    SetTopWindow(frame);
    frame->Show();

    return true;
}
Example #8
0
bool PRIMEServer::OnInit()
{
#ifdef _DEBUG
    Utilities::SetStdOutToNewConsole();
#endif

    PRIME::Reply a;
    
    m_frame = new MainFrame( (wxFrame *)NULL , -1, wxString::FromUTF8("FLOW Server") );
    m_frame->SetIcon(wxICON(FLOW));
    m_frame->Show( true );

    a.set_type(PRIME::Reply_ReplyType_SPEED_TEST);
    int size = a.ByteSize();
    m_frame->log(wxString::Format("Size %d", size));
	
    wxString str;
    str.Format("%d",wxThread::GetCPUCount());
    m_frame->log(str);
    //printf("\nValue %d\n", a.type());
    if(wxSocketBase::Initialize()){
        wxString t;
        t = wxString::Format("%d",a.type());
        wxString s(wxT("Socket Base Initialized\n"+t));
        m_frame->log(s);
    } else {
        //m_frame->C3OOutputText->AppendText(wxT("Socket Base NOT Initialized... Exiting!\n"));
    }
    
    return true;
}
Example #9
0
bool CustomDataSampleApp::OnInit()
{
    // load application settings if the configuration file exists, otherwise create new
    // settings class object with default values

    // initialize serializer
    m_XmlIO.SetSerializerOwner(wxT("CustomDataSampleApp"));
    m_XmlIO.SetSerializerRootName(wxT("settings"));
    m_XmlIO.SetSerializerVersion(wxT("1.0.0"));

    // register new property I/O handler 'xsColourDataPropIO' for data type with name 'colourdata'
    XS_REGISTER_IO_HANDLER(wxT("colourdata"), xsColourDataPropIO);

    // create serialized settings class object manualy with default values
    m_pSettings = new Settings();
    // insert settings class object into serializer as its root node
    m_XmlIO.SetRootItem(m_pSettings);

    if( wxFileExists(wxT("settings.xml")) )
    {   // load settings from configuration file
        m_XmlIO.DeserializeFromXml(wxT("settings.xml"));
    }

    // create and show main application frame
    MainFrame *frame = new MainFrame(NULL);
    SetTopWindow(frame);
    frame->Show();

    return true;
}
Example #10
0
bool App::OnInit()
{
    bool ok = wxApp::OnInit();

    if (ok)
    {
        wxLocaleHelper::Init(&m_locale, STE_APPNAME, m_cmdLine.m_lang);
        ::wxInitAllImageHandlers();

        // Fill in the application information fields before creating wxConfig.
        SetVendorName(wxT("wxWidgets"));
        SetAppName(APP_NAME_SHORT);
    #if (wxVERSION_NUMBER >= 2900)
        SetAppDisplayName(APP_NAME_DISPLAY);
    #endif

        // Create a document manager
        wxDocManager* docManager = CreateDocManager();

        // create the main frame window
        MainFrame* frame = new MainFrame();
        
        ok = frame->Create(docManager, GetAppDisplayName());
        if (ok)
        {
            frame->Show();
            OpenDocuments(docManager);
        }
        else
        {
            delete frame;
        }
    }
    return ok;
}
Example #11
0
bool MyApp::OnInit()
{
#ifdef __LINUX__
setlocale (LC_ALL,"POSIX");
#endif

 register_all_file_formats();
#if GILVIEWER_USE_GDAL
    OGRRegisterAll();
#endif // GILVIEWER_USE_GDAL
	try
	{
		if ( InitFrame() )
			m_mainFrameDock->Show();
		else
			exit(0);


	}
	catch( std::exception &e )
	{
		wxString message;
		message << wxString(e.what(), *wxConvCurrent);
		wxMessageBox( message );
	}
	catch( ... )
	{
		wxMessageBox( _("Unhandled exception ...") );
	}

	return true;
}
Example #12
0
bool TimeApp::OnInit(){

	MainFrame* m = new MainFrame(NULL);
	m->Show(true);

	return true;
}
Example #13
0
bool MyApp::OnInit()
{
	MainFrame *frame = new MainFrame(NULL);
    frame->SetIcon(wxICON(datcom)); // To Set App Icon
    frame->Show();
	return true;
}
Example #14
0
// `Main program' equivalent, creating windows and returning main app frame
bool wxOsgApp::OnInit()
{
    if (argc<2)
    {
        std::cout << wxString(argv[0]).mb_str() <<": requires filename argument." << std::endl;
        return false;
    }

    int width = 800;
    int height = 600;

    // Create the main frame window

    MainFrame *frame = new MainFrame(NULL, wxT("wxWidgets OSG Sample"),
        wxDefaultPosition, wxSize(width, height));

    // create osg canvas
    //    - initialize

    int *attributes = new int[7];
    attributes[0] = int(WX_GL_DOUBLEBUFFER);
    attributes[1] = WX_GL_RGBA;
    attributes[2] = WX_GL_DEPTH_SIZE;
    attributes[3] = 8;
    attributes[4] = WX_GL_STENCIL_SIZE;
    attributes[5] = 8;
    attributes[6] = 0;

    OSGCanvas *canvas = new OSGCanvas(frame, wxID_ANY, wxDefaultPosition,
        wxSize(width, height), wxSUNKEN_BORDER, wxT("osgviewerWX"), attributes);

    GraphicsWindowWX* gw = new GraphicsWindowWX(canvas);

    canvas->SetGraphicsWindow(gw);

    osgViewer::Viewer *viewer = new osgViewer::Viewer;
    viewer->getCamera()->setGraphicsContext(gw);
    viewer->getCamera()->setViewport(0,0,width,height);
    viewer->addEventHandler(new osgViewer::StatsHandler);
    viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);

    // load the scene.
    wxString fname(argv[1]);
    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(std::string(fname.mb_str()));
    if (!loadedModel)
    {
        std::cout << argv[0] <<": No data loaded." << std::endl;
        return false;
    }

    viewer->setSceneData(loadedModel.get());
    viewer->setCameraManipulator(new osgGA::TrackballManipulator);
    frame->SetViewer(viewer);

    /* Show the frame */
    frame->Show(true);

    return true;
}
Example #15
0
bool MyApp::OnInit()
{
	frame = new MainFrame( NULL, wxID_ANY, _T("MP Processor"));//_T("Hello World"), wxPoint(50,50), wxSize(450,340) );
	frame->setApp(this);
	frame->Show(TRUE);
	SetTopWindow(frame);
	return TRUE;
}
Example #16
0
bool MainApp::OnInit()
{
    MainFrame *frame = new MainFrame(wxT("Process RealTime Control "));

    frame->Show(true);

    return true;
}
Example #17
0
bool XbeeMonitorApp::OnInit()
{
    MainFrame *frame = new MainFrame( _("XBEE Network Monitor"), wxPoint(50, 50),
                                  wxSize(450,400) );
    frame->Show(true);
    SetTopWindow(frame);

    return true;
}
Example #18
0
	bool OnInit()
	{
		wxInitAllImageHandlers();

		MainFrame *mainFrame = new MainFrame();
		SetTopWindow(mainFrame);
		mainFrame->Show(true);
		return true;
	}
Example #19
0
	  virtual bool OnInit() {
		  wxInitAllImageHandlers();
		  I18n::Init();
		  MainFrame* window = new MainFrame(NULL);
		  window->SetIcon(wxIcon(wxT("AAAAAAAAAAAAA")));
		  WindowManager::SetMainWindow(window);
		  window->Show(true);
		  window->Centre();
		  return true;
	  }
Example #20
0
bool WorldEditor::OnInit() {

	ilInit();

	MainFrame* frame = new MainFrame();
	//frame->init();
	frame->Show(true);
	SetTopWindow(frame);
	return true;
}
Example #21
0
	virtual bool OnInit()
	{
    controller = std::make_shared < GUI_controller >();// .reset(new GUI_controller());
   // controller = new GUI_controller();
    controller->init();
    
    frame = new MainFrame("Scrates", wxDefaultPosition, wxSize(640, 480), controller.get());
		frame->Show(true);
		return true;
	}
Example #22
0
bool MyApp::OnInit()
{
	DBManager::db_init();

    MainFrame *mainFrame = new MainFrame( "GradeSnap", 
         wxPoint(50,50), wxSize(1024,800) );
    mainFrame->Show(TRUE);
    SetTopWindow(mainFrame);
    return TRUE;
} 
Example #23
0
    bool MainApp::OnInit()
    {
        wxInitAllImageHandlers();

        MainFrame *frame = new MainFrame( NULL );

        frame->Show(TRUE);
        SetTopWindow(frame);		
		
        return true;
    }
Example #24
0
 virtual bool OnInit() {
   wxApp::OnInit();
   wxXmlResource::Get()->InitAllHandlers();
   wxImage::AddHandler(new wxPNGHandler);
   wxXmlResource::Get()->Load("app.xrc");
   frame = new MainFrame();
   wxXmlResource::Get()->LoadFrame(frame, NULL, "main_frame");
   frame->initialize();
   frame->Show();
   return true;
 }
Example #25
0
////////////////////////////////////////////////////////////
// Class name:  PupilMeasureApp
// Method name: OnInit
//
// Description: wxWidgets program entry point.
////////////////////////////////////////////////////////////
bool PupilMeasureApp::OnInit()
{
    // create model
    PupilMeasure *model = new PupilMeasure();

    // create main frame, with model
    MainFrame *frame = new MainFrame(NULL, model);
    
    // show frame
    frame->Show();
    return true;
}
Example #26
0
//Draws the main window when program starts.
bool StrEditApp::OnInit() {
    //Set up locale stuff.
    boost::locale::generator gen;
    locale::global(gen(""));

    //Initialise main window.
    MainFrame *frame = new MainFrame(wxT("StrEdit"));
    frame->Show(true);
    SetTopWindow(frame);

    return true;
}
Example #27
0
void
MainApp::new_instance(const char* values, size_t values_size,
                      MainFrameValueChangeListener* l,
                      const char* tree_file)
{
  MainFrame *win = new MainFrame("Frame", wxPoint (100, 100),
                                 wxSize(500, 500),
                                 tree_file,
                                 values, values_size);
  win->add_value_change_listener(l);
  win->Show(TRUE);
}
Example #28
0
bool MainApp::OnInit()
{
	if(!wxApp::OnInit())
	{
		return false;
	}

	MainFrame* frame = new MainFrame(wxT("wxRenamer Ver : 0.1"));

	frame->Show(true);

	return true;
}
Example #29
0
bool MainApp::OnInit() 
{
	// Create an instance of our frame, or window 
	MainFrame *MainWin = new MainFrame(_("Hello World!"), wxDefaultPosition, wxSize(300, 200));
	MainWin->Show(true); // show the window 
	SetTopWindow(MainWin); // and finally, set it as the main window 



	//Button* btnapp = new Button(wxT("Button"));
	//btnapp->Show(true);

	return true;
} 
	bool OnInit()
	{
		if (!wxApp::OnInit())
			return false;

		try {
			_frame = new MainFrame();
			_frame->Show(true); // afficher la fenetre
		}
		catch (std::runtime_error& err) {
			wxMessageBox(wxString(err.what()), wxT("Error"));
		}
		return true;
	};