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 » CExtBarColorButton selection changes MDI Window Collapse All
Subject Author Date
Neville Franks Jan 5, 2010 - 10:46 PM

I have a Toolbar with a CExtBarColorButton and when I select "Bright Green" from the pallete my MDI App changes windows. Selecting "Bright Green" sends a WM_COMMAND wParam = 0xFF00 to the mainframe which is AFX_IDM_FIRST_MDICHILD. I don’t know if this is what is causing the MDI window to change though.


The following code prevents the Window change.



CMainFrame::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
    if ( message == WM_COMMAND )
    {
	    if ( wParam == 0xFF00 )
		    return 0L;
    }



Is this a known problem and is their a better solution or a fix in newer version of Prof-UIS. I am using V2.85


Thanks,


Neville http://www.surfulater.com 


 

Technical Support Jan 6, 2010 - 9:22 AM

Thank you for reporting this issue. To fix it, please update the source code for the following method:

bool CExtPopupColorMenuWnd::_OnMouseClick(
      UINT nFlags,
      CPoint point,
      bool & bNoEat
      )
{
      ASSERT_VALID( this );
      bNoEat;
      if( GetSafeHwnd() == NULL )
            return false;
      if( GetSite().GetAnimated() != NULL )
            return true;
TranslateMouseClickEventData_t _td( this, nFlags, point, bNoEat );
      if( _td.Notify() )
            { bNoEat = _td.m_bNoEat; return true; }
bool bLButtonUpCall = ( nFlags==WM_LBUTTONUP || nFlags==WM_NCLBUTTONUP ) ? true : false;
      if( m_eCombineAlign != __CMBA_NONE && m_bTopLevel )
      {
            CRect rcExcludeAreaTest( m_rcExcludeArea );
            ScreenToClient( &rcExcludeAreaTest );
            if( rcExcludeAreaTest.PtInRect( point ) )
            {
                  if( ! bLButtonUpCall )
                        { _OnCancelMode(); return true; }
                  return false;
            }
      }
      if( _IsTearOff() && CExtPopupMenuWnd::_HitTest(point) == IDX_TEAROFF )
      {
            if( ! bLButtonUpCall )
                  _DoTearOff();
            return true;
      }
      if( ! bLButtonUpCall )
            return false;
bool bEndSequence = false;
HWND hWndOwn = GetSafeHwnd();
      ASSERT( hWndOwn != NULL && ::IsWindow(hWndOwn) );
int m_nColorIdxCurr = _ColorItemHitTest(point);
      if( ( m_nColorIdxCurr >= 0 || m_nColorIdxCurr == IDX_DEFAULT_COLOR_BTN || m_nColorIdxCurr == IDX_CUSTOM_COLOR_BTN )
            &&    ( ! _FindCustomizeMode() )
            )
      {
            bEndSequence = true;
            _NotifyColorChanged( true );
            g_SoundPlayer->PlaySound( CExtSoundPlayer::__ON_MENU_CMD_CLICKED );
      }
      if( ! ::IsWindow(hWndOwn) )
            return true;
CPoint ptScreenClick( point );
      ClientToScreen( &ptScreenClick );
HWND hWndFromPoint = ::WindowFromPoint( ptScreenClick );
      if( hWndFromPoint != NULL && hWndFromPoint == m_pWndParentMenu->GetSafeHwnd() )
      {
            m_pWndParentMenu->ScreenToClient( &ptScreenClick );
            return m_pWndParentMenu->_OnMouseClick( nFlags, ptScreenClick, bNoEat );
      }
      if( bEndSequence || ( ! bLButtonUpCall ) )
      {
            COLORREF clr = (COLORREF)__ECST_NONE;
            switch( m_nColorIdxCurr )
            {
            case IDX_DEFAULT_COLOR_BTN: clr = (COLORREF)__ECST_BUTTON_DEFAULT;   break;
            case IDX_CUSTOM_COLOR_BTN:  clr = (COLORREF)__ECST_BUTTON_CUSTOM;    break;
            default:                    clr = _GetColorValue( m_nColorIdxCurr ); break;
            }
           _EndSequence( 0 );
      }
      return true;
}