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 » Problemin CExtGridCellColor Collapse All
Subject Author Date
Offer Har Feb 6, 2008 - 5:00 AM

Dear Support,

I define a cell of type CExtGridCellColor which always contains a valid color like this:

	pColorCell->SetMode(CExtGridCellColor::eNone);
	pColorCell->SetColor(data.nColor);
	pColorCell->ModifyStyle(__EGCS_NO_INPLACE_CONTROL);

I then do this:
1. Open the drop down to show the colors list
2. hover the mouse over the Custom Color button
3. Press the Enter key
The outcome is that the colors list is closed, and in the cell I get an undefined color (with a question mark).
This situation is wrong, because I should always have a valid color.

When hovering and pressing enter over a color button and pressing the enter that color is selected and the color list is closed - I suggest that when hovering and pressing enter over the Custom Color button you will not close the list.

Please verify the problem and let me know of a possible solution.

Regards,
Ron.

Offer Har Feb 12, 2008 - 3:30 PM

Thanks,
Problem solved...

Now I just need to get some answers from you on all other issues that I’m waiting for answers for months (sent you mails today - please respond)

Technical Support Feb 12, 2008 - 12:17 PM

We successfully reproduced the problem and fixed it. Thank you. Now when you press Enter over the Customize Color button, the color selection dialog opens.

Please update the following method:

bool CExtPopupColorMenuWnd::_OnKeyDown(
            UINT nChar,
            UINT nRepCnt,
            UINT nFlags,
            bool & bNoEat
            )
{
            ASSERT_VALID( this );

            nRepCnt;
            nFlags;
            bNoEat;
            if( GetSafeHwnd() == NULL )
                        return true; //false;

            if( GetSite().GetAnimated() != NULL )
                        return true;

TranslateKeyboardEventData_t _td( this, nChar, nRepCnt, nFlags, bNoEat );
            if( _td.Notify() )
            {
                        bNoEat = _td.m_bNoEat;
                        return true;
            }

bool bEat = false;
            switch( nChar )
            {
            case VK_RETURN:
            {
                        HWND hWndThis = GetSafeHwnd();
                        if(         (           m_nColorIdxCurr >= 0
                                               || m_nColorIdxCurr == IDX_DEFAULT_COLOR_BTN
                                               || m_nColorIdxCurr == IDX_CUSTOM_COLOR_BTN
                                               )
                                   &&       ( ! _FindCustomizeMode() )
                                   )
                        {
                                   _NotifyColorChanged( true );
                                   g_SoundPlayer->PlaySound( CExtSoundPlayer::__ON_MENU_CMD_CLICKED );
                        }
                        if( !::IsWindow(hWndThis) )
                                   return true;

                        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( clr );
                        return true;
            } // VK_RETURN
            
            case VK_MENU:
                        _EndSequence();
                        return true;
            
            case VK_ESCAPE:
                        if( m_bTopLevel )
                                   _EndSequence();
                        else
                        {
                                   int nParentCurIndex =
                                               m_pWndParentMenu->_GetCurIndex();
                                   ASSERT(
                                               nParentCurIndex >= 0
                                               &&
                                               nParentCurIndex <=
                                                           m_pWndParentMenu->ItemGetCount()
                                               );
                                   HWND hWndOwn = m_hWnd;
                                   m_pWndParentMenu->_SetCapture();
                                   m_pWndParentMenu->_ItemFocusCancel(
                                               FALSE
                                               );
                                   m_pWndParentMenu->_ItemFocusSet(
                                               nParentCurIndex,
                                               FALSE,
                                               TRUE
                                               );
                                   if( ! ::IsWindow( hWndOwn ) )
                                               return true;
                                   m_pWndParentMenu->_SetCapture();
                        }
                        return true;

            case VK_LEFT:
            case VK_RIGHT:
            case VK_UP:
            case VK_DOWN:
            case VK_TAB:
                        {
                                   if( nChar == VK_TAB )
                                   {
                                               bool bAlt =
                                                           ( (::GetAsyncKeyState(VK_MENU)&0x8000) != 0 )
                                                                       ? true : false;
                                               bool bCtrl =
                                                           ( (::GetAsyncKeyState(VK_CONTROL)&0x8000) != 0 )
                                                                       ? true : false;
                                               if( bCtrl || bAlt )
                                                           break;
                                               bool bShift =
                                                           ( (::GetAsyncKeyState(VK_SHIFT)&0x8000) != 0 )
                                                                       ? true : false;
                                               nChar = bShift ? VK_LEFT : VK_RIGHT;
                                   }
                                   int nOldIdx = m_nColorIdxCurr;
                                   m_nColorIdxCurr = _GetNextKeyColor( nOldIdx, nChar );
                                   bEat = ( m_nColorIdxCurr != nOldIdx ) ? true : false;
                        }
                        break;
            } // switch( nChar )

            if( bEat )
            {
                        HWND hWndOwn = m_hWnd;
                        _CoolTipHide();
                        if( ! ::IsWindow( hWndOwn ) )
                                   return true;
                        _NotifyColorChanged();
                        Invalidate();
            }

            return bEat;
}

Offer Har Feb 12, 2008 - 10:19 AM

Dear Support,

I have tested it in 2.83 and the bug is still there.

Let me explain you what I am doing - maybe I was not clear enough last time:
1. Open the ’SimpleGrids’ application.
2. Go to ’Colors’ Tab.
3. Go to the first row, to the Text cell (or any other color cell for that matter).
4. Press the drop-down button - the list drop-down is opened.
5. move the mouse cursor over the ’Customize Color...’ button (Do Not click, just move the cursor over it) the button is highlighted.
6. Without moving the mouse, press the ’Enter’ key in the keyboard.

The result after step 6 is that the drop-down is closed, and there is no color selection in the cell - you get the ’?’ as the color, and no text.
This is wrong because the user did not select anything.

I can clearly categorize this as a bug, and it’s very easy to reproduce also in the ProfUIS_Controls sample.

Please verify that you were able to reproduce this bug.

Regards,
Ron.

Technical Support Feb 8, 2008 - 3:18 AM

You can download the latest source code from our ftp server. Please contact us for ftp login details via email.

Offer Har Feb 7, 2008 - 8:49 AM

The problem is that the None appears when it shouldn’t:
Assign a color to the cell, remove the in-place, and repeat steps 1-3.
If you can reproduce it, please send me the changes you did, I need to release a version ASAP

Technical Support Feb 7, 2008 - 8:39 AM

We put the following code into the constructor of the CDemoColorPickerCell class in the SimpleGrids sample:

      SetMode( eNone );
      ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
These color grid cells are used in the grid window on the Colors tab page and we do not see anything wrong. But, frankly speaking, we made a couple of changes to thepop-up color picker menu a few days ago.