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


C++ MainFrame::AutoOpenLastProject方法代码示例

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


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

示例1: OnInit

bool MainApp::OnInit()
{

    UINT openFilesMessage = RegisterWindowMessage("Decoda_OpenFiles");

    // Check to see if another instances is running.

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

    wxImage::AddHandler(new wxXPMHandler);
    wxImage::AddHandler(new wxPNGHandler);

    MainFrame* frame = new MainFrame("Script Debugger", openFilesMessage, wxDefaultPosition, wxSize(1024,768));

    HWND hWndPrev = m_singleInstance.Connect(reinterpret_cast<HWND>(frame->GetHandle()), "Decoda");

    // If we're loading files from the command line (but not a project) file,
    // then don't create a new instance. This happens when the user double clicks
    // in Explorer.
    if (hWndPrev != NULL && m_loadProjectName.IsEmpty() && m_debugExe.IsEmpty() && m_loadFileNames.Count() > 0)
    {

        // Send the command line to the other window.

        wxString fileNames;

        for (unsigned int i = 0; i < m_loadFileNames.Count(); ++i)
        {
            fileNames += m_loadFileNames[i] + ";";
        }

        m_singleInstance.SetCommand(fileNames);
        PostMessage(hWndPrev, openFilesMessage, 0, 0);

        // Show the other window.
        SetForegroundWindow(hWndPrev);
        
        delete frame;
        return false;

    }

    frame->ApplyWindowPlacement();

    // If a project was specified, open it.
    if (!m_loadProjectName.IsEmpty())
    {
        frame->OpenProject(m_loadProjectName);
    }

    // Load any files that were specified on the command line.
    frame->OpenDocuments(m_loadFileNames);

    // Tell the UI to load the last project if we haven't instructed.
    // it to load anything else.

    if (m_loadProjectName.IsEmpty() && m_loadFileNames.IsEmpty())
    {
        frame->AutoOpenLastProject();        
    }

    m_loadProjectName.Clear();
    m_loadFileNames.Clear();

    frame->CheckForUpdate();

    if (!m_debugExe.IsEmpty())
    {
        frame->DebugExe(m_debugExe);
    }

    return true;

}
开发者ID:AlexHayton,项目名称:decoda,代码行数:77,代码来源:MainApp.cpp


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