Multi-view of a single document in VC
Document and view belong to the observer in design mode. How do I control the moving range of split entries after split windows ?? Train of Thought:
1. Create a cmysplitter class. The base class is csplitterwnd.
2. The onmousemove function of this class is reloaded:
Void cmysplitter: onmousemove (uint nflags, cpoint point)
{
// Restrict the movement range of the shard.
If (point. x <228 | point. x> 600)
{
Cwnd: onmousemove (nflags, point );
}
Else
{
Csplitterwnd: onmousemove (nflags, point );
}
}
3. Then we can split it into normal windows. If (point. x <228 | point. x> 600) the range here can be set as you like.
Iv. Split Window
The splitting window does not need to be detailed. Create a splitting object in maifram. h:
Protected:
Cmysplitter m_wndsplitter; // split the window object
// Implement window splitting in maifram. cpp:
Bool cmainframe: oncreateclient (lpcreatestruct/* lpcs */, ccreatecontext * pcontext)
{
// Create a splitter window
If (! M_wndsplitter.createstatic (this, 1, 2 ))
Return false;
If (! M_wndsplitter.createview (0, 0, runtime_class (cleftview), csize (228,100), pcontext) |
! M_wndsplitter.createview (0, 1, runtime_class (cdataeditview), csize (100,100), pcontext ))
{
M_wndsplitter.destroywindow ();
Return false;
}
Return true;
}