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 Tech Support » Tab container bug? Collapse All
Subject Author Date
Rado Manzela Aug 17, 2009 - 1:08 PM

I’m using 2.87. I’ve overrided OnTabWndClickedItemCloseButton(LONG nItemIndex) in my class derived from CExtTabPageContainerFlatWnd.

I think it used to work but after some prof-uis update now it always gives nItemIndex=1 when callback is called. (4 tabs, 1st and last has no close button).

Maybe it was caused by this fix? http://www.prof-uis.com/prof-uis/tech-support/support-forum/cexttabpagecontainerflatwnd-bug-65089.aspx#@lt;/p>

Can you check this please? Thank you.


 

Technical Support Aug 17, 2009 - 1:59 PM

Thank you for reporting this issue. Please update the source code for the following method:

bool CExtTabWnd::_ProcessMouseClick(
      CPoint point,
      bool bButtonPressed,
      INT nMouseButton, // MK_... values
      UINT nMouseEventFlags
      )
{
      ASSERT_VALID( this );
      if( GetSafeHwnd() == NULL )
            return false;
      if( bButtonPressed )
      {
            CWnd * pWndTestChildFrame = GetParentFrame();
            if( pWndTestChildFrame != NULL && pWndTestChildFrame->IsKindOf( RUNTIME_CLASS( CMDIChildWnd ) ) )
            {
                  CFrameWnd * pWndFrame = pWndTestChildFrame->GetParentFrame();
                  if( pWndFrame != NULL )
                  {
                        CMDIFrameWnd * pWndMDIFrame = DYNAMIC_DOWNCAST( CMDIFrameWnd, pWndFrame );
                        if( pWndMDIFrame != NULL )
                        {
                              CMDIChildWnd * pActive = pWndMDIFrame->MDIGetActive();
                              if( pWndTestChildFrame != pActive )
                                    ((CMDIChildWnd*)pWndTestChildFrame)->MDIActivate();
                        }
                  }
            }
      } // if( bButtonPressed )
LONG nHitTest = ItemHitTest( point );
      switch( nHitTest )
      {
      case __ETWH_BUTTON_LEFTUP:
      case __ETWH_BUTTON_RIGHTDOWN:
      case __ETWH_BUTTON_SCROLL_HOME:
      case __ETWH_BUTTON_SCROLL_END:
      case __ETWH_BUTTON_HELP:
      case __ETWH_BUTTON_CLOSE:
      case __ETWH_BUTTON_TAB_LIST:
            return OnTabWndClickedButton( nHitTest, bButtonPressed, nMouseButton, nMouseEventFlags );
      default:
            if( nHitTest < __ETWH_TAB_FIRST )
            {
                  OnTabWndMouseTrackingPushedStop();
                  Invalidate();
                  UpdateWindow();
                  return false; //true;
            }
      break;
      }
      ASSERT( nHitTest >= 0 && nHitTest < ItemGetCount() );
      if( bButtonPressed )
            m_ptStartDrag = point;
      else
      {
            if( m_nPushedTrackingButton >= 0 && m_bPushedTrackingCloseButton )
            {
                  CPoint ptCursor;
                  if( ::GetCursorPos( &ptCursor ) )
                  {
                        LONG nPushedTrackingButton = m_nPushedTrackingButton;
                        ScreenToClient( &ptCursor );
                        if( ItemGet( m_nPushedTrackingButton )->CloseButtonRectGet().PtInRect( ptCursor ) )
                        {
                              if( ::GetCapture() == m_hWnd )
                                    ::ReleaseCapture();
                              OnTabWndClickedItemCloseButton( nPushedTrackingButton );
                        }
                  }
                  return true;
            }
      }
      return OnTabWndClickedItem( nHitTest, bButtonPressed, nMouseButton, nMouseEventFlags );
}