靜態拆分視窗 三叉視窗

2021-05-23 22:59:45 字數 1483 閱讀 9932

1.首先在cmainfrm.h中定義2個csplitterwnd 的變數:

csplitterwnd m_wndsplitter1;

csplitterwnd m_wndsplitter2;

2.新增你要載入的3個子視窗的類class wizard ----add class-----新建基於cview的類cview1,cview2,cview3。

3.在cmainfrm.cpp中新增訊息響應函式oncreateclient。

4.bool cmainframe::oncreateclient(lpcreatestruct lpcs, ccreatecontext* pcontext)

int row = 500;

m_wndsplitter1.setrowinfo(0, row, 64);

m_wndsplitter1.setrowinfo(1, info_view_height, 64);

// add the first splitter pane

// which is a nested splitter with 2 columns

if (!m_wndsplitter2.createstatic(

&m_wndsplitter1,     // our parent window is the first splitter

1, 2,               // the new splitter is 2 rows, 1 column

ws_child | ws_visible | ws_border,  // style, ws_border is needed

m_wndsplitter1.idfromrowcol(0, 0)

// new splitter is in the first row, 2nd column of first splitter

))int column = 200;

m_wndsplitter2.setcolumninfo(0, column, 64);

m_wndsplitter2.setcolumninfo(1, column, 64);

// now create the two views inside the nested splitter

if (!m_wndsplitter2.createview(0, 0,

runtime_class(cview1), csize(column, row), pcontext))

if (!m_wndsplitter2.createview(0, 1,

runtime_class(cview2), csize(column, row), pcontext))

if (!m_wndsplitter1.createview(1, 0,

runtime_class(cview4), csize(column, row), pcontext))

return true;

} 即可生成上面2列,下面1列的三叉視窗介面!!

opengl mfc 靜態拆分視窗

參考 第一 對函式wglmakecurrent有乙個新的認識。使指定的顏色上下文 rendering context 成為當前執行緒正呼叫的地顏色上下文 rendering context 在該執行緒中的所有opengl呼叫命令都將被畫在被指定的hdc上。所以,你可以使用wglmakecurrent...

MFC中靜態拆分視窗

一 範例執行結果 二 具體實現步驟步驟 1 建立2個視窗類cselectview和cdisplayview,到時候負責往上圖1和2的位置顯示東西。2 主視窗中定義乙個切分視窗類的物件,通過物件進行拆分 csplitterwnd m spliter 切分視窗類物件 3 重寫主視窗oncreatecli...

建立拆分視窗

在mfc導航中 選擇了拆分視窗,但是執行時,還是單一視窗,這需要我們手動的過載函式oncreateclient lpcretestruct,ccreatecontext pcontext 來實現拆分,當然前提已經建立了基於cview的檢視 本例中為 cpathview 例項如下 首先在mainfrm...