newntui/activex/groupscombo/src/groupscomboctl.cpp
//----------------------------------------------------------------------------------
// Callback runs every time WM_SIZE message comes to the control (When window 
// creating and when window changing it's size). Position ElementsList in the
// window. No need to position toolbar, it will be done automatically.
//----------------------------------------------------------------------------------
Callback runs every time WM_SIZE message comes to the control (When window
creating and when window changing it's size). Position ElementsList in the
window. No need to position toolbar, it will be done automatically.
Callback runs every time WM_SIZE message comes to the control ( When window creating and when window changing it ' s size ) . Position ElementsList in the window . No need to position toolbar it will be done automatically .
void CGroupsComboCtrl::OnSize(UINT nType, int cx, int cy)  {
CRect toolsRect;
	COleControl::OnSize(nType, cx, cy);
	if(m_ControlsEnable == TRUE) {
	   if(::IsWindow(m_OpTools)) {
		   m_OpTools.GetWindowRect(toolsRect);
		   m_OpTools.MoveWindow(0,cy-toolsRect.Height(),cx,toolsRect.Height());
	       if(::IsWindow(m_ElementsList)) {
		       m_ElementsList.MoveWindow(::GetSystemMetrics(SM_CYEDGE),::GetSystemMetrics(SM_CYEDGE),cx-2*::GetSystemMetrics(SM_CYEDGE),cy-2*::GetSystemMetrics(SM_CYEDGE)-toolsRect.Height(),TRUE);
		   }
	   } else {
	      if(::IsWindow(m_ElementsList)) {
		      m_ElementsList.MoveWindow(::GetSystemMetrics(SM_CYEDGE),::GetSystemMetrics(SM_CYEDGE),cx-2*::GetSystemMetrics(SM_CYEDGE),cy-2*::GetSystemMetrics(SM_CYEDGE),TRUE);
		  }
	   }
	} else {
	   m_ElementsList.MoveWindow(0,0,cx,cy,TRUE);
	}
}
void CGroupsComboCtrl :: OnSize ( UINT nType , int cx , int cy ) { CRect toolsRect ; COleControl :: OnSize ( nType , cx , cy ) ; if ( m_ControlsEnable == TRUE ) { if ( :: IsWindow ( m_OpTools ) ) { m_OpTools . GetWindowRect ( toolsRect ) ; m_OpTools . MoveWindow ( 0 , cy - toolsRect . Height ( ) , cx , toolsRect . Height ( ) ) ; if ( :: IsWindow ( m_ElementsList ) ) { m_ElementsList . MoveWindow ( :: GetSystemMetrics ( SM_CYEDGE ) , :: GetSystemMetrics ( SM_CYEDGE ) , cx - 2 * :: GetSystemMetrics ( SM_CYEDGE ) , cy - 2 * :: GetSystemMetrics ( SM_CYEDGE ) - toolsRect . Height ( ) , TRUE ) ; } } else { if ( :: IsWindow ( m_ElementsList ) ) { m_ElementsList . MoveWindow ( :: GetSystemMetrics ( SM_CYEDGE ) , :: GetSystemMetrics ( SM_CYEDGE ) , cx - 2 * :: GetSystemMetrics ( SM_CYEDGE ) , cy - 2 * :: GetSystemMetrics ( SM_CYEDGE ) , TRUE ) ; } } } else { m_ElementsList . MoveWindow ( 0 , 0 , cx , cy , TRUE ) ; } }
Callback runs every time WM_SIZE message comes to the control (When window
creating and when window changing it's size).
Callback runs every time WM_SIZE message comes to the control ( When window creating and when window changing it ' s size ) .