Improve the separation window control of wtl (Supplement)

Source: Internet
Author: User

Last month, I wrote an article about improved windows Separation Control for wtl. This article supplements and improves this article.

In the article Improving the separation window control of wtl, we modified the csplitterwindow of wtl to implement the following changes. That is, the two subpanel windows of the separation window can be the controls in the dialog box window, you do not need to set the parent windows of the two controls as separate windows. However, we find that if you use the cpanecontainer control or the sub-dialog window as the sub-panel, you must set the parent window as the separation window in the cpanecontainer or dialog window. Modify the code of the separation window to improve this. After modification, the parent window of the cpanecontainer control or subdialog box window is the Child Window of the dialog box where the separation window is located. The Code is as follows:

Void updatesplitterlayout ()
...{
If (m_nsingtransferane = split_pane_none & m_xysplitterpos =-1)
Return;

T * PT = static_cast <t *> (this );
Rect =... {0, 0, 0, 0 };
If (m_nsingpolicane = split_pane_none)
...{
If (getsplitterbarrect (& rect ))
Pt-> invalidaterect (& rect );

For (INT npane = 0; npane <m_npanescount; npane ++)
...{
If (getsplitterpanerect (npane, & rect ))
...{
If (m_hwndpane [npane]! = NULL)
...{
DWORD dwflag = swp_nozorder;
Hwnd hwndparent =: getparent (m_hwndpane [npane]);
If (hwndparent! = Pt-> m_hwnd)
...{
Dwflag = 0;
Pt-> clienttoscreen (& rect );
Cwindow (hwndparent). screentoclient (& rect );
}
: Setwindowpos (m_hwndpane [npane], null, rect. Left, rect. Top, rect. Right-rect. Left, rect. Bottom-rect. Top, dwflag );
}
Else
Pt-> invalidaterect (& rect );
}
}
}
Else
...{
If (getsplitterpanerect (m_nsinglepane, & rect ))
...{
If (m_hwndpane [m_nsingtransferane]! = NULL)
...{
DWORD dwflag = swp_nozorder;
Hwnd hwndparent =: getparent (m_hwndpane [m_nsingpolicane]);
If (hwndparent! = Pt-> m_hwnd)
...{
Dwflag = 0;
Pt-> clienttoscreen (& rect );
Cwindow (hwndparent). screentoclient (& rect );
}
: Setwindowpos (m_hwndpane [m_nsinglepane], null, rect. Left, rect. Top, rect. Right-rect. Left, rect. Bottom-rect. Top, dwflag );
}
Else
Pt-> invalidaterect (& rect );
}
}
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.