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 » CExtTabPageContainerFlatWnd bug? Collapse All
Subject Author Date
Rado Manzela Jul 27, 2009 - 9:05 AM

I’ve overrided OnTabWndClickedItemCloseButton() in class derived from CExtTabPageContainerFlatWnd. When I display some message box in this method (CExtMsgBox::DoModal) , the 1st mouse click is ignored. So i need 2 clicks to close the message box, or drag dialog’s title to move it. Can you check this please? Thank you.

Technical Support Jul 27, 2009 - 12:05 PM

Thank you for reporting this issue. To fix it, 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 ) )
                  {
                        ScreenToClient( &ptCursor );
                        if( ItemGet( m_nPushedTrackingButton )->CloseButtonRectGet().PtInRect( ptCursor ) )
                        {
                              if( ::GetCapture() == m_hWnd )
                                    ::ReleaseCapture();
                              LONG nPushedTrackingButton = m_nPushedTrackingButton;
                              OnTabWndClickedItemCloseButton( nPushedTrackingButton );
                        }
                  }
                  return true;
            }
      }
      return OnTabWndClickedItem( nHitTest, bButtonPressed, nMouseButton, nMouseEventFlags );
}