Home > Software engineering >  MFC dynamic split window
MFC dynamic split window

Time:10-11

Demand looks something like this:
Generate a single document view, click on the right in the view menu, point the menu "split" after the current view in two, right click on one piece of view again "split", the selected this view again points 2, request can split, and within the view can display object properties, such as news, weather, and so on these properties, currently only static split window, inside the OnCreateClient split view,
For the great god can show ideas of how to implement dynamic split view,


The code is as follows:
BOOL CMainFrame: : OnCreateClient (LPCREATESTRUCT, CCreateContext * pContext)
{//create a static column window, can be divided into three lines a list
If (m_wndSplitter1. CreateStatic (this, 3, 1)==NULL)
return FALSE;

//connect the CCuteFTPView row 0 0 column pane
M_wndSplitter1. CreateView (0, 0, RUNTIME_CLASS (CWorkView), CSize (100, 100), pContext);
M_wndSplitter1. CreateView (2, 0, RUNTIME_CLASS (CWorkAppViem), CSize (100, 100), pContext);//connect CView4 row 2 column 0

If (m_wndSplitter2. CreateStatic (& amp; M_wndSplitter1, 1, 2, WS_CHILD | WS_VISIBLE, m_wndSplitter1. IdFromRowCol (1, 0))==NULL)
return FALSE;//separate line 1 0 column and row 2 column
1
//connect CView2 class to the second column column object row 0 0
M_wndSplitter2. CreateView (0, 0, RUNTIME_CLASS (CWorkAppViem), CSize (400, 300), pContext);//objects connected to the second column will CView3 class 0 line 1 list
M_wndSplitter2. CreateView (0, 1, RUNTIME_CLASS (CWorkAppViem), CSize (400, 300), pContext);
Return TRUE;
}

CodePudding user response:

Pray god to guide!!!!!!!!!!

CodePudding user response:

Put static split in the menu command response

CodePudding user response:

Back to the second floor:
Can you say the detailed point? Had better add some code,

CodePudding user response:

http://download.csdn.net/detail/qq_23992597/9223327

CodePudding user response:

According to the static segmentation like you first, will the rest of the width and height of the window is set to 0, and then click the button to restore the original after the width and height size

CodePudding user response:

reference 5 floor bigtree_mfc reply:
static segmentation according to you first, will the rest of the width and height of the window is set to 0, and then click the button to restore the original width and height after size

This kind of practice is to make sure of the specific circumstances? To support my window can be split up and down, and can control division,

CodePudding user response:

"Another (Yet another) dynamic segmentation of demo window, only a CSplitterWnd m_wndSplitter; Instances do not use nested CreateStatic dynamic change window number 0 4-trichlorobenzene, 6 USES CEditView
"http://download.csdn.net/detail/schlafenhamster/3463284

CodePudding user response:

refer to 6th floor raining9590 response:
Quote: refer to the fifth floor bigtree_mfc reply:

According to the static segmentation like you first, will the rest of the width and height of the window is set to 0, and then click the button to restore the original width and height after size

This kind of practice is to make sure of the specific circumstances? To support my window can be split up and down, and can control division,

A dynamic setting the width and height of each window

CodePudding user response:

http://bbs.csdn.net/topics/391963864

See this post with the building problems,

The solution is to dynamically generate CSplitterWnd
  • Related