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


C++ CBOINCBaseFrame::Show方法代码示例

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


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

示例1: AutoRestart

bool CBOINCClientManager::AutoRestart() {
    double timeNow, timeDiff;
    if (IsBOINCCoreRunning()) return true;
#if ! (defined(__WXMAC__) || defined(__WXMSW__)) 
// Mac and Windows can restart Client as a daemon, but 
// Linux may not know Client's location if it didn't start the Client
    if (!m_bBOINCStartedByManager) return false;
#endif
    // Alert user if Client crashes 3 times in CLIENT_3_CRASH_MAX_TIME
    timeNow = dtime();
    timeDiff = timeNow - m_fAutoRestart1Time;
    if ((timeDiff) < (CLIENT_3_CRASH_MAX_TIME * 60)) {
        int                 response;
        ClientCrashDlg      *dlg = new ClientCrashDlg(timeDiff);
        if (dlg) {
            CBOINCBaseFrame* pFrame = wxGetApp().GetFrame();
            if (!pFrame->IsShown()) {
                pFrame->Show();
            }
            response = dlg->ShowModal();
            dlg->Destroy();
            if (response == wxID_CANCEL) return false;
            timeNow = 0;
            m_fAutoRestart1Time = 0;
            m_fAutoRestart2Time = 0;
        }
    }
    m_lBOINCCoreProcessId = 0;
    m_fAutoRestart1Time = m_fAutoRestart2Time;
    m_fAutoRestart2Time = timeNow;
    StartupBOINCCore();
    return true;
}
开发者ID:Ashod,项目名称:Boinc,代码行数:33,代码来源:BOINCClientManager.cpp

示例2: SetActiveGUI

bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
    CBOINCBaseFrame* pNewFrame = NULL;
    CBOINCBaseFrame* pOldFrame = m_pFrame;
    wxInt32          iTop = 0;
    wxInt32          iLeft = 0;
    wxInt32          iHeight = 0;
    wxInt32          iWidth = 0;


    // Create the new window
    if ((iGUISelection != m_iGUISelected) || !m_pFrame) {

        // Reterieve the desired window state before creating the
        //   desired frames
        if (BOINC_ADVANCEDGUI == iGUISelection) {
            m_pConfig->SetPath(wxT("/"));
            m_pConfig->Read(wxT("YPos"), &iTop, 30);
            m_pConfig->Read(wxT("XPos"), &iLeft, 30);
            m_pConfig->Read(wxT("Width"), &iWidth, 800);
            m_pConfig->Read(wxT("Height"), &iHeight, 600);
        } else {
            m_pConfig->SetPath(wxT("/Simple"));
            m_pConfig->Read(wxT("YPos"), &iTop, 30);
            m_pConfig->Read(wxT("XPos"), &iLeft, 30);
#ifdef __WXMAC__
            m_pConfig->Read(wxT("Width"), &iWidth, 409);
            m_pConfig->Read(wxT("Height"), &iHeight, 561);
#else
            m_pConfig->Read(wxT("Width"), &iWidth, 416);
            m_pConfig->Read(wxT("Height"), &iHeight, 570);
#endif
        }


        // Make sure that the new window is going to be visible
        //   on a screen
#ifdef __WXMAC__
        Rect titleRect = {iTop, iLeft, iTop+22, iLeft+iWidth };
        InsetRect(&titleRect, 5, 5);                // Make sure at least a 5X5 piece visible
        RgnHandle displayRgn = NewRgn();
        CopyRgn(GetGrayRgn(), displayRgn);          // Region encompassing all displays
        Rect menuRect = ((**GetMainDevice())).gdRect;
        menuRect.bottom = GetMBarHeight() + menuRect.top;
        RgnHandle menuRgn = NewRgn();
        RectRgn(menuRgn, &menuRect);                // Region hidden by menu bar
        DiffRgn(displayRgn, menuRgn, displayRgn);   // Subtract menu bar retion
        if (!RectInRgn(&titleRect, displayRgn))
            iTop = iLeft = 30;
        DisposeRgn(menuRgn);
        DisposeRgn(displayRgn);
#else
	    // If either co-ordinate is less then 0 then set it equal to 0 to ensure
	    // it displays on the screen.
	    if ( iLeft < 0 ) iLeft = 30;
	    if ( iTop < 0 ) iTop = 30;

	    // Read the size of the screen
	    wxInt32 iMaxWidth = wxSystemSettings::GetMetric( wxSYS_SCREEN_X );
	    wxInt32 iMaxHeight = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );

	    // Max sure that it doesn't go off to the right or bottom
	    if ( iLeft + iWidth > iMaxWidth ) iLeft = iMaxWidth - iWidth;
	    if ( iTop + iHeight > iMaxHeight ) iTop = iMaxHeight - iHeight;
#endif

        // Create the main window
        //
        if (BOINC_ADVANCEDGUI == iGUISelection) {
            // Initialize the advanced gui window
            pNewFrame = new CAdvancedFrame(
                m_pSkinManager->GetAdvanced()->GetApplicationName(), 
                m_pSkinManager->GetAdvanced()->GetApplicationIcon(),
                m_pSkinManager->GetAdvanced()->GetApplicationIcon32(),
                wxPoint(iLeft, iTop),
                wxSize(iWidth, iHeight)
            );
        } else {
            // Initialize the simple gui window
            pNewFrame = new CSimpleFrame(
                m_pSkinManager->GetAdvanced()->GetApplicationName(), 
                m_pSkinManager->GetAdvanced()->GetApplicationIcon(),
                m_pSkinManager->GetAdvanced()->GetApplicationIcon32(),
                wxPoint(iLeft, iTop),
                wxSize(iWidth, iHeight)
            );
        }

        wxASSERT(pNewFrame);

        if (pNewFrame) {
            SetTopWindow(pNewFrame);

            // Store the new frame for future use
            m_pFrame = pNewFrame;

            // Hide the old one if it exists.  We must do this 
            // after updating m_pFrame to prevent Mac OSX from
            // hiding the application
            if (pOldFrame) pOldFrame->Hide();

//.........这里部分代码省略.........
开发者ID:vertexclique,项目名称:playground,代码行数:101,代码来源:BOINCGUIApp.cpp


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