Refactoring to move the message definitions to the right place

Move the message definitions of toolbar & tabbar to the right place.

Close #15775
pull/15784/head
Don Ho 2 weeks ago
parent d9c24ad78f
commit c5094fee8b

@ -6685,7 +6685,8 @@ void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask)
if (mask & (BufferChangeDirty|BufferChangeFilename)) if (mask & (BufferChangeDirty|BufferChangeFilename))
{ {
if (mask & BufferChangeFilename) if (mask & BufferChangeFilename)
command(IDM_VIEW_REFRESHTABAR); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0);
checkDocState(); checkDocState();
setTitle(); setTitle();
wstring dir(buffer->getFullPathName()); wstring dir(buffer->getFullPathName());

@ -146,7 +146,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdL
} }
if ((nppGUI._tabStatus & TAB_MULTILINE) != 0) 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) if (!nppGUI._menuBarShow)
::SetMenu(_hSelf, NULL); ::SetMenu(_hSelf, NULL);

@ -3695,7 +3695,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
_subDocTab.setCloseBtnImageList(); _subDocTab.setCloseBtnImageList();
_mainDocTab.setPinBtnImageList(); _mainDocTab.setPinBtnImageList();
_subDocTab.setPinBtnImageList(); _subDocTab.setPinBtnImageList();
::SendMessage(_pPublicInterface->getHSelf(), WM_COMMAND, IDM_VIEW_REDUCETABBAR, 0); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REDUCETABBAR, 0, 0);
changeDocumentListIconSet(false); changeDocumentListIconSet(false);
@ -3781,7 +3781,180 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return fileName.length(); 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<WPARAM>(hf), MAKELPARAM(TRUE, 0));
::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, reinterpret_cast<WPARAM>(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); TabBarPlus::setDrawTabPinButton(!TabBarPlus::drawTabPinButton(), &_mainDocTab);

@ -2239,180 +2239,6 @@ void Notepad_plus::command(int id)
_isFolding = false; _isFolding = false;
break; 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<WPARAM>(hf), MAKELPARAM(TRUE, 0));
::SendMessage(_subDocTab.getHSelf(), WM_SETFONT, reinterpret_cast<WPARAM>(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: case IDM_VIEW_FULLSCREENTOGGLE:
{ {
if (!_beforeSpecialView._isDistractionFree) if (!_beforeSpecialView._isDistractionFree)

@ -878,7 +878,7 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup)
if (buffID == BUFFER_INVALID && fileFullPath.length() > 0) if (buffID == BUFFER_INVALID && fileFullPath.length() > 0)
_lastRecentFileList.add(fileFullPath.c_str()); _lastRecentFileList.add(fileFullPath.c_str());
} }
command(IDM_VIEW_REFRESHTABAR); ::SendMessage(_pPublicInterface->getHSelf(), NPPM_INTERNAL_REFRESHTABAR, 0, 0);
if (NppParameters::getInstance().getNppGUI()._tabStatus & TAB_QUITONEMPTY) if (NppParameters::getInstance().getNppGUI()._tabStatus & TAB_QUITONEMPTY)
{ {

@ -333,32 +333,32 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
case TB_LARGE: case TB_LARGE:
{ {
checkOrUncheckBtn(IDC_RADIO_BIGICON, BST_CHECKED); checkOrUncheckBtn(IDC_RADIO_BIGICON, BST_CHECKED);
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_ENLARGE, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARENLARGE, 0, 0);
break; break;
} }
case TB_SMALL2: case TB_SMALL2:
{ {
checkOrUncheckBtn(IDC_RADIO_SMALLICON2, BST_CHECKED); 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; break;
} }
case TB_LARGE2: case TB_LARGE2:
{ {
checkOrUncheckBtn(IDC_RADIO_BIGICON2, BST_CHECKED); 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; break;
} }
case TB_STANDARD: case TB_STANDARD:
{ {
checkOrUncheckBtn(IDC_RADIO_STANDARD, BST_CHECKED); checkOrUncheckBtn(IDC_RADIO_STANDARD, BST_CHECKED);
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_TOOLBAR_STANDARD, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TOOLBARSTANDARD, 0, 0);
break; break;
} }
//case TB_SMALL: //case TB_SMALL:
default: default:
{ {
checkOrUncheckBtn(IDC_RADIO_SMALLICON, BST_CHECKED); 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: case IDC_CHECK_TAB_VERTICAL:
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_VERTICAL, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_VERTICALTABBAR, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_TAB_MULTILINE : case IDC_CHECK_TAB_MULTILINE :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_MULTILINE, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_MULTILINETABBAR, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_TAB_LAST_EXIT: 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); const bool isChecked = isCheckedOrNot(IDC_CHECK_REDUCE);
TabBarPlus::setReduced(isChecked); TabBarPlus::setReduced(isChecked);
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REDUCETABBAR, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_REDUCETABBAR, 0, 0);
return TRUE; return TRUE;
} }
case IDC_CHECK_LOCK : case IDC_CHECK_LOCK :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LOCKTABBAR, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_LOCKTABBAR, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_ORANGE : case IDC_CHECK_ORANGE :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_TOPBAR, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABTOPBAR, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_DRAWINACTIVE : case IDC_CHECK_DRAWINACTIVE :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_INACIVETAB, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWINACIVETAB, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_ENABLETABCLOSE : case IDC_CHECK_ENABLETABCLOSE :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARCLOSEBUTTON, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_ENABLETABPIN: case IDC_CHECK_ENABLETABPIN:
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARPINBOTTUN, 0, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_DRAWTABBARPINBUTTON, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_DBCLICK2CLOSE : case IDC_CHECK_DBCLICK2CLOSE :
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE, 0); ::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_TABDBCLK2CLOSE, 0, 0);
return TRUE; return TRUE;
case IDC_CHECK_HIDE : case IDC_CHECK_HIDE :
@ -775,27 +775,27 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
return TRUE; return TRUE;
case IDC_RADIO_SMALLICON : 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()); NppDarkMode::setToolBarIconSet(0, NppDarkMode::isEnabled());
return TRUE; return TRUE;
case IDC_RADIO_BIGICON : 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()); NppDarkMode::setToolBarIconSet(1, NppDarkMode::isEnabled());
return TRUE; return TRUE;
case IDC_RADIO_SMALLICON2: 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()); NppDarkMode::setToolBarIconSet(2, NppDarkMode::isEnabled());
return TRUE; return TRUE;
case IDC_RADIO_BIGICON2: 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()); NppDarkMode::setToolBarIconSet(3, NppDarkMode::isEnabled());
return TRUE; return TRUE;
case IDC_RADIO_STANDARD : 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()); NppDarkMode::setToolBarIconSet(4, NppDarkMode::isEnabled());
return TRUE; return TRUE;

@ -767,7 +767,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
if (_closeButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical)) if (_closeButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical))
{ {
_whichCloseClickDown = getTabIndexAt(xPos, yPos); _whichCloseClickDown = getTabIndexAt(xPos, yPos);
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REFRESHTABAR, 0); ::SendMessage(_hParent, NPPM_INTERNAL_REFRESHTABAR, 0, 0);
return TRUE; return TRUE;
} }
} }
@ -777,7 +777,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
if (_pinButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical)) if (_pinButtonZone.isHit(xPos, yPos, _currentHoverTabRect, _isVertical))
{ {
_whichPinClickDown = getTabIndexAt(xPos, yPos); _whichPinClickDown = getTabIndexAt(xPos, yPos);
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_REFRESHTABAR, 0); ::SendMessage(_hParent, NPPM_INTERNAL_REFRESHTABAR, 0, 0);
return TRUE; return TRUE;
} }
} }

@ -274,13 +274,13 @@
#define IDM_VIEW (IDM + 4000) #define IDM_VIEW (IDM + 4000)
//#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1) //#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1)
#define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2) //#define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2)
#define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3) //#define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3)
#define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4) //#define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4)
#define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5) //#define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5)
#define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6) //#define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6)
#define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) //#define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7)
#define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) //#define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8)
#define IDM_VIEW_POSTIT (IDM_VIEW + 9) #define IDM_VIEW_POSTIT (IDM_VIEW + 9)
#define IDM_VIEW_FOLDALL (IDM_VIEW + 10) #define IDM_VIEW_FOLDALL (IDM_VIEW + 10)
#define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11) #define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11)
@ -299,8 +299,8 @@
#define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24) #define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24)
#define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25) #define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25)
#define IDM_VIEW_EOL (IDM_VIEW + 26) #define IDM_VIEW_EOL (IDM_VIEW + 26)
#define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) //#define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27)
#define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) //#define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28)
#define IDM_VIEW_UNFOLDALL (IDM_VIEW + 29) #define IDM_VIEW_UNFOLDALL (IDM_VIEW + 29)
#define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30) #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30)
#define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31) #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31)
@ -310,13 +310,13 @@
#define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35) #define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35)
#define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36) #define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36)
//#define IDM_VIEW_EDGENONE (IDM_VIEW + 37) //#define IDM_VIEW_EDGENONE (IDM_VIEW + 37)
#define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) //#define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38)
#define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) //#define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39)
#define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) //#define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40)
#define IDM_VIEW_WRAP_SYMBOL (IDM_VIEW + 41) #define IDM_VIEW_WRAP_SYMBOL (IDM_VIEW + 41)
#define IDM_VIEW_HIDELINES (IDM_VIEW + 42) #define IDM_VIEW_HIDELINES (IDM_VIEW + 42)
#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) //#define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43)
#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) //#define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44)
//#define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) //#define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45)
#define IDM_VIEW_LWDEF (IDM_VIEW + 46) #define IDM_VIEW_LWDEF (IDM_VIEW + 46)
#define IDM_VIEW_LWALIGN (IDM_VIEW + 47) #define IDM_VIEW_LWALIGN (IDM_VIEW + 47)

@ -706,8 +706,22 @@
#define NPPM_INTERNAL_CHECKUNDOREDOSTATE (NOTEPADPLUS_USER_INTERNAL + 77) #define NPPM_INTERNAL_CHECKUNDOREDOSTATE (NOTEPADPLUS_USER_INTERNAL + 77)
#define NPPM_INTERNAL_LINECUTCOPYWITHOUTSELECTION (NOTEPADPLUS_USER_INTERNAL + 78) #define NPPM_INTERNAL_LINECUTCOPYWITHOUTSELECTION (NOTEPADPLUS_USER_INTERNAL + 78)
#define NPPM_INTERNAL_DOCMODIFIEDBYREPLACEALL (NOTEPADPLUS_USER_INTERNAL + 79) #define NPPM_INTERNAL_DOCMODIFIEDBYREPLACEALL (NOTEPADPLUS_USER_INTERNAL + 79)
#define NPPM_INTERNAL_DRAWTABBARPINBUTTON (NOTEPADPLUS_USER_INTERNAL + 80)
#define NPPM_INTERNAL_DRAWTABBARPINBOTTUN (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 // See Notepad_plus_msgs.h
//#define NOTEPADPLUS_USER (WM_USER + 1000) //#define NOTEPADPLUS_USER (WM_USER + 1000)

Loading…
Cancel
Save