mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-26 23:34:44 +02:00
parent
e94036114b
commit
5184880161
@ -596,7 +596,14 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
if (wParam == 2)
|
if (wParam == 2)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (_doDragNDrop && !isMultiLine())
|
if (_doDragNDrop)
|
||||||
|
{
|
||||||
|
// ::DragDetect does not work with TCS_BUTTONS
|
||||||
|
if (::GetWindowLongPtr(_hSelf, GWL_STYLE) & TCS_BUTTONS)
|
||||||
|
{
|
||||||
|
_mightBeDragging = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
_nSrcTab = _nTabDragged = currentTabOn;
|
_nSrcTab = _nTabDragged = currentTabOn;
|
||||||
|
|
||||||
@ -611,6 +618,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
::SetCapture(hwnd);
|
::SetCapture(hwnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
notify(NM_CLICK, currentTabOn);
|
notify(NM_CLICK, currentTabOn);
|
||||||
|
|
||||||
@ -626,6 +634,24 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
//#define NPPM_INTERNAL_ISDRAGGING 40926
|
//#define NPPM_INTERNAL_ISDRAGGING 40926
|
||||||
case WM_MOUSEMOVE :
|
case WM_MOUSEMOVE :
|
||||||
{
|
{
|
||||||
|
if (_mightBeDragging && !_isDragging)
|
||||||
|
{
|
||||||
|
if (++_dragCount > 2)
|
||||||
|
{
|
||||||
|
int tabFocused = static_cast<int32_t>(::SendMessage(_hSelf, TCM_GETCURFOCUS, 0, 0));
|
||||||
|
int tabSelected = static_cast<int32_t>(::SendMessage(_hSelf, TCM_GETCURSEL, 0, 0));
|
||||||
|
|
||||||
|
// make sure the tab they are moving is active.
|
||||||
|
if (tabFocused != tabSelected)
|
||||||
|
{
|
||||||
|
setActiveTab(tabFocused);
|
||||||
|
}
|
||||||
|
|
||||||
|
_nSrcTab = _nTabDragged = tabFocused;
|
||||||
|
_isDragging = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
POINT p;
|
POINT p;
|
||||||
p.x = LOWORD(lParam);
|
p.x = LOWORD(lParam);
|
||||||
p.y = HIWORD(lParam);
|
p.y = HIWORD(lParam);
|
||||||
@ -732,6 +758,9 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara
|
|||||||
|
|
||||||
case WM_LBUTTONUP :
|
case WM_LBUTTONUP :
|
||||||
{
|
{
|
||||||
|
_mightBeDragging = false;
|
||||||
|
_dragCount = 0;
|
||||||
|
|
||||||
int xPos = LOWORD(lParam);
|
int xPos = LOWORD(lParam);
|
||||||
int yPos = HIWORD(lParam);
|
int yPos = HIWORD(lParam);
|
||||||
int currentTabOn = getTabIndexAt(xPos, yPos);
|
int currentTabOn = getTabIndexAt(xPos, yPos);
|
||||||
|
@ -223,6 +223,8 @@ protected:
|
|||||||
// it's the boss to decide if we do the drag N drop
|
// it's the boss to decide if we do the drag N drop
|
||||||
static bool _doDragNDrop;
|
static bool _doDragNDrop;
|
||||||
// drag N drop members
|
// drag N drop members
|
||||||
|
bool _mightBeDragging = false;
|
||||||
|
int _dragCount = 0;
|
||||||
bool _isDragging = false;
|
bool _isDragging = false;
|
||||||
bool _isDraggingInside = false;
|
bool _isDraggingInside = false;
|
||||||
int _nSrcTab = -1;
|
int _nSrcTab = -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user