Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtPageContainerWnd, cancel the expanding Collapse All
Subject Author Date
Seongho Park Jan 27, 2005 - 7:35 AM

How to cancel expanding the page when the caption is clicked? I’m overriding two functions, OnPageContainerCaptionPressedStart() and OnPageContainerCaptionPressedStop() to detect an activated page in order to proceed other related jobs. However, sometime, I need to force the page NOT to be expanded after the caption is clicked. Is there any override functions that I can use to implement this?

Technical Support Jan 27, 2005 - 12:39 PM

We believe there is no reason not to use expanding pages because this may confuse the users of your application. If you need to prevent expanding, please add a handler for the WM_LBUTTONUP message like this:

void CYourPageContainerWnd::OnLButtonUp(
  UINT nFlags, CPoint point) 
 {
 PAGE_ITEM_INFO * pPageInfoToExpand = NULL;
 HIT_TEST_INFO _pht( point );
  PageHitTest( _pht );
  if( _pht.m_dwHitTestCode &
    _EPCHT_ON_PAGE_CAPT_ANY )
  {
   ASSERT( _pht.m_pPageInfo != NULL );
   if( _pht.m_pPageInfo ==
     m_pPageInfoPressed )
    pPageInfoToExpand =
     m_pPageInfoPressed;
  }
  if( pPageInfoToExpand != NULL )
  {
   // analyze the pPageInfoToExpand and
   // return if you need to cancel
   // page expanding
   return;
  }
  CExtPageContainerWnd::OnLButtonUp(
   nFlags, point );
 }