From b7edd3c8e21cff898bce13186a0cde16d1cbcbbd Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 6 Feb 2015 02:29:07 +0000 Subject: [PATCH] [ENHANCEMENT] (Author: Mike Cowperthwaite) Enhance Incremental search. (part 1/2) git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1334 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 3 ++- PowerEditor/src/Notepad_plus_Window.cpp | 1 - .../src/ScitillaComponent/FindReplaceDlg.cpp | 26 +++++++++---------- .../src/ScitillaComponent/FindReplaceDlg.rc | 6 ++--- .../src/WinControls/ToolBar/ToolBar.cpp | 5 +++- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 30b1907e..6d56856d 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -708,7 +708,8 @@ LRESULT Notepad_plus::init(HWND hwnd) loadBufferIntoView(_subEditView.getCurrentBufferID(), SUB_VIEW); activateBuffer(_mainEditView.getCurrentBufferID(), MAIN_VIEW); activateBuffer(_subEditView.getCurrentBufferID(), SUB_VIEW); - ::SetFocus(_mainEditView.getHSelf()); + //::SetFocus(_mainEditView.getHSelf()); + _mainEditView.getFocus(); return TRUE; } diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 6e4f858b..12e41eb3 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -218,7 +218,6 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin char dest[MAX_PATH]; wcstombs(dest, (cmdLineParams->_easterEggName).c_str(), sizeof(dest)); - //::MessageBoxA(NULL, destStr.c_str(), "", MB_OK); if (cmdLineParams->_quoteType == 0) // Easter Egg Name { diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index bd00fee7..82b22b49 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -890,7 +890,8 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP result = moreInfo; } setStatusbarMessage(result, FSMessage); - ::SetFocus(_hSelf); + //::SetFocus(_hSelf); + getFocus(); } } return TRUE; @@ -921,7 +922,8 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP } if (isMacroRecording) saveInMacro(wParam, FR_OP_FIND); setStatusbarMessage(result, FSMessage); - ::SetFocus(_hSelf); + //::SetFocus(_hSelf); + getFocus(); } } return TRUE; @@ -953,7 +955,8 @@ BOOL CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP result = moreInfo; } setStatusbarMessage(result, FSMessage); - ::SetFocus(_hSelf); + //::SetFocus(_hSelf); + getFocus(); } } return TRUE; @@ -1279,7 +1282,8 @@ bool FindReplaceDlg::processFindNext(const TCHAR *txt2find, const FindOption *op // if the dialog is not shown, pass the focus to his parent(ie. Notepad++) if (!::IsWindowVisible(_hSelf)) { - ::SetFocus((*_ppEditView)->getHSelf()); + //::SetFocus((*_ppEditView)->getHSelf()); + (*_ppEditView)->getFocus(); } else { @@ -2720,8 +2724,9 @@ BOOL CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) { case IDCANCEL : (*(_pFRDlg->_ppEditView))->clearIndicator(SCE_UNIVERSAL_FOUND_STYLE_INC); - ::SetFocus((*(_pFRDlg->_ppEditView))->getHSelf()); - + //::SetFocus((*(_pFRDlg->_ppEditView))->getHSelf()); + (*(_pFRDlg->_ppEditView))->getFocus(); + ::SendDlgItemMessage(_hSelf, IDC_INCFINDHILITEALL, BM_SETCHECK, BST_UNCHECKED, 0); display(false); return TRUE; @@ -2819,13 +2824,6 @@ BOOL CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) return (BOOL)lResult; break; } - - case WM_MOVE: - { - ::InvalidateRect(_hSelf, NULL, TRUE); //when moving, force background redraw - return FALSE; - break; - } } return FALSE; } @@ -2884,7 +2882,7 @@ void FindIncrementDlg::addToRebar(ReBar * rebar) _rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_ID; - _rbBand.fStyle = RBBS_HIDDEN; + _rbBand.fStyle = RBBS_HIDDEN | RBBS_NOGRIPPER; _rbBand.hwndChild = getHSelf(); _rbBand.wID = REBAR_BAR_SEARCH; //ID REBAR_BAR_SEARCH for search dialog _rbBand.cxMinChild = 0; diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc index 005c3f4f..79fa923f 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc @@ -96,11 +96,11 @@ FONT 8, TEXT("MS Shell Dlg") BEGIN PUSHBUTTON "X",IDCANCEL,2,3,16,14 RTEXT "Find :",IDC_INCSTATIC,20,6,25,12 - EDITTEXT IDC_INCFINDTEXT,45,6,175,10,ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_TABSTOP ,WS_EX_STATICEDGE + EDITTEXT IDC_INCFINDTEXT,45,6,175,10,ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_TABSTOP, WS_EX_STATICEDGE PUSHBUTTON "<",IDC_INCFINDPREVOK | WS_TABSTOP,223,3,16,14 PUSHBUTTON ">",IDC_INCFINDNXTOK | WS_TABSTOP,243,3,16,14 - CONTROL "Highlight all", IDC_INCFINDHILITEALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,5,65,12 - CONTROL "Match case", IDC_INCFINDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,335,5,60,12 + CONTROL "&Highlight all", IDC_INCFINDHILITEALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,5,65,12 + CONTROL "Match &case", IDC_INCFINDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,335,5,60,12 LTEXT "",IDC_INCFINDSTATUS,400,6,180,12 END diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp index 94af92ae..c2807f61 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp @@ -428,7 +428,10 @@ void ReBar::init(HINSTANCE hInst, HWND hPere) bool ReBar::addBand(REBARBANDINFO * rBand, bool useID) { if (rBand->fMask & RBBIM_STYLE) - rBand->fStyle |= RBBS_GRIPPERALWAYS; + { + if (!(rBand->fStyle & RBBS_NOGRIPPER)) + rBand->fStyle |= RBBS_GRIPPERALWAYS; + } else rBand->fStyle = RBBS_GRIPPERALWAYS; rBand->fMask |= RBBIM_ID | RBBIM_STYLE;