• <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
            欧美久久一级内射wwwwww.| 亚洲精品乱码久久久久久蜜桃 | 亚洲欧美日韩精品久久| 精品久久久久久综合日本| 国产日韩欧美久久| 久久天天躁夜夜躁狠狠| 国内精品久久久久久久97牛牛| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久久久四虎国产精品| 午夜精品久久久久9999高清| 国内精品综合久久久40p| 亚洲精品乱码久久久久久| 99久久精品毛片免费播放| 久久久噜噜噜久久中文字幕色伊伊| 久久久无码精品亚洲日韩蜜臀浪潮| 久久精品国产精品亚洲毛片| 无码任你躁久久久久久| 久久97精品久久久久久久不卡| 四虎久久影院| 精品久久久久久无码人妻蜜桃| 精品久久人妻av中文字幕| 久久精品国产精品亚洲艾草网美妙| 久久久久亚洲av无码专区| 香蕉99久久国产综合精品宅男自| 99久久精品免费看国产一区二区三区| 日韩av无码久久精品免费| 久久精品免费全国观看国产| 国产成人精品综合久久久| 久久久精品免费国产四虎| 久久久精品人妻一区二区三区四 | 国产美女久久精品香蕉69| 精品久久久久久无码不卡| 亚洲人成无码www久久久| 久久免费视频6| 久久久午夜精品福利内容| 午夜视频久久久久一区| 午夜福利91久久福利| 亚洲性久久久影院| 久久婷婷五月综合97色直播| 亚洲精品美女久久777777| 久久青青草原精品国产|