newntui/discovermdi/src/errorsbrowser.cpp
//---------------------------------------------------------------------------------
// Callback runs every time  sash changed it's position.
// We need to resize our dockable window, position all controls in it and update
// our sash position.
//---------------------------------------------------------------------------------
Callback runs every time  sash changed it's position.
We need to resize our dockable window, position all controls in it and update
our sash position.
Callback runs every time sash changed it ' s position . We need to resize our dockable window position all controls in it and update our sash position .
LRESULT CErrorsBrowser::OnSashMoved(WPARAM wparam, LPARAM lparam) {
CRect winRect;
CRect sashRect;
int x = wparam;
int y= lparam;
    GetWindowRect(&winRect);
    switch(GetDockSide()) {
	    case DOCK_LEFT : m_RightSash.GetWindowRect(&sashRect);
			             m_sizeDefault.cx=x+(sashRect.left-winRect.left)+6;
			             break;
	    case DOCK_RIGHT: m_LeftSash.GetWindowRect(&sashRect);
			             m_sizeDefault.cx=(winRect.right-sashRect.right)-x+6;
			             break;
	    case DOCK_TOP :  m_BottomSash.GetWindowRect(&sashRect);
			             m_sizeDefault.cy=y+(sashRect.top-winRect.top)+6;
			             break;
	    case DOCK_BOTTOM:m_TopSash.GetWindowRect(&sashRect);
			             m_sizeDefault.cy=(winRect.bottom-sashRect.bottom)-y+6;
			             break;
	}
    SetControlsPos();
	PositionSashBars();
    GetDockingFrame()->RecalcLayout(); 
	Invalidate();
	return TRUE;
}
LRESULT CErrorsBrowser :: OnSashMoved ( WPARAM wparam , LPARAM lparam ) { CRect winRect ; CRect sashRect ; int x = wparam ; int y = lparam ; GetWindowRect ( & winRect ) ; switch ( GetDockSide ( ) ) { case DOCK_LEFT : m_RightSash . GetWindowRect ( & sashRect ) ; m_sizeDefault . cx = x + ( sashRect . left - winRect . left ) + 6 ; break ; case DOCK_RIGHT : m_LeftSash . GetWindowRect ( & sashRect ) ; m_sizeDefault . cx = ( winRect . right - sashRect . right ) - x + 6 ; break ; case DOCK_TOP : m_BottomSash . GetWindowRect ( & sashRect ) ; m_sizeDefault . cy = y + ( sashRect . top - winRect . top ) + 6 ; break ; case DOCK_BOTTOM : m_TopSash . GetWindowRect ( & sashRect ) ; m_sizeDefault . cy = ( winRect . bottom - sashRect . bottom ) - y + 6 ; break ; } SetControlsPos ( ) ; PositionSashBars ( ) ; GetDockingFrame ( ) -> RecalcLayout ( ) ; Invalidate ( ) ; return TRUE ; }
Callback runs every time  sash changed it's position.
Callback runs every time sash changed it ' s position .
// Calculating new window sizes from the nes sash position // Setting new position for the sash bar // Re-calculating frame window dockables layout.