From c5094fee8b08e306fb030c14b265edee5c2beff4 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sat, 9 Nov 2024 17:59:57 +0100 Subject: [PATCH] Refactoring to move the message definitions to the right place Move the message definitions of toolbar & tabbar to the right place. Close #15775 --- PowerEditor/src/Notepad_plus.cpp | 3 +- PowerEditor/src/Notepad_plus_Window.cpp | 2 +- PowerEditor/src/NppBigSwitch.cpp | 177 +++++++++++++++++- PowerEditor/src/NppCommands.cpp | 174 ----------------- PowerEditor/src/NppIO.cpp | 2 +- .../WinControls/Preference/preferenceDlg.cpp | 38 ++-- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 4 +- PowerEditor/src/menuCmdID.h | 28 +-- PowerEditor/src/resource.h | 18 +- 9 files changed, 230 insertions(+), 216 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 919e4c0d0..eb82b3dec 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -6685,7 +6685,8 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask) if (mask & (BufferChangeDirty|BufferChangeFilename)) { if (mask & BufferChangeFilename) - command(IDM_VIEW_REFRESHTABAR); + ::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0); + checkDocState(); setTitle(); wstring dir(buffer->getFullPathName()); diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 7b006fff2..4c2f5cc06 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -146,7 +146,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdL } if ((nppGUI._tabStatus & TAB_MULTILINE) != 0) - ::SendMessage(_hSelf, WM_COMMAND, IDM_VIEW_DRAWTABBAR_MULTILINE, 0); + ::SendMessage(_hSelf, NPPM_INTERNAL_MULTILINETABBAR, 0, 0); if (!nppGUI._menuBarShow) ::SetMenu(_hSelf, NULL); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 0d3cc1e1e..2ce2c1bce 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -3695,7 +3695,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa _subDocTab.setCloseBtnImageList(); _mainDocTab.setPinBtnImageList(); _subDocTab.setPinBtnImageList(); - ::SendMessage(_pPublicInterface->getHSelf(), WM_COMMAND, IDM_VIEW_REDUCETABBAR, 0); + ::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REDUCETABBAR, 0, 0); changeDocumentListIconSet(false); @@ -3781,7 +3781,180 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa return fileName.length(); } - case NPPM_INTERNAL_DRAWTABBARPINBOTTUN: + case NPPM_INTERNAL_TOOLBARREDUCE: + { + toolBarStatusType state = _toolBar.getState(); + + if (state != TB_SMALL) + { + _toolBar.reduce(); + } + } + break; + + case NPPM_INTERNAL_TOOLBARENLARGE: + { + toolBarStatusType state = _toolBar.getState(); + + if (state != TB_LARGE) + { + _toolBar.enlarge(); + } + } + break; + + case NPPM_INTERNAL_TOOLBARREDUCESET2: + { + toolBarStatusType state = _toolBar.getState(); + + if (state != TB_SMALL2) + { + _toolBar.reduceToSet2(); + } + } + break; + + case NPPM_INTERNAL_TOOLBARENLARGESET2: + { + toolBarStatusType state = _toolBar.getState(); + + if (state != TB_LARGE2) + { + _toolBar.enlargeToSet2(); + } + } + break; + + case NPPM_INTERNAL_TOOLBARSTANDARD: + { + toolBarStatusType state = _toolBar.getState(); + + if (state != TB_STANDARD) + { + _toolBar.setToBmpIcons(); + } + } + break; + + case NPPM_INTERNAL_REDUCETABBAR: + { + bool isReduceed = TabBarPlus::isReduced(); + + //Resize the tab height + int tabDpiDynamicalWidth = _mainDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? g_TabWidthCloseBtn : g_TabWidth); + int tabDpiDynamicalHeight = _mainDocTab.dpiManager().scale(isReduceed ? g_TabHeight : g_TabHeightLarge); + + TabCtrl_SetPadding(_mainDocTab.getHSelf(), _mainDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? 10 : 6), 0); + TabCtrl_SetPadding(_subDocTab.getHSelf(), _subDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? 10 : 6), 0); + + TabCtrl_SetItemSize(_mainDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); + TabCtrl_SetItemSize(_subDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); + + //change the font + const auto& hf = _mainDocTab.getFont(isReduceed); + if (hf) + { + ::SendMessage(_mainDocTab.getHSelf(), WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); + ::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); + } + + ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); + break; + } + + case NPPM_INTERNAL_REFRESHTABAR: + { + ::InvalidateRect(_mainDocTab.getHSelf(), NULL, TRUE); + ::InvalidateRect(_subDocTab.getHSelf(), NULL, TRUE); + + break; + } + case NPPM_INTERNAL_LOCKTABBAR: + { + bool isDrag = TabBarPlus::doDragNDropOrNot(); + TabBarPlus::doDragNDrop(!isDrag); + break; + } + + + case NPPM_INTERNAL_DRAWINACIVETAB: + { + TabBarPlus::setDrawInactiveTab(!TabBarPlus::drawInactiveTab(), &_mainDocTab); + break; + } + case NPPM_INTERNAL_DRAWTABTOPBAR: + { + TabBarPlus::setDrawTopBar(!TabBarPlus::drawTopBar(), &_mainDocTab); + break; + } + + case NPPM_INTERNAL_TABDBCLK2CLOSE: + { + TabBarPlus::setDbClk2Close(!TabBarPlus::isDbClk2Close()); + break; + } + + case NPPM_INTERNAL_VERTICALTABBAR: + { + TabBarPlus::setVertical(!TabBarPlus::isVertical()); + ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); + break; + } + + case NPPM_INTERNAL_MULTILINETABBAR: + { + TabBarPlus::setMultiLine(!TabBarPlus::isMultiLine()); + ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); + break; + } + + case NPPM_INTERNAL_DRAWTABBARCLOSEBUTTON: + { + TabBarPlus::setDrawTabCloseButton(!TabBarPlus::drawTabCloseButton(), &_mainDocTab); + + bool drawTabPinButton = TabBarPlus::drawTabPinButton(); + bool drawTabCloseButton = TabBarPlus::drawTabCloseButton(); + + if (drawTabCloseButton && drawTabPinButton) + { + _mainDocTab.setTabCloseButtonOrder(0); + _mainDocTab.setTabPinButtonOrder(1); + _subDocTab.setTabCloseButtonOrder(0); + _subDocTab.setTabPinButtonOrder(1); + } + else if (!drawTabCloseButton && drawTabPinButton) + { + _mainDocTab.setTabCloseButtonOrder(-1); + _mainDocTab.setTabPinButtonOrder(0); + _subDocTab.setTabCloseButtonOrder(-1); + _subDocTab.setTabPinButtonOrder(0); + } + else if (drawTabCloseButton && !drawTabPinButton) + { + _mainDocTab.setTabCloseButtonOrder(0); + _mainDocTab.setTabPinButtonOrder(-1); + _subDocTab.setTabCloseButtonOrder(0); + _subDocTab.setTabPinButtonOrder(-1); + } + else //if (!drawTabCloseButton && !drawTabPinButton) + { + _mainDocTab.setTabCloseButtonOrder(-1); + _mainDocTab.setTabPinButtonOrder(-1); + _subDocTab.setTabCloseButtonOrder(-1); + _subDocTab.setTabPinButtonOrder(-1); + } + + // This part is just for updating (redraw) the tabs + int tabDpiDynamicalHeight = _mainDocTab.dpiManager().scale(TabBarPlus::isReduced() ? g_TabHeight : g_TabHeightLarge); + int tabDpiDynamicalWidth = _mainDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? g_TabWidthCloseBtn : g_TabWidth); + TabCtrl_SetItemSize(_mainDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); + TabCtrl_SetItemSize(_subDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); + + ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); + break; + } + + case NPPM_INTERNAL_DRAWTABBARPINBUTTON: { TabBarPlus::setDrawTabPinButton(!TabBarPlus::drawTabPinButton(), &_mainDocTab); diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 38d71d0e8..d7cf45af3 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -2239,180 +2239,6 @@ void Notepad_plus::command(int id) _isFolding = false; break; - - case IDM_VIEW_TOOLBAR_REDUCE: - { - toolBarStatusType state = _toolBar.getState(); - - if (state != TB_SMALL) - { - _toolBar.reduce(); - } - } - break; - - case IDM_VIEW_TOOLBAR_ENLARGE: - { - toolBarStatusType state = _toolBar.getState(); - - if (state != TB_LARGE) - { - _toolBar.enlarge(); - } - } - break; - - case IDM_VIEW_TOOLBAR_REDUCE_SET2: - { - toolBarStatusType state = _toolBar.getState(); - - if (state != TB_SMALL2) - { - _toolBar.reduceToSet2(); - } - } - break; - - case IDM_VIEW_TOOLBAR_ENLARGE_SET2: - { - toolBarStatusType state = _toolBar.getState(); - - if (state != TB_LARGE2) - { - _toolBar.enlargeToSet2(); - } - } - break; - - case IDM_VIEW_TOOLBAR_STANDARD: - { - toolBarStatusType state = _toolBar.getState(); - - if (state != TB_STANDARD) - { - _toolBar.setToBmpIcons(); - } - } - break; - - case IDM_VIEW_REDUCETABBAR: - { - bool isReduceed = TabBarPlus::isReduced(); - - //Resize the tab height - int tabDpiDynamicalWidth = _mainDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? g_TabWidthCloseBtn : g_TabWidth); - int tabDpiDynamicalHeight = _mainDocTab.dpiManager().scale(isReduceed ? g_TabHeight : g_TabHeightLarge); - - TabCtrl_SetPadding(_mainDocTab.getHSelf(), _mainDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? 10 : 6), 0); - TabCtrl_SetPadding(_subDocTab.getHSelf(), _subDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? 10 : 6), 0); - - TabCtrl_SetItemSize(_mainDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); - TabCtrl_SetItemSize(_subDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); - - //change the font - const auto& hf = _mainDocTab.getFont(isReduceed); - if (hf) - { - ::SendMessage(_mainDocTab.getHSelf(), WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); - ::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, reinterpret_cast(hf), MAKELPARAM(TRUE, 0)); - } - - ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); - break; - } - - case IDM_VIEW_REFRESHTABAR : - { - ::InvalidateRect(_mainDocTab.getHSelf(), NULL, TRUE); - ::InvalidateRect(_subDocTab.getHSelf(), NULL, TRUE); - - break; - } - case IDM_VIEW_LOCKTABBAR: - { - bool isDrag = TabBarPlus::doDragNDropOrNot(); - TabBarPlus::doDragNDrop(!isDrag); - break; - } - - - case IDM_VIEW_DRAWTABBAR_INACIVETAB: - { - TabBarPlus::setDrawInactiveTab(!TabBarPlus::drawInactiveTab(), &_mainDocTab); - break; - } - case IDM_VIEW_DRAWTABBAR_TOPBAR: - { - TabBarPlus::setDrawTopBar(!TabBarPlus::drawTopBar(), &_mainDocTab); - break; - } - - case IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN: - { - TabBarPlus::setDrawTabCloseButton(!TabBarPlus::drawTabCloseButton(), &_mainDocTab); - - bool drawTabPinButton = TabBarPlus::drawTabPinButton(); - bool drawTabCloseButton = TabBarPlus::drawTabCloseButton(); - - if (drawTabCloseButton && drawTabPinButton) - { - _mainDocTab.setTabCloseButtonOrder(0); - _mainDocTab.setTabPinButtonOrder(1); - _subDocTab.setTabCloseButtonOrder(0); - _subDocTab.setTabPinButtonOrder(1); - } - else if (!drawTabCloseButton && drawTabPinButton) - { - _mainDocTab.setTabCloseButtonOrder(-1); - _mainDocTab.setTabPinButtonOrder(0); - _subDocTab.setTabCloseButtonOrder(-1); - _subDocTab.setTabPinButtonOrder(0); - } - else if (drawTabCloseButton && !drawTabPinButton) - { - _mainDocTab.setTabCloseButtonOrder(0); - _mainDocTab.setTabPinButtonOrder(-1); - _subDocTab.setTabCloseButtonOrder(0); - _subDocTab.setTabPinButtonOrder(-1); - } - else //if (!drawTabCloseButton && !drawTabPinButton) - { - _mainDocTab.setTabCloseButtonOrder(-1); - _mainDocTab.setTabPinButtonOrder(-1); - _subDocTab.setTabCloseButtonOrder(-1); - _subDocTab.setTabPinButtonOrder(-1); - } - - // This part is just for updating (redraw) the tabs - int tabDpiDynamicalHeight = _mainDocTab.dpiManager().scale(TabBarPlus::isReduced() ? g_TabHeight : g_TabHeightLarge); - int tabDpiDynamicalWidth = _mainDocTab.dpiManager().scale(TabBarPlus::drawTabCloseButton() ? g_TabWidthCloseBtn : g_TabWidth); - TabCtrl_SetItemSize(_mainDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); - TabCtrl_SetItemSize(_subDocTab.getHSelf(), tabDpiDynamicalWidth, tabDpiDynamicalHeight); - - ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); - break; - } - - case IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE : - { - TabBarPlus::setDbClk2Close(!TabBarPlus::isDbClk2Close()); - break; - } - - case IDM_VIEW_DRAWTABBAR_VERTICAL : - { - TabBarPlus::setVertical(!TabBarPlus::isVertical()); - ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); - break; - } - - case IDM_VIEW_DRAWTABBAR_MULTILINE : - { - TabBarPlus::setMultiLine(!TabBarPlus::isMultiLine()); - ::SendMessage(_pPublicInterface->getHSelf(), WM_SIZE, 0, 0); - break; - } - case IDM_VIEW_FULLSCREENTOGGLE: { if (!_beforeSpecialView._isDistractionFree) diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index da669484b..64336e137 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -878,7 +878,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup) if (buffID == BUFFER_INVALID && fileFullPath.length() > 0) _lastRecentFileList.add(fileFullPath.c_str()); } - command(IDM_VIEW_REFRESHTABAR); + ::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0); if (NppParameters::getInstance().getNppGUI()._tabStatus & TAB_QUITONEMPTY) { diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index cedd39e8e..cf80c5b1a 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -333,32 +333,32 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM case TB_LARGE: { checkOrUncheckBtn(IDC_RADIO_BIGICON, BST_CHECKED); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_ENLARGE, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARENLARGE, 0, 0); break; } case TB_SMALL2: { checkOrUncheckBtn(IDC_RADIO_SMALLICON2, BST_CHECKED); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_REDUCE_SET2, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARREDUCESET2, 0, 0); break; } case TB_LARGE2: { checkOrUncheckBtn(IDC_RADIO_BIGICON2, BST_CHECKED); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_ENLARGE_SET2, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARENLARGESET2, 0, 0); break; } case TB_STANDARD: { checkOrUncheckBtn(IDC_RADIO_STANDARD, BST_CHECKED); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_STANDARD, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARSTANDARD, 0, 0); break; } //case TB_SMALL: default: { checkOrUncheckBtn(IDC_RADIO_SMALLICON, BST_CHECKED); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_REDUCE, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARREDUCE, 0, 0); } } @@ -710,11 +710,11 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM } case IDC_CHECK_TAB_VERTICAL: - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_VERTICAL, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_VERTICALTABBAR, 0, 0); return TRUE; case IDC_CHECK_TAB_MULTILINE : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_MULTILINE, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_MULTILINETABBAR, 0, 0); return TRUE; case IDC_CHECK_TAB_LAST_EXIT: @@ -739,32 +739,32 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM { const bool isChecked = isCheckedOrNot(IDC_CHECK_REDUCE); TabBarPlus::setReduced(isChecked); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REDUCETABBAR, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_REDUCETABBAR, 0, 0); return TRUE; } case IDC_CHECK_LOCK : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LOCKTABBAR, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_LOCKTABBAR, 0, 0); return TRUE; case IDC_CHECK_ORANGE : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_TOPBAR, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABTOPBAR, 0, 0); return TRUE; case IDC_CHECK_DRAWINACTIVE : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_INACIVETAB, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWINACIVETAB, 0, 0); return TRUE; case IDC_CHECK_ENABLETABCLOSE : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARCLOSEBUTTON, 0, 0); return TRUE; case IDC_CHECK_ENABLETABPIN: - ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARPINBOTTUN, 0, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARPINBUTTON, 0, 0); return TRUE; case IDC_CHECK_DBCLICK2CLOSE : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TABDBCLK2CLOSE, 0, 0); return TRUE; case IDC_CHECK_HIDE : @@ -775,27 +775,27 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM return TRUE; case IDC_RADIO_SMALLICON : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_REDUCE, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARREDUCE, 0, 0); NppDarkMode::setToolBarIconSet(0, NppDarkMode::isEnabled()); return TRUE; case IDC_RADIO_BIGICON : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_ENLARGE, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARENLARGE, 0, 0); NppDarkMode::setToolBarIconSet(1, NppDarkMode::isEnabled()); return TRUE; case IDC_RADIO_SMALLICON2: - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_REDUCE_SET2, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARREDUCESET2, 0, 0); NppDarkMode::setToolBarIconSet(2, NppDarkMode::isEnabled()); return TRUE; case IDC_RADIO_BIGICON2: - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_ENLARGE_SET2, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARENLARGESET2, 0, 0); NppDarkMode::setToolBarIconSet(3, NppDarkMode::isEnabled()); return TRUE; case IDC_RADIO_STANDARD : - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_STANDARD, 0); + ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARSTANDARD, 0, 0); NppDarkMode::setToolBarIconSet(4, NppDarkMode::isEnabled()); return TRUE; diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 87cd74812..a63970cb6 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -767,7 +767,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara if (_closeButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical)) { _whichCloseClickDown = getTabIndexAt(xPos, yPos); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REFRESHTABAR, 0); + ::SendMessage(_hParent, NPPM_INTERNAL_REFRESHTABAR, 0, 0); return TRUE; } } @@ -777,7 +777,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara if (_pinButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical)) { _whichPinClickDown = getTabIndexAt(xPos, yPos); - ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REFRESHTABAR, 0); + ::SendMessage(_hParent, NPPM_INTERNAL_REFRESHTABAR, 0, 0); return TRUE; } } diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index ffe43b6e1..1108d1f36 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -274,13 +274,13 @@ #define IDM_VIEW (IDM + 4000) //#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1) - #define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2) - #define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3) - #define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4) - #define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5) - #define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6) - #define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) - #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) + //#define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2) + //#define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3) + //#define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4) + //#define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5) + //#define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6) + //#define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) + //#define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) #define IDM_VIEW_POSTIT (IDM_VIEW + 9) #define IDM_VIEW_FOLDALL (IDM_VIEW + 10) #define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11) @@ -299,8 +299,8 @@ #define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24) #define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25) #define IDM_VIEW_EOL (IDM_VIEW + 26) - #define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) - #define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) + //#define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) + //#define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) #define IDM_VIEW_UNFOLDALL (IDM_VIEW + 29) #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30) #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31) @@ -310,13 +310,13 @@ #define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35) #define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36) //#define IDM_VIEW_EDGENONE (IDM_VIEW + 37) - #define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) - #define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) - #define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) + //#define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) + //#define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) + //#define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) #define IDM_VIEW_WRAP_SYMBOL (IDM_VIEW + 41) #define IDM_VIEW_HIDELINES (IDM_VIEW + 42) - #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) - #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) + //#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) + //#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) //#define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) #define IDM_VIEW_LWDEF (IDM_VIEW + 46) #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) diff --git a/PowerEditor/src/resource.h b/PowerEditor/src/resource.h index fc9cbae79..1d4edc667 100644 --- a/PowerEditor/src/resource.h +++ b/PowerEditor/src/resource.h @@ -706,8 +706,22 @@ #define NPPM_INTERNAL_CHECKUNDOREDOSTATE (NOTEPADPLUS_USER_INTERNAL + 77) #define NPPM_INTERNAL_LINECUTCOPYWITHOUTSELECTION (NOTEPADPLUS_USER_INTERNAL + 78) #define NPPM_INTERNAL_DOCMODIFIEDBYREPLACEALL (NOTEPADPLUS_USER_INTERNAL + 79) - - #define NPPM_INTERNAL_DRAWTABBARPINBOTTUN (NOTEPADPLUS_USER_INTERNAL + 80) + #define NPPM_INTERNAL_DRAWTABBARPINBUTTON (NOTEPADPLUS_USER_INTERNAL + 80) + #define NPPM_INTERNAL_DRAWTABBARCLOSEBUTTON (NOTEPADPLUS_USER_INTERNAL + 81) + #define NPPM_INTERNAL_REFRESHTABAR (NOTEPADPLUS_USER_INTERNAL + 82) + #define NPPM_INTERNAL_REDUCETABBAR (NOTEPADPLUS_USER_INTERNAL + 83) + #define NPPM_INTERNAL_LOCKTABBAR (NOTEPADPLUS_USER_INTERNAL + 84) + #define NPPM_INTERNAL_DRAWINACIVETAB (NOTEPADPLUS_USER_INTERNAL + 85) + #define NPPM_INTERNAL_DRAWTABTOPBAR (NOTEPADPLUS_USER_INTERNAL + 86) + #define NPPM_INTERNAL_TABDBCLK2CLOSE (NOTEPADPLUS_USER_INTERNAL + 87) + #define NPPM_INTERNAL_VERTICALTABBAR (NOTEPADPLUS_USER_INTERNAL + 88) + #define NPPM_INTERNAL_MULTILINETABBAR (NOTEPADPLUS_USER_INTERNAL + 89) + + #define NPPM_INTERNAL_TOOLBARREDUCE (NOTEPADPLUS_USER_INTERNAL + 90) + #define NPPM_INTERNAL_TOOLBARREDUCESET2 (NOTEPADPLUS_USER_INTERNAL + 91) + #define NPPM_INTERNAL_TOOLBARENLARGE (NOTEPADPLUS_USER_INTERNAL + 92) + #define NPPM_INTERNAL_TOOLBARENLARGESET2 (NOTEPADPLUS_USER_INTERNAL + 93) + #define NPPM_INTERNAL_TOOLBARSTANDARD (NOTEPADPLUS_USER_INTERNAL + 94) // See Notepad_plus_msgs.h //#define NOTEPADPLUS_USER (WM_USER + 1000)