当前位置: 首页>>代码示例>>C++>>正文


C++ MainFrame类代码示例

本文整理汇总了C++中MainFrame的典型用法代码示例。如果您正苦于以下问题:C++ MainFrame类的具体用法?C++ MainFrame怎么用?C++ MainFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MainFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MainFrame

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;
}
开发者ID:huangyt,项目名称:FLOW,代码行数:31,代码来源:fwServer.cpp

示例2: OnDropFiles

bool DnDFile::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
{
	MainFrame * frame = (MainFrame *)parent;
	frame->ChangeFile(filenames[0]);
	
	return true;
}
开发者ID:Dberko,项目名称:dmgboy,代码行数:7,代码来源:RendererBase.cpp

示例3: Run

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;
}
开发者ID:vividos,项目名称:RemotePhotoTool,代码行数:26,代码来源:App.cpp

示例4: WXUNUSED

// 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);
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:28,代码来源:powertabtuningview.cpp

示例5: WXUNUSED

// 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);
}
开发者ID:BackupTheBerlios,项目名称:ptparser-svn,代码行数:30,代码来源:powertabview.cpp

示例6: MainFrame

bool MyApp::OnInit()
{
	MainFrame *frame = new MainFrame(NULL);
    frame->SetIcon(wxICON(datcom)); // To Set App Icon
    frame->Show();
	return true;
}
开发者ID:guneysu-arsiv,项目名称:wxdatcom,代码行数:7,代码来源:Main.cpp

示例7: WinMain

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;
}
开发者ID:corytodd,项目名称:WindowsPrinterDriver,代码行数:26,代码来源:main.cpp

示例8: SetVendorName

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;
}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:35,代码来源:app.cpp

示例9: MainFrame

bool YmgyrchApp::OnInit()
{
	MainFrame *frame = new MainFrame(0);
	frame->Show(TRUE);
	SetTopWindow(frame);
	return true;
}
开发者ID:Lionel07,项目名称:Ymgyrch,代码行数:7,代码来源:YmgyrchApp.cpp

示例10: Enable3dControls

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;
}
开发者ID:KnowNo,项目名称:test-code-backup,代码行数:35,代码来源:qtmfc.cpp

示例11: MainFrame

/**
 * @return bool
 */
bool MainApp::OnInit()
{
  MainFrame* mainFrame = new MainFrame(_T("EGF Editor"));
  mainFrame->Show();

  return true;
}
开发者ID:is06,项目名称:egf-editor,代码行数:10,代码来源:MainApp.cpp

示例12: xsProperty

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;
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:27,代码来源:StaticSettingsSample.cpp

示例13: main

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainFrame w;
    w.show();
    return a.exec();
}
开发者ID:devbian,项目名称:qt_simu360,代码行数:7,代码来源:main.cpp

示例14: WinMain

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;
}
开发者ID:francislr,项目名称:dkc2-maps,代码行数:25,代码来源:main.cpp

示例15: wxInitAllImageHandlers

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;
};
开发者ID:simlabrobotics,项目名称:sq1_windows,代码行数:28,代码来源:sQ1App.cpp


注:本文中的MainFrame类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。