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 » CExtEdit=slow Collapse All
Subject Author Date
Krustys Donuts Jul 26, 2005 - 12:35 AM

Hello-

When I try to delete text that I’ve typed in a CExtEdit box, it takes quite a while for the text to actually delete. This can be easily seen in the ProfUIS_Controls sample:

1. Compile & run ProfUIS_Controls MBCS Debug.
2. Select Visual Studio 2005 style
3. Choose "Buttons" on the left of the screen
4. You’ll see a CExtEdit box with the text "tooltip" in it
5. Try highlighting that text, move the mouse off the control, and press the delete key. Nothing happens unless you hover the mouse over the window.
6. Now, try typing "hello" in the same window and press the delete key one time. You’ll see the cursor back up to the left of the ’o’ but not delete it. Again hovering the mouse over the control causes the actual delete to happen.

What gives?

Thanks.

Technical Support Jul 26, 2005 - 5:48 AM

Thank you for the bug report. Please update the following two methods in the ExtEdit.cpp and ExtGridWnd.cpp files:

HBRUSH CExtEditBase::CtlColor( CDC* pDC, UINT nCtlColor )
{
 ASSERT_VALID( this );
 if(  nCtlColor == CTLCOLOR_EDIT 
  || nCtlColor == CTLCOLOR_MSGBOX
  || ( nCtlColor == CTLCOLOR_STATIC )
  )
 {
  COLORREF clrText = GetTextColor();
  if( clrText == COLORREF(-1L) )
  {
   COLORREF clrSysText =
    g_PaintManager->GetColor(
     ( ! IsWindowEnabled() )
      ? COLOR_GRAYTEXT
      : COLOR_WINDOWTEXT
     );
   clrText = clrSysText;
  }
  bool bReadOnly = (GetStyle()&ES_READONLY) != 0;
  COLORREF clrBk = GetBkColor();
  if( clrBk == COLORREF(-1L) )
  {
   COLORREF clrSysBk =
    g_PaintManager->GetColor( 
     bReadOnly 
     ? COLOR_3DFACE
     : COLOR_WINDOW 
    );
   clrBk = clrSysBk;
  }
  pDC->SetBkColor( clrBk );
  pDC->SetTextColor( clrText );
  if( m_clrBackPrev != clrBk )
  {
   if( m_brBack.GetSafeHandle() != NULL )
    m_brBack.DeleteObject();
   m_brBack.CreateSolidBrush( clrBk );
   m_clrBackPrev = clrBk;
  }
  return m_brBack;
 }
 else
  return (HBRUSH)Default();
}



HBRUSH CExtGridInplaceEdit::CtlColor( CDC* pDC, UINT nCtlColor )
{
 ASSERT_VALID( this );
 if(  nCtlColor == CTLCOLOR_EDIT 
  || nCtlColor == CTLCOLOR_MSGBOX
  || ( nCtlColor == CTLCOLOR_STATIC )
  )
 {
  COLORREF clrText = GetTextColor();
  if( clrText == COLORREF(-1L) )
  {
   COLORREF clrSysText =
    g_PaintManager->GetColor(
     ( ! IsWindowEnabled() )
      ? COLOR_GRAYTEXT
      : COLOR_WINDOWTEXT
     );
   clrText = clrSysText;
  }
  COLORREF clrBk = GetBkColor();
  if( clrBk == COLORREF(-1L) )
  {
   COLORREF clrSysBk =
    m_wndGrid.OnSiwGetSysColor( COLOR_WINDOW );
   clrBk = clrSysBk;
  }
  pDC->SetBkColor( clrBk );
  pDC->SetTextColor( clrText );
  if( m_clrBackPrev != clrBk )
  {
   if( m_brBack.GetSafeHandle() != NULL )
    m_brBack.DeleteObject();
   m_brBack.CreateSolidBrush( clrBk );
   m_clrBackPrev = clrBk;
  }
  return m_brBack;
 }
 else
  return (HBRUSH)Default();
}