Skip to content

Commit 0fb1c0a

Browse files
Fixed combobox color and font display issue.
1 parent d7e7d50 commit 0fb1c0a

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

RegexAssistant/RegexAssistant.rc

-2 Bytes
Binary file not shown.

RegexAssistant/RegexAssistantDlg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ void CRegexAssistantDlg::OnBnClickedReplaceButton()
747747
{
748748
CString Msg;
749749
Msg.Format(_T("Can not use character '%c' for \"%s\" compatibility. Use character '%c' instead.\nTo replace the characters to correct prefix, answer yes.\nTo continue without correcting text, answer no."),
750-
IsNotCompatibleWithBackSlashReplacementToken() ? L'\\' : L'$', m_RegexCompatibilityProperties[m_Regex_Compalibility].Name, IsNotCompatibleWithBackSlashReplacementToken() ? L'$' : L'\\' );
750+
(IsNotCompatibleWithBackSlashReplacementToken() ? '\\' : '$'), (m_RegexCompatibilityProperties[m_Regex_Compalibility].Name, IsNotCompatibleWithBackSlashReplacementToken() ? '$' : '\\') );
751751
int Answer = MessageBox( Msg, _T( "Wrong argument number prefix charactor" ), MB_YESNOCANCEL );
752752
if ( Answer == IDCANCEL )
753753
return;

RegexAssistant/mfcx.ComboBox.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ namespace mfcx
114114
void ComboBox::Initiate()
115115
{
116116
m_ListBox->SetParent( this );
117-
NONCLIENTMETRICS ncm = {sizeof( NONCLIENTMETRICS )};
118-
SystemParametersInfo( SPI_GETNONCLIENTMETRICS, sizeof( NONCLIENTMETRICS ), &ncm, 0 );
119-
m_font.CreateFontIndirect( &ncm.lfStatusFont );
120117
}
121118

122119
ComboBox::~ComboBox()
@@ -174,7 +171,7 @@ namespace mfcx
174171
void ComboBox::DrawItem( LPDRAWITEMSTRUCT lpDrawItemStruct )
175172
{
176173
CDC* pDC = CDC::FromHandle( lpDrawItemStruct->hDC );
177-
const RECT &rc = lpDrawItemStruct->rcItem;
174+
RECT &rc = lpDrawItemStruct->rcItem;
178175
BOOL IsItemSelected = (lpDrawItemStruct->itemState & ODS_SELECTED) ? TRUE : FALSE;
179176
COLORREF oldTextColor = DEFAULT_COLORS;
180177
COLORREF oldBkColor = DEFAULT_COLORS;
@@ -192,11 +189,11 @@ namespace mfcx
192189

193190
oldTextColor = pDC->SetTextColor( newTextColor );
194191
oldBkColor = pDC->SetBkColor( newBkColor );
195-
196-
pOldFont = pDC->SelectObject( &m_font );
192+
pOldFont = pDC->SelectObject( pDC->GetCurrentFont() );
197193
GetLBText( lpDrawItemStruct->itemID, strText );
198-
pDC->ExtTextOut( rc.left + 2,
199-
rc.top + 2,
194+
CRect rectClient( rc );
195+
pDC->ExtTextOut( rc.left,
196+
rc.top,
200197
ETO_OPAQUE, &rc,
201198
strText, NULL );
202199
CSize TextSize = pDC->GetTextExtent( strText );
@@ -212,7 +209,6 @@ namespace mfcx
212209

213210
if ( m_hwndItemTip.m_hWnd != NULL && m_ToolTipItemRecievedStr )
214211
{
215-
CRect rectClient( rc );
216212
int nComboButtonWidth = ::GetSystemMetrics( SM_CXHTHUMB ) + 2;
217213
rectClient.right = rectClient.right - nComboButtonWidth;
218214
ClientToScreen( &rectClient );

RegexAssistant/mfcx.ComboBox.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ namespace mfcx
119119
const COLORREF m_EnabledSelectColor;
120120
const COLORREF m_EnabledSelectBkColor;
121121
std::vector<std::shared_ptr<ComboBoxItemDetails> > m_vComboBoxItemDetails;
122-
CFont m_font;
123122
protected:
124123
CString m_strSavedText; // saves text between OnSelendok and OnRealSelEndOK calls
125124
std::unique_ptr<ComboBoxListBox> m_ListBox;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy