newntui/discovermdi/src/dockablebrowser.cpp
//--------------------------------------------------------------------------------
// Paint will aloso update sashes positions if the docking stater changed.
//--------------------------------------------------------------------------------
Paint will aloso update sashes positions if the docking stater changed.
Paint will aloso update sashes positions if the docking stater changed .
void CDockableBrowser::OnPaint()  {
     CPaintDC dc(this);  
	 if(m_DockSide!=GetDockSide()) {
		 UpdateSashes(TRUE);
		 m_DockSide=GetDockSide();
	 }
	 switch(GetDockSide()) {
	       case DOCK_LEFT :  
	                      dc.Draw3dRect(  BORDER, 
		                                  HEADER/2-2, 
					                      m_sizeDefault.cx-2*BORDER-SASH_SPACE, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				                        );
	                      dc.Draw3dRect(  BORDER, 
		                                  HEADER/2+2, 
					                      m_sizeDefault.cx-2*BORDER-SASH_SPACE, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				            );
			                break;
	       case DOCK_RIGHT :  
	                      dc.Draw3dRect(  BORDER+SASH_SPACE, 
		                                  HEADER/2-2, 
					                      m_sizeDefault.cx-2*BORDER-SASH_SPACE, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				                        );
	                      dc.Draw3dRect(  BORDER+SASH_SPACE, 
		                                  HEADER/2+2, 
					                      m_sizeDefault.cx-2*BORDER-SASH_SPACE, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				            );
			                break;
	       case DOCK_TOP :  
	                      dc.Draw3dRect(  BORDER, 
		                                  HEADER/2-2, 
					                      m_sizeDefault.cx-2*BORDER, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				                        );
	                      dc.Draw3dRect(  BORDER, 
		                                  HEADER/2+2, 
					                      m_sizeDefault.cx-2*BORDER, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				            );
			                break;
	       case DOCK_BOTTOM :  
	                      dc.Draw3dRect(  BORDER, 
		                                  HEADER/2-2+SASH_SPACE, 
					                      m_sizeDefault.cx-2*BORDER, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				                        );
	                      dc.Draw3dRect(  BORDER, 
		                                  HEADER/2+2+SASH_SPACE, 
					                      m_sizeDefault.cx-2*BORDER, 
		                                  3, 
					                      GetSysColor(COLOR_3DHILIGHT),
					                      GetSysColor(COLOR_3DSHADOW)
				            );
			                break;
	   }
     m_OnSize=TRUE;
}
void CDockableBrowser :: OnPaint ( ) { CPaintDC dc ( this ) ; if ( m_DockSide != GetDockSide ( ) ) { UpdateSashes ( TRUE ) ; m_DockSide = GetDockSide ( ) ; } switch ( GetDockSide ( ) ) { case DOCK_LEFT : dc . Draw3dRect ( BORDER , HEADER / 2 - 2 , m_sizeDefault . cx - 2 * BORDER - SASH_SPACE , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; dc . Draw3dRect ( BORDER , HEADER / 2 + 2 , m_sizeDefault . cx - 2 * BORDER - SASH_SPACE , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; break ; case DOCK_RIGHT : dc . Draw3dRect ( BORDER + SASH_SPACE , HEADER / 2 - 2 , m_sizeDefault . cx - 2 * BORDER - SASH_SPACE , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; dc . Draw3dRect ( BORDER + SASH_SPACE , HEADER / 2 + 2 , m_sizeDefault . cx - 2 * BORDER - SASH_SPACE , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; break ; case DOCK_TOP : dc . Draw3dRect ( BORDER , HEADER / 2 - 2 , m_sizeDefault . cx - 2 * BORDER , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; dc . Draw3dRect ( BORDER , HEADER / 2 + 2 , m_sizeDefault . cx - 2 * BORDER , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; break ; case DOCK_BOTTOM : dc . Draw3dRect ( BORDER , HEADER / 2 - 2 + SASH_SPACE , m_sizeDefault . cx - 2 * BORDER , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; dc . Draw3dRect ( BORDER , HEADER / 2 + 2 + SASH_SPACE , m_sizeDefault . cx - 2 * BORDER , 3 , GetSysColor ( COLOR_3DHILIGHT ) , GetSysColor ( COLOR_3DSHADOW ) ) ; break ; } m_OnSize = TRUE ; }
Paint will aloso update sashes positions if the docking stater changed.
Paint will aloso update sashes positions if the docking stater changed .
/*CBrush bkgnd( GetSysColor(COLOR_3DLIGHT));
	 dc.FillRect(CRect(0,0,m_sizeDefault.cx,HEADER),&bkgnd);*/