From ffd93cb35608fc8f38b27fb3a96f7d285d376fe9 Mon Sep 17 00:00:00 2001 From: sdottaka Date: Sat, 25 Apr 2015 23:52:51 +0900 Subject: [PATCH] FilepathEdit.*: Adjust top margin in edit control --HG-- branch : stable --- Src/FilepathEdit.cpp | 11 +++++++++++ Src/FilepathEdit.h | 1 + Src/Merge.rc | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Src/FilepathEdit.cpp b/Src/FilepathEdit.cpp index b306a6340..3dd0785ac 100644 --- a/Src/FilepathEdit.cpp +++ b/Src/FilepathEdit.cpp @@ -42,6 +42,7 @@ static int FormatFilePathForDisplayWidth(CDC * pDC, int maxWidth, CString & sFil BEGIN_MESSAGE_MAP(CFilepathEdit, CEdit) ON_WM_CONTEXTMENU() ON_WM_CTLCOLOR_REFLECT() + ON_WM_NCPAINT() END_MESSAGE_MAP() @@ -297,6 +298,15 @@ void CFilepathEdit::OnContextMenu(CWnd*, CPoint point) } } +void CFilepathEdit::OnNcPaint() +{ + CWindowDC dc(this); + CRect rect; + GetWindowRect(rect); + rect.OffsetRect(-rect.TopLeft()); + dc.FillSolidRect(rect, m_crBackGnd); +} + /** * @brief Set the control to look active/inactive. * This function sets control to look like an active control. We don't @@ -324,6 +334,7 @@ void CFilepathEdit::SetActive(BOOL bActive) SetTextColor(::GetSysColor(COLOR_INACTIVECAPTIONTEXT)); SetBackColor(::GetSysColor(COLOR_INACTIVECAPTION)); } + RedrawWindow(NULL, NULL, RDW_FRAME | RDW_INVALIDATE); } /** diff --git a/Src/FilepathEdit.h b/Src/FilepathEdit.h index 65e331ae5..2c350337e 100644 --- a/Src/FilepathEdit.h +++ b/Src/FilepathEdit.h @@ -47,6 +47,7 @@ public : protected: afx_msg void OnContextMenu(CWnd*, CPoint point); + afx_msg void OnNcPaint(); HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); DECLARE_MESSAGE_MAP(); diff --git a/Src/Merge.rc b/Src/Merge.rc index 0c1909551..814bd0f0a 100644 --- a/Src/Merge.rc +++ b/Src/Merge.rc @@ -1267,13 +1267,13 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN EDITTEXT IDC_STATIC_TITLE_PANE0,0,2,160,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT + ES_READONLY | WS_BORDER | NOT WS_TABSTOP EDITTEXT IDC_STATIC_TITLE_PANE1,163,2,160,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT + ES_READONLY | WS_BORDER | NOT WS_TABSTOP EDITTEXT IDC_STATIC_TITLE_PANE2,326,2,0,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER | NOT + ES_READONLY | WS_BORDER | NOT WS_TABSTOP END -- 2.11.0