• <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 閱讀(446) 評論(0)  編輯 收藏 引用
            學(xué)習(xí)一下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

            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            精品国产乱码久久久久软件| 欧美精品丝袜久久久中文字幕| 99久久国产亚洲综合精品| 一本久道久久综合狠狠躁AV| 中文字幕久久久久人妻| 国产精品美女久久久久网| 99久久综合狠狠综合久久| 亚洲综合久久久| avtt天堂网久久精品| 亚洲国产精品狼友中文久久久| 精品久久久久久国产| 伊人热人久久中文字幕| 久久久无码一区二区三区| 久久久久亚洲精品男人的天堂| 2021精品国产综合久久| 麻豆精品久久久久久久99蜜桃| 国产午夜精品久久久久九九| 亚洲级αV无码毛片久久精品 | 亚洲精品WWW久久久久久| 久久婷婷五月综合色奶水99啪| 久久国产免费| 国内精品久久久久影院日本| 亚洲精品乱码久久久久久 | 欧美午夜A∨大片久久 | 久久只这里是精品66| 久久久久久久国产免费看| 国产精品岛国久久久久| 久久精品夜夜夜夜夜久久| 欧洲精品久久久av无码电影| 久久久SS麻豆欧美国产日韩| 久久99热这里只频精品6| 久久久久亚洲av成人网人人软件 | 97久久久精品综合88久久| 久久久av波多野一区二区| 久久精品国产亚洲AV无码麻豆| 浪潮AV色综合久久天堂| 国产69精品久久久久777| 亚洲狠狠综合久久| 99热都是精品久久久久久| 欧美激情精品久久久久久| 久久久国产亚洲精品|