From 61c0b2af504aec846c182dd625ac3437d1d2a15b Mon Sep 17 00:00:00 2001 From: donho Date: Wed, 15 Aug 2007 20:23:37 +0000 Subject: [PATCH] [RELEASE] v4.2.2 : 1. Fix a regression bug regarding the filters in Find in files dialog. 2. Add a new transparency feature for Find dialog : Transparency on loss focus. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@7 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/installer/nppSetup.nsi | 4 +- PowerEditor/src/Notepad_plus.cpp | 6 +- PowerEditor/src/Notepad_plus.rc | 10 ++-- .../src/ScitillaComponent/FindReplaceDlg.cpp | 58 +++++++++++++++++-- .../src/ScitillaComponent/FindReplaceDlg.rc | 8 ++- .../src/ScitillaComponent/FindReplaceDlg_rc.h | 9 ++- PowerEditor/visual.net/notepadPlus.vcproj | 6 +- 7 files changed, 79 insertions(+), 22 deletions(-) diff --git a/PowerEditor/installer/nppSetup.nsi b/PowerEditor/installer/nppSetup.nsi index 5000cc8c2..900dec045 100644 --- a/PowerEditor/installer/nppSetup.nsi +++ b/PowerEditor/installer/nppSetup.nsi @@ -17,13 +17,13 @@ ; Define the application name !define APPNAME "Notepad++" -!define APPNAMEANDVERSION "Notepad++ v4.2.1" +!define APPNAMEANDVERSION "Notepad++ v4.2.2" ; Main Install settings Name "${APPNAMEANDVERSION}" InstallDir "$PROGRAMFILES\Notepad++" InstallDirRegKey HKLM "Software\${APPNAME}" "" -OutFile "..\bin\npp.4.2.1.Installer.exe" +OutFile "..\bin\npp.4.2.2.Installer.exe" diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index a05e81e29..dc37313c6 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -5845,7 +5845,7 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa const char *dir = NULL; char currentDir[MAX_PATH]; - const char *fltr; + string fltr; if (wParam) dir = (const char *)wParam; @@ -5874,12 +5874,12 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa filtres += "*."; filtres += vStr[i] + " "; } - fltr = filtres.c_str(); + fltr = filtres; } else fltr = "*.*"; } - _findReplaceDlg.setFindInFilesDirFilter(dir, fltr); + _findReplaceDlg.setFindInFilesDirFilter(dir, fltr.c_str()); return TRUE; } diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 12fdddb15..51b4eec94 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -20,11 +20,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include #include "resource.h" -#define NOTEPAD_PLUS_VERSION "Notepad++ v4.2.1" +#define NOTEPAD_PLUS_VERSION "Notepad++ v4.2.2" VS_VERSION_INFO VERSIONINFO -FILEVERSION 4, 2, 1, 0 -PRODUCTVERSION 4, 2, 1, 0 +FILEVERSION 4, 2, 2, 0 +PRODUCTVERSION 4, 2, 2, 0 FILEFLAGSMASK 0x3fL FILEFLAGS 0 FILEOS VOS_NT_WINDOWS32 @@ -41,12 +41,12 @@ BEGIN BEGIN VALUE "CompanyName", "Don HO don.h@free.fr\0" VALUE "FileDescription", "Notepad++ : a free (GNU) source code editor\0" - VALUE "FileVersion", "4.2.1\0" + VALUE "FileVersion", "4.2.2\0" VALUE "InternalName", "npp.exe\0" VALUE "LegalCopyright", "Copyleft 1998-2006 by Don HO\0" VALUE "OriginalFilename", "Notepad++.exe\0" VALUE "ProductName", "Notepad++\0" - VALUE "ProductVersion", "4.2.1\0" + VALUE "ProductVersion", "4.2.2\0" END END END diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index b3298db7f..a6a23aeb7 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -105,12 +105,20 @@ void FindReplaceDlg::create(int dialogID, bool isRTL) if ((NppParameters::getInstance())->isTransparentAvailable()) { ::ShowWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_CHECK), SW_SHOW); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_GRPBOX), SW_SHOW); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_LOSSFOCUS_RADIO), SW_SHOW); + ::ShowWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_ALWAYS_RADIO), SW_SHOW); ::ShowWindow(::GetDlgItem(_hSelf, IDC_PERCENTAGE_SLIDER), SW_SHOW); ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(20, 200)); ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_SETPOS, TRUE, 150); - if (!isCheckedOrNot(IDC_PERCENTAGE_SLIDER)) + if (!isCheckedOrNot(IDC_TRANSPARENT_CHECK)) + { + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_GRPBOX), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_LOSSFOCUS_RADIO), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_ALWAYS_RADIO), FALSE); ::EnableWindow(::GetDlgItem(_hSelf, IDC_PERCENTAGE_SLIDER), FALSE); + } } RECT rect; //::GetWindowRect(_hSelf, &rect); @@ -276,8 +284,12 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP { if ((HWND)lParam == ::GetDlgItem(_hSelf, IDC_PERCENTAGE_SLIDER)) { - int percent = ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_GETPOS, 0, 0); - (NppParameters::getInstance())->SetTransparent(_hSelf, percent); + + if (isCheckedOrNot(IDC_TRANSPARENT_ALWAYS_RADIO)) + { + int percent = ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_GETPOS, 0, 0); + (NppParameters::getInstance())->SetTransparent(_hSelf, percent); + } } return TRUE; } @@ -314,6 +326,19 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP _isInSelection = false; } ::EnableWindow(::GetDlgItem(_hSelf, IDC_IN_SELECTION_CHECK), isSelected); + + if (isCheckedOrNot(IDC_TRANSPARENT_LOSSFOCUS_RADIO)) + { + if (wParam == WA_INACTIVE) + { + int percent = ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_GETPOS, 0, 0); + (NppParameters::getInstance())->SetTransparent(_hSelf, percent); + } + else + { + (NppParameters::getInstance())->removeTransparent(_hSelf); + } + } return TRUE; } @@ -521,18 +546,39 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP case IDC_TRANSPARENT_CHECK : { bool isChecked = isCheckedOrNot(IDC_TRANSPARENT_CHECK); + + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_GRPBOX), isChecked); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_LOSSFOCUS_RADIO), isChecked); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_TRANSPARENT_ALWAYS_RADIO), isChecked); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_PERCENTAGE_SLIDER), isChecked); + if (isChecked) { - int percent = ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_GETPOS, 0, 0); - (NppParameters::getInstance())->SetTransparent(_hSelf, percent); + ::SendDlgItemMessage(_hSelf, IDC_TRANSPARENT_LOSSFOCUS_RADIO, BM_SETCHECK, BST_CHECKED, 0); } else + { + ::SendDlgItemMessage(_hSelf, IDC_TRANSPARENT_LOSSFOCUS_RADIO, BM_SETCHECK, BST_UNCHECKED, 0); + ::SendDlgItemMessage(_hSelf, IDC_TRANSPARENT_ALWAYS_RADIO, BM_SETCHECK, BST_UNCHECKED, 0); (NppParameters::getInstance())->removeTransparent(_hSelf); + } - ::EnableWindow(::GetDlgItem(_hSelf, IDC_PERCENTAGE_SLIDER), isChecked); return TRUE; } + case IDC_TRANSPARENT_ALWAYS_RADIO : + { + int percent = ::SendDlgItemMessage(_hSelf, IDC_PERCENTAGE_SLIDER, TBM_GETPOS, 0, 0); + (NppParameters::getInstance())->SetTransparent(_hSelf, percent); + } + return TRUE; + + case IDC_TRANSPARENT_LOSSFOCUS_RADIO : + { + (NppParameters::getInstance())->removeTransparent(_hSelf); + } + return TRUE; + // // Find in Files // diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc index 4e54bd59d..dba725aed 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc @@ -71,9 +71,11 @@ BEGIN PUSHBUTTON "Find them all",IDD_FINDINFILES_FIND_BUTTON,217,20,90,14,WS_GROUP PUSHBUTTON "Close",IDCANCEL,217,99,90,14, WS_TABSTOP - CONTROL "Transparency",IDC_TRANSPARENT_CHECK,"Button", BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,258,153,55,10 - CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,257,165,53,10 - + GROUPBOX "Transparency",IDC_TRANSPARENT_GRPBOX,227,123,83,49 + CONTROL "",IDC_TRANSPARENT_CHECK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,223,123,9,10 + CONTROL "On loss focus",IDC_TRANSPARENT_LOSSFOCUS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,237,135,69,10 + CONTROL "Always",IDC_TRANSPARENT_ALWAYS_RADIO,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,237,147,63,10 + CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,240,161,53,10 END IDD_INCREMENT_FIND DIALOGEX 0, 0, 330, 14 diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h index 619328e66..e9da33133 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h @@ -22,8 +22,9 @@ #define IDC_FINDALL_STATIC 1619 #define IDFINDWHAT_STATIC 1620 #define IDC_DIR_STATIC 1621 -#define IDC_PERCENTAGE_SLIDER 1622 -#define IDC_TRANSPARENT_CHECK 1623 + +#define IDC_PERCENTAGE_SLIDER 1622 +#define IDC_TRANSPARENT_GRPBOX 1623 #define IDC_DISPLAYPOS_STATIC 1624 #define IDC_DISPLAYPOS_TOP 1625 @@ -62,3 +63,7 @@ #define IDC_INCFINDPREVOK 1683 #define IDC_INCFINDNXTOK 1684 #define IDC_INCFINDMATCHCASE 1685 + +#define IDC_TRANSPARENT_CHECK 1686 +#define IDC_TRANSPARENT_LOSSFOCUS_RADIO 1687 +#define IDC_TRANSPARENT_ALWAYS_RADIO 1688 diff --git a/PowerEditor/visual.net/notepadPlus.vcproj b/PowerEditor/visual.net/notepadPlus.vcproj index da873687b..bb34ed2af 100644 --- a/PowerEditor/visual.net/notepadPlus.vcproj +++ b/PowerEditor/visual.net/notepadPlus.vcproj @@ -1,7 +1,7 @@ + +