Print Page | Close Window

CXTFontCombo no indication when focused

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=5033
Printed Date: 11 November 2025 at 9:37am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTFontCombo no indication when focused
Posted By: Kukis
Subject: CXTFontCombo no indication when focused
Date Posted: 12 September 2006 at 8:35am

CXTFontCombo control desn't indicate focused state when font isn't selected (edit part of the combobox is empty). I dont want to select anything on init to let the user to decide what should be selected and to know has user selected anything or not. Right now CXTFontCombo control skips drawing entirely if no selection was done:

void CXTFontCombo::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
if (lpDIS->itemID == (UINT)-1)
{
return;
}
           ……….
      if (nState & ODS_SELECTED)
      {
            pDC->FillSolidRect(rcItem, GetXtremeColor(COLOR_HIGHLIGHT));
            pDC->SetTextColor(GetXtremeColor(COLOR_HIGHLIGHTTEXT));
            pDC->DrawFocusRect(&rcItem);
      }
      else
      {
            pDC->FillSolidRect(rcItem, GetXtremeColor(COLOR_WINDOW));
            pDC->SetTextColor(GetXtremeColor(COLOR_WINDOWTEXT));
      }
…….
}
 
Should't it draw background and focus rectangle anyway?
 
P.S. And check ODS_NOFOCUSRECT before drawing a focus rectangle :
 
if(!(nState & ODS_NOFOCUSRECT))
    pDC->DrawFocusRect(&rcItem);



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net