From 0598f46e9fb25a0085191412c9e3be45ed7a7eac Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 10 Dec 2011 09:24:45 +0000 Subject: [PATCH] [ENHANCE] Force incremental search bar use the gray background. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@847 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../src/ScitillaComponent/FindReplaceDlg.cpp | 2 +- .../src/ScitillaComponent/FindReplaceDlg.rc | 3 ++- .../src/ScitillaComponent/FindReplaceDlg_rc.h | 16 +++++++++------- PowerEditor/src/WinControls/ToolBar/ToolBar.cpp | 15 +++++++++++++++ PowerEditor/src/WinControls/ToolBar/ToolBar.h | 1 + PowerEditor/src/icons/incrementalBg.bmp | Bin 0 -> 822 bytes 6 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 PowerEditor/src/icons/incrementalBg.bmp diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 1c4913eca..2f6317b4b 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -2594,7 +2594,6 @@ BOOL CALLBACK FindIncrementDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) markSelectedTextInc(isHiLieAll, &fo); } return TRUE; - } } @@ -2685,4 +2684,5 @@ void FindIncrementDlg::addToRebar(ReBar * rebar) _rbBand.cxIdeal = _rbBand.cx = client.right-client.left; _pRebar->addBand(&_rbBand, true); + _pRebar->setGrayBackground(_rbBand.wID); } diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc index f828b2c52..d14ace868 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.rc @@ -76,6 +76,7 @@ BEGIN CONTROL "",IDC_PERCENTAGE_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,271,166,53,10 END +IDB_INCREMENTAL_BG BITMAP "..\\icons\\incrementalBg.bmp" IDD_INCREMENT_FIND DIALOGEX 0, 0, 400, 20 STYLE DS_SYSMODAL | DS_CONTROL | DS_FIXEDSYS | WS_CHILD | WS_CLIPCHILDREN @@ -84,7 +85,7 @@ 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,4,175,12,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 diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h index 2725bb354..3c79b1580 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg_rc.h @@ -26,10 +26,6 @@ #define IDMATCHCASE 1604 #define IDF_MATCHCASE 2 -#define IDC_MODE_STATIC 1624 -#define IDNORMAL 1625 -#define IDEXTENDED 1626 - #define IDREGEXP 1605 #define IDWRAP 1606 @@ -57,6 +53,10 @@ #define IDC_PERCENTAGE_SLIDER 1622 #define IDC_TRANSPARENT_GRPBOX 1623 +#define IDC_MODE_STATIC 1624 +#define IDNORMAL 1625 +#define IDEXTENDED 1626 + #define IDC_FIND_IN_STATIC 1628 //#define IDC_CURRENT_FILE_RADIO 1629 //#define IDC_OPENED_FILES_RADIO 1630 @@ -96,12 +96,14 @@ #define IDC_INCFINDPREVOK 1683 #define IDC_INCFINDNXTOK 1684 #define IDC_INCFINDMATCHCASE 1685 -#define IDC_INCFINDHILITEALL 1686 -#define IDC_INCFINDSTATUS 1689 - #define IDC_TRANSPARENT_CHECK 1686 #define IDC_TRANSPARENT_LOSSFOCUS_RADIO 1687 #define IDC_TRANSPARENT_ALWAYS_RADIO 1688 +#define IDC_INCFINDSTATUS 1689 +#define IDC_INCFINDHILITEALL 1690 + +#define IDB_INCREMENTAL_BG 1691 + #define IDC_FRCOMMAND_INIT 1700 #define IDC_FRCOMMAND_EXEC 1701 diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp index 624c1583b..41b19cc34 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp @@ -19,6 +19,7 @@ #include "ToolBar.h" #include "Shortcut.h" #include "Parameters.h" +#include "FindReplaceDlg_rc.h" const int WS_TOOLBARSTYLE = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | CCS_TOP | BTNS_AUTOSIZE | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_NODIVIDER; @@ -433,6 +434,20 @@ bool ReBar::getIDVisible(int id) return ((rbBand.fStyle & RBBS_HIDDEN) == 0); } + +void ReBar::setGrayBackground(int id) +{ + int index = (int)SendMessage(_hSelf, RB_IDTOINDEX, (WPARAM)id, 0); + if (index == -1 ) + return; //error + REBARBANDINFO rbBand; + ZeroMemory(&rbBand, REBARBAND_SIZE); + rbBand.cbSize = REBARBAND_SIZE; + rbBand.fMask = RBBIM_BACKGROUND; + rbBand.hbmBack = LoadBitmap((HINSTANCE)::GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_INCREMENTAL_BG)); + ::SendMessage(_hSelf, RB_SETBANDINFO, (WPARAM)index, (LPARAM)&rbBand); +} + int ReBar::getNewID() { int idToUse = REBAR_BAR_EXTERNAL; diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index 42e1462da..fe61c3bfd 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -183,6 +183,7 @@ public : void setIDVisible(int id, bool show); bool getIDVisible(int id); + void setGrayBackground(int id); private: vector usedIDs; diff --git a/PowerEditor/src/icons/incrementalBg.bmp b/PowerEditor/src/icons/incrementalBg.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a7b4e6b73bdf6a7cc6ea607c600430358ac35549 GIT binary patch literal 822 pcmZ?rHDhJ~12Z700mK4O%*Y@C76%bW_#hZ2@L?2;hQJ680RRfY(;@%> literal 0 HcmV?d00001