Exemple #1
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;
}
Exemple #2
0
bool DnDFile::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
{
	MainFrame * frame = (MainFrame *)parent;
	frame->ChangeFile(filenames[0]);
	
	return true;
}
Exemple #3
0
int App::Run(LPCTSTR /*lpstrCmdLine*/, int nCmdShow)
{
   if (!ParseCommandLine())
      return 0;

   CMessageLoop theLoop;
   _Module.AddMessageLoop(&theLoop);

   MainFrame wndMain;

   if (!m_cszFilename.IsEmpty())
      wndMain.OpenFileAtStart(m_cszFilename);

   if (wndMain.CreateEx() == nullptr)
   {
      ATLTRACE(_T("Main window creation failed!\n"));
      return 0;
   }

   wndMain.ShowWindow(nCmdShow);

   int nRet = theLoop.Run();

   _Module.RemoveMessageLoop();
   return nRet;
}
// Overrides
bool PowerTabTuningView::OnCreate(wxDocument* doc, long flags)
{
    //------Last Checked------//
    // - Dec 30, 2004
    WXUNUSED(flags);
    
    MainFrame* mainFrame = GetMainFrame();
    wxCHECK(mainFrame != NULL, false);
    
    m_frame = mainFrame->CreateChildFrame(doc, this);
    wxCHECK(m_frame != NULL, false);
    
    m_window = CreateViewWindow();
    wxCHECK(m_window != NULL, false);
    
#ifdef __X__
    // X seems to require a forced resize
    int x, y;
    m_frame->GetSize(&x, &y);
    m_frame->SetSize(-1, -1, x, y);
#endif
    
    m_frame->Show(true);
    Activate(true);
    
    return (true);
}
// Overrides
bool PowerTabView::OnCreate(wxDocument *doc, long flags)
{
    //------Last Checked------//
    // - Jan 27, 2005
    WXUNUSED(flags);
    
    MainFrame* mainFrame = GetMainFrame();
    wxCHECK(mainFrame != NULL, false);
    
    m_frame = mainFrame->CreateChildFrame(doc, this);
    wxCHECK(m_frame != NULL, false);
    
    m_frame->SetTitle(wxT("PowerTabView"));

    m_canvas = CreateCanvas(this, m_frame);
    wxCHECK(m_canvas != NULL, false);
    
#ifdef __X__
    // X seems to require a forced resize
    int x, y;
    m_frame->GetSize(&x, &y);
    m_frame->SetSize(-1, -1, x, y);
#endif

    m_frame->Show(true);
    Activate(true);

    return (true);
}
Exemple #6
0
bool MyApp::OnInit()
{
	MainFrame *frame = new MainFrame(NULL);
    frame->SetIcon(wxICON(datcom)); // To Set App Icon
    frame->Show();
	return true;
}
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int nCmdShow)
#endif
{
	CPaintManagerUI::SetInstance(hInstance);

#if defined(WIN32) && !defined(UNDER_CE)
	HRESULT Hr = ::CoInitialize(NULL);
#else
	HRESULT Hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED);
#endif
	if( FAILED(Hr) ) return 0;

	MainFrame* pFrame = new MainFrame();
	if( pFrame == NULL ) return 0;
#if defined(WIN32) && !defined(UNDER_CE)
	pFrame->Create(NULL, _T("Çý¶¯Ð¶ÔسÌÐò"), UI_WNDSTYLE_FRAME, WS_EX_STATICEDGE | WS_EX_APPWINDOW, 0, 0, 600, 800);
#else
	pFrame->Create(NULL, _T("Çý¶¯Ð¶ÔسÌÐò"), UI_WNDSTYLE_FRAME, WS_EX_TOPMOST, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
#endif
	pFrame->CenterWindow();
	::ShowWindow(*pFrame, SW_SHOW);

	CPaintManagerUI::MessageLoop();

	return 0;
}
Exemple #8
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;
}
Exemple #9
0
bool YmgyrchApp::OnInit()
{
	MainFrame *frame = new MainFrame(0);
	frame->Show(TRUE);
	SetTopWindow(frame);
	return true;
}
Exemple #10
0
BOOL WindowsApp::InitInstance()
{
	// Standard initialization

#if _MFC_VER < 0x0700
#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
#endif

	// Change the registry key under which our settings are stored.
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	// Qt initialization
	QMfcApp::instance(this);


	MainFrame* pFrame = new MainFrame;
	m_pMainWnd = pFrame;

	// create and load the frame with its resources

	pFrame->LoadFrame(IDR_MAINFRAME,
		WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
		NULL);



	pFrame->ShowWindow(SW_SHOW);
	pFrame->UpdateWindow();

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

  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;
}
Exemple #13
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainFrame w;
    w.show();
    return a.exec();
}
Exemple #14
0
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE,
  LPSTR lpCmdLine, int nShowCmd)
{
  kMainAccel = NULL;
  InitCommonControls();
  kInstance = hInstance;
  MainFrame::Register();

  MainFrame *frame = new MainFrame(lpCmdLine);

  frame->Create("DKC2 Editor", 128, 128, 512, 512, NULL);

  MSG msg;
  while (GetMessage(&msg, NULL, 0, 0)) {
    //if (!kMainAccel || !TranslateAccelerator(frame->GetHWND(), kMainAccel, &msg)) {
      TranslateMessage(&msg);
      DispatchMessage(&msg);
    //}
  }
  
  delete frame;
  _CrtDumpMemoryLeaks();

  return msg.wParam;
}
Exemple #15
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;
};
Exemple #16
0
MdispQtApp::MdispQtApp( int& argc, char** argv )
    : QApplication( argc, argv )
    , m_isCurrentlyHookedOnErrors(false)
    , m_ErrorEventSemaphore(1)
    , m_CreatorThread( QThread::currentThreadId() )
{
    // Set semaphore to initial state (no error event available).
    m_ErrorEventSemaphore.acquire();

    // Allocate an application and system [CALL TO MIL]
    MappAllocDefault(M_DEFAULT, &m_MilApplication, &m_MilSystem, M_NULL, M_NULL, M_NULL);

    // Hook MIL error on function DisplayError() [CALL TO MIL]
    MappHookFunction(M_ERROR_CURRENT,DisplayErrorExt,M_NULL);

    m_isCurrentlyHookedOnErrors = true;

    // Disable MIL error message to be displayed as the usual way [CALL TO MIL]
    MappControl(M_ERROR,M_PRINT_DISABLE);

    // Inquire number of digitizers available on the system [CALL TO MIL]
    MsysInquire(m_MilSystem,M_DIGITIZER_NUM,&m_numberOfDigitizer);

    // Digitizer is available
    if (m_numberOfDigitizer)
    {
        // Allocate a digitizer [CALL TO MIL]
        MdigAlloc(m_MilSystem,M_DEFAULT,M_CAMERA_SETUP,M_DEFAULT,&m_MilDigitizer);

        // Stop live grab when window is disable [CALL TO MIL]
        //TBM MIL 8.0 MsysControl(MilSystem,M_STOP_LIVE_GRAB_WHEN_DISABLED,M_ENABLE);

        // Inquire digitizer informations [CALL TO MIL]
        MdigInquire(m_MilDigitizer,M_SIZE_X,&m_digitizerSizeX);
        MdigInquire(m_MilDigitizer,M_SIZE_Y,&m_digitizerSizeY);
        MdigInquire(m_MilDigitizer,M_SIZE_BAND,&m_digitizerNbBands);

        if (m_digitizerSizeX > M_DEF_IMAGE_SIZE_X_MAX)
            m_digitizerSizeX = M_DEF_IMAGE_SIZE_X_MAX;
        if (m_digitizerSizeY > M_DEF_IMAGE_SIZE_Y_MAX)
            m_digitizerSizeY = M_DEF_IMAGE_SIZE_Y_MAX;
    }
    // Digitizer is not available
    else
    {
        m_MilDigitizer = 0;
        m_digitizerNbBands  =   M_DEF_IMAGE_NUMBANDS_MIN;
    }


    // Initialize the state of the grab
    m_isGrabStarted = FALSE;

    // Initialize GUI
    MainFrame* mf = new MainFrame();
    //setMainWidget(mf);

    mf->show();

}
Exemple #17
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;
	}
}
Exemple #18
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;
}
Exemple #19
0
bool TimeApp::OnInit(){

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

	return true;
}
Exemple #20
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;
}
Exemple #21
0
MdispGtkApp::MdispGtkApp()
   {
   m_isCurrentlyHookedOnErrors = false;
   InitInstance();
   
   MainFrame* mf = new MainFrame();
   g_object_set_data(G_OBJECT(mf->MainWindow()),"App",(void *)this);
   }
Exemple #22
0
void CLeftTree::OnSelectChanged( wxTreeEvent& event )
{
    wxTreeItemId id = event.GetItem();
    CLeftTreeItemData *pdata = ( CLeftTreeItemData* ) GetItemData( id );
    MainFrame *mf = ( MainFrame * ) ( GetParent() ->GetParent() );
    mf->OnSelectType( pdata->GetData() );
    event.Skip();	//???
}
int VACA_MAIN()
{
  Application app;
  MainFrame frm;
  frm.setVisible(true);
  app.run();
  return 0;
}
Exemple #24
0
void GL3DScales::OnVelocityScale(int pos)
{
	MainFrame* pMainFrame = (MainFrame*)s_pMainFrame;
	QSail7 *pSail7 = (QSail7*)s_pSail7;
	s_VelocityScale    = pos/100.0/sqrt(1.01-pos/100.0);
	pSail7->m_bResetglDownwash = true;
	pMainFrame->UpdateView();
}
Exemple #25
0
bool MainApp::OnInit()
{
    MainFrame *frame = new MainFrame(wxT("Process RealTime Control "));

    frame->Show(true);

    return true;
}
Exemple #26
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;
}
Exemple #27
0
void RenderFrame::OnClose(wxCloseEvent& WXUNUSED(event))
{
	/* unchecks option in the main frame */
	MainFrame* mainFrame = (MainFrame*)this->GetParent();
	mainFrame->CheckWindowMenu(ShowRenderViewMenu, false);
	
	this->Hide();
}
Exemple #28
0
int main(int argc, char **argv)
{
    QApplication app(argc, argv);

    MainFrame frame;
    frame.show();

    return app.exec();
}
Exemple #29
0
int VACA_MAIN()
{
  Application app;
  MainFrame frm;
  frm.setIcon(ResourceId(IDI_VACA));
  frm.setVisible(true);
  app.run();
  return 0;
}
bool HoverMoveFilter::eventFilter(QObject *obj, QEvent *event)
{
    if (event->type() == QEvent::HoverMove) {
        QHoverEvent *mouseHoverEvent = static_cast<QHoverEvent *>(event);
        MainFrame* frame = static_cast<MainFrame *>(obj);
        frame->mouseMove(mouseHoverEvent->pos(), mouseHoverEvent->oldPos());
    }
    return QObject::eventFilter(obj, event);
}