• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            新年第一貼

            Posted on 2009-01-15 01:10 linnet 閱讀(452) 評論(0)  編輯 收藏 引用
            學習一下vc9中CSplitterWnd創(chuàng)建視圖的方式
             
            // You must create ALL panes unless DYNAMIC_SPLIT is defined!
            //  Usually the splitter window is invisible when creating a pane
            BOOL CSplitterWnd::CreateView(int row, int col, CRuntimeClass* pViewClass, SIZE sizeInit, CCreateContext* pContext)
            {
            #ifdef _DEBUG
                ASSERT_VALID(this);
                ASSERT(row >= 0 && row < m_nRows);
                ASSERT(col >= 0 && col < m_nCols);
                ASSERT(pViewClass != NULL);
                ASSERT(pViewClass->IsDerivedFrom(RUNTIME_CLASS(CWnd)));
                ASSERT(AfxIsValidAddress(pViewClass, sizeof(CRuntimeClass), FALSE));

                if (GetDlgItem(IdFromRowCol(row, col)) != NULL)
                {
                    TRACE(traceAppMsg, 0, "Error: CreateView - pane already exists for row %d, col %d.\n",
                        row, col);
                    ASSERT(FALSE);
                    return FALSE;
                }
            #endif

                // set the initial size for that pane
                m_pColInfo[col].nIdealSize = sizeInit.cx;
                m_pRowInfo[row].nIdealSize = sizeInit.cy;

                BOOL bSendInitialUpdate = FALSE;

                CCreateContext contextT;
                if (pContext == NULL)
                {
                    // if no context specified, generate one from the currently selected
                    //  client if possible
                    CView* pOldView = (CView*)GetActivePane();
                    if (pOldView != NULL && pOldView->IsKindOf(RUNTIME_CLASS(CView)))
                    {
                        // set info about last pane
                        ASSERT(contextT.m_pCurrentFrame == NULL);
                        contextT.m_pLastView = pOldView;
                        contextT.m_pCurrentDoc = pOldView->GetDocument();
                        if (contextT.m_pCurrentDoc != NULL)
                            contextT.m_pNewDocTemplate =
                              contextT.m_pCurrentDoc->GetDocTemplate();
                    }
                    pContext = &contextT;
                    bSendInitialUpdate = TRUE;
                }

                CWnd* pWnd;
                TRY
                {
                    pWnd = (CWnd*)pViewClass->CreateObject();
                    if (pWnd == NULL)
                        AfxThrowMemoryException();
                }
                CATCH_ALL(e)
                {
                    TRACE(traceAppMsg, 0, "Out of memory creating a splitter pane.\n");
                    // Note: DELETE_EXCEPTION(e) not required
                    return FALSE;
                }
                END_CATCH_ALL

                ASSERT_KINDOF(CWnd, pWnd);
                ASSERT(pWnd->m_hWnd == NULL);       // not yet created

                DWORD dwStyle = AFX_WS_DEFAULT_VIEW & ~WS_BORDER;

                // Create with the right size (wrong position)
                CRect rect(CPoint(0,0), sizeInit);
                if (!pWnd->Create(NULL, NULL, dwStyle,
                    rect, this, IdFromRowCol(row, col), pContext))
                {
                    TRACE(traceAppMsg, 0, "Warning: couldn't create client pane for splitter.\n");
                        // pWnd will be cleaned up by PostNcDestroy
                    return FALSE;
                }
                ASSERT((int)_AfxGetDlgCtrlID(pWnd->m_hWnd) == IdFromRowCol(row, col));

                // send initial notification message
                if (bSendInitialUpdate)
                    pWnd->SendMessage(WM_INITIALUPDATE);

                return TRUE;
            }


             tools
            日韩久久久久久中文人妻| 久久一区二区免费播放| 久久久久99精品成人片欧美| 久久久老熟女一区二区三区| 99热都是精品久久久久久| 亚洲伊人久久成综合人影院 | 精品国产乱码久久久久久浪潮| 久久夜色精品国产亚洲av| 久久精品天天中文字幕人妻 | 精品视频久久久久| 亚洲精品乱码久久久久久按摩| 高清免费久久午夜精品| 亚洲精品午夜国产va久久| 99国产欧美精品久久久蜜芽| 日韩十八禁一区二区久久| 国产精品18久久久久久vr | 色欲久久久天天天综合网精品| 国产精品99久久久久久董美香| 国内精品人妻无码久久久影院导航| 伊人久久大香线蕉精品| 亚洲av成人无码久久精品| 欧美性猛交xxxx免费看久久久| 国产日产久久高清欧美一区| 久久综合久久美利坚合众国| 久久狠狠一本精品综合网| 99国产精品久久久久久久成人热| 一级女性全黄久久生活片免费| 国产精品久久久久久久午夜片| 国内精品久久人妻互换| 日日躁夜夜躁狠狠久久AV| 久久天天躁狠狠躁夜夜不卡| 日本加勒比久久精品| 久久99亚洲综合精品首页| 伊人色综合久久| 国产免费福利体检区久久| 国产精品久久永久免费| 国产一区二区三区久久| 日本免费一区二区久久人人澡| 久久99免费视频| 办公室久久精品| 久久综合九色欧美综合狠狠 |