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


C++ Workspace::GetOpenGLContext方法代码示例

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


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

示例1: OnOpenClick

void MainFrame::OnOpenClick(wxRibbonButtonBarEvent& event)
{
    wxFileDialog openFileDialog(this, _("Open PSP file"), "", "", "PSP files (*.psp)|*.psp",
                                wxFD_OPEN | wxFD_FILE_MUST_EXIST);
    if(openFileDialog.ShowModal() == wxID_CANCEL) return;

    wxFileName fileName(openFileDialog.GetPath());

    EnableCurrentProjectRibbon();
    Workspace* newWorkspace = new Workspace(this, _("Open project"), this->GetStatusBar(), m_sharedGLContext);
    if(!m_sharedGLContext) m_sharedGLContext = newWorkspace->GetOpenGLContext();

    FileHanding fileHandling(newWorkspace);
    if(fileHandling.OpenProject(fileName)) {
        newWorkspace->SetSavedPath(fileName);

        m_workspaceList.push_back(newWorkspace);

        m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_DISABLESOL, true);
        m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_ENABLESOL, false);

        m_auiNotebook->AddPage(newWorkspace, newWorkspace->GetName(), true);
        m_auiNotebook->Layout();
        newWorkspace->Redraw();
        newWorkspace->SetJustOpened(true);
        newWorkspace->Fit();
        m_projectNumber++;
    } else {
        wxMessageDialog msgDialog(this, _("It was not possible to open the selected file."), _("Error"),
                                  wxOK | wxCENTRE | wxICON_ERROR);
        msgDialog.ShowModal();
        delete newWorkspace;
    }
}
开发者ID:Thales1330,项目名称:PSP,代码行数:34,代码来源:MainFrame.cpp

示例2: fileHandling

MainFrame::MainFrame(wxWindow* parent, wxLocale* locale, PropertiesData* initProperties, wxString openPath)
    : MainFrameBase(parent)
{
    m_locale = locale;
    m_generalProperties = initProperties;

    Init();

    if(openPath != "") {
        EnableCurrentProjectRibbon();
        Workspace* newWorkspace = new Workspace(this, _("Open project"), this->GetStatusBar(), m_sharedGLContext);
        if(!m_sharedGLContext) m_sharedGLContext = newWorkspace->GetOpenGLContext();

        FileHanding fileHandling(newWorkspace);
        if(fileHandling.OpenProject(openPath)) {
            newWorkspace->SetSavedPath(openPath);

            m_workspaceList.push_back(newWorkspace);

            m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_DISABLESOL, true);
            m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_ENABLESOL, false);

            m_auiNotebook->AddPage(newWorkspace, newWorkspace->GetName(), true);
            m_auiNotebook->Layout();
            newWorkspace->Redraw();
            newWorkspace->SetJustOpened(true);
            newWorkspace->Fit();
            m_projectNumber++;
        }
    }
}
开发者ID:Thales1330,项目名称:PSP,代码行数:31,代码来源:MainFrame.cpp

示例3: OnNewClick

void MainFrame::OnNewClick(wxRibbonButtonBarEvent& event)
{
    EnableCurrentProjectRibbon();

    Workspace* newWorkspace = new Workspace(this, wxString::Format(_("New project %d"), m_projectNumber),
                                            this->GetStatusBar(), m_sharedGLContext);
    if(!m_sharedGLContext) m_sharedGLContext = newWorkspace->GetOpenGLContext();
    m_workspaceList.push_back(newWorkspace);

    m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_DISABLESOL, true);
    m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_ENABLESOL, false);

    m_auiNotebook->AddPage(newWorkspace, newWorkspace->GetName(), true);
    newWorkspace->Redraw();
    m_projectNumber++;
}
开发者ID:Thales1330,项目名称:PSP,代码行数:16,代码来源:MainFrame.cpp

示例4: OnImportClick

void MainFrame::OnImportClick(wxRibbonButtonBarEvent& event)
{
    // Create a new workspace to import
    Workspace* impWorkspace = new Workspace(this, _("Imported project"), this->GetStatusBar(), m_sharedGLContext);
    ImportForm importForm(this, impWorkspace);
    if(importForm.ShowModal() == wxID_OK) {
        // Import file(s)
        EnableCurrentProjectRibbon();

        if(!m_sharedGLContext) m_sharedGLContext = impWorkspace->GetOpenGLContext();
        m_workspaceList.push_back(impWorkspace);

        m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_DISABLESOL, true);
        m_ribbonButtonBarContinuous->ToggleButton(ID_RIBBON_ENABLESOL, false);

        m_auiNotebook->AddPage(impWorkspace, impWorkspace->GetName(), true);
        m_auiNotebook->Layout();
        impWorkspace->Redraw();
        impWorkspace->SetJustOpened(true);
        impWorkspace->Fit();
        m_projectNumber++;
    }
}
开发者ID:Thales1330,项目名称:PSP,代码行数:23,代码来源:MainFrame.cpp


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