[ENHANCEMENT] Enhance delimiter selection settings GUI.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1083 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2013-07-24 00:35:27 +00:00
parent 4a225476fe
commit 31b15392a5
5 changed files with 19 additions and 5 deletions

View File

@ -592,7 +592,7 @@ generic_string PathAppend(generic_string &strDest, const generic_string & str2ap
return strDest; return strDest;
} }
COLORREF getCtrlBkColor(HWND hWnd) COLORREF getCtrlBgColor(HWND hWnd)
{ {
COLORREF crRet = CLR_INVALID; COLORREF crRet = CLR_INVALID;
if (hWnd && IsWindow(hWnd)) if (hWnd && IsWindow(hWnd))

View File

@ -178,6 +178,6 @@ private:
generic_string PathRemoveFileSpec(generic_string & path); generic_string PathRemoveFileSpec(generic_string & path);
generic_string PathAppend(generic_string &strDest, const generic_string & str2append); generic_string PathAppend(generic_string &strDest, const generic_string & str2append);
COLORREF getCtrlBkColor(HWND hWnd); COLORREF getCtrlBgColor(HWND hWnd);
#endif //M30_IDE_COMMUN_H #endif //M30_IDE_COMMUN_H

View File

@ -2344,7 +2344,7 @@ void FindReplaceDlg::drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
//printInt(fgColor); //printInt(fgColor);
SetTextColor(lpDrawItemStruct->hDC, fgColor); SetTextColor(lpDrawItemStruct->hDC, fgColor);
COLORREF bgColor = getCtrlBkColor(_statusBar.getHSelf()); COLORREF bgColor = getCtrlBgColor(_statusBar.getHSelf());
::SetBkColor(lpDrawItemStruct->hDC, bgColor); ::SetBkColor(lpDrawItemStruct->hDC, bgColor);
//::SetBkColor(lpDrawItemStruct->hDC, ::GetSysColor(COLOR_3DFACE)); //::SetBkColor(lpDrawItemStruct->hDC, ::GetSysColor(COLOR_3DFACE));
//ExtTextOut(lpDIS->hDC, 0, 0, 0 , &lpDIS->rcItem,ptStr, _tcslen(ptStr), NULL); //ExtTextOut(lpDIS->hDC, 0, 0, 0 , &lpDIS->rcItem,ptStr, _tcslen(ptStr), NULL);

View File

@ -213,7 +213,7 @@ LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
::SetTextColor(hdc, _linkColor); ::SetTextColor(hdc, _linkColor);
::SetBkColor(hdc, getCtrlBkColor(GetParent(hwnd))); ///*::GetSysColor(COLOR_3DFACE)*/); ::SetBkColor(hdc, getCtrlBgColor(GetParent(hwnd))); ///*::GetSysColor(COLOR_3DFACE)*/);
// Create an underline font // Create an underline font
if(_hfUnderlined == 0) if(_hfUnderlined == 0)

View File

@ -2440,7 +2440,7 @@ BOOL CALLBACK MultiInstDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
return FALSE; return FALSE;
} }
BOOL CALLBACK DelimiterSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM) BOOL CALLBACK DelimiterSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam)
{ {
NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI()); NppGUI & nppGUI = (NppGUI &)((NppParameters::getInstance())->getNppGUI());
switch (Message) switch (Message)
@ -2487,6 +2487,20 @@ BOOL CALLBACK DelimiterSettingsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPA
return TRUE; return TRUE;
} }
case WM_CTLCOLORSTATIC:
{
HDC hdcStatic = (HDC) wParam;
HWND hwnd = (HWND) lParam;
if (hwnd == ::GetDlgItem(_hSelf, IDD_STATIC_BLABLA) || hwnd == ::GetDlgItem(_hSelf, IDD_STATIC_BLABLA2NDLINE))
{
COLORREF bgColor = getCtrlBgColor(_hSelf);
SetTextColor(hdcStatic, RGB(0, 0, 0));
SetBkColor(hdcStatic, RGB(GetRValue(bgColor) - 30, GetGValue(bgColor) - 30, GetBValue(bgColor) - 30));
return TRUE;
}
return FALSE;
}
case WM_COMMAND : case WM_COMMAND :
{ {
if (HIWORD(wParam) == EN_CHANGE) if (HIWORD(wParam) == EN_CHANGE)