|
|
@ -40,16 +40,16 @@ static const WORD DotPattern[] =
|
|
|
|
#define MDLG_CLASS_NAME TEXT("moveDlg")
|
|
|
|
#define MDLG_CLASS_NAME TEXT("moveDlg")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Gripper
|
|
|
|
class Gripper final
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
Gripper();
|
|
|
|
Gripper() = default;;
|
|
|
|
|
|
|
|
|
|
|
|
void init(HINSTANCE hInst, HWND hParent) {
|
|
|
|
void init(HINSTANCE hInst, HWND hParent) {
|
|
|
|
_hInst = hInst;
|
|
|
|
_hInst = hInst;
|
|
|
|
_hParent = hParent;
|
|
|
|
_hParent = hParent;
|
|
|
|
DWORD hwndExStyle = (DWORD)GetWindowLongPtr(_hParent, GWL_EXSTYLE);
|
|
|
|
DWORD hwndExStyle = (DWORD)GetWindowLongPtr(_hParent, GWL_EXSTYLE);
|
|
|
|
isRTL = hwndExStyle & WS_EX_LAYOUTRTL;
|
|
|
|
_isRTL = hwndExStyle & WS_EX_LAYOUTRTL;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void startGrip(DockingCont* pCont, DockingManager* pDockMgr);
|
|
|
|
void startGrip(DockingCont* pCont, DockingManager* pDockMgr);
|
|
|
@ -99,7 +99,7 @@ protected :
|
|
|
|
ShrinkRcToSize(rc);
|
|
|
|
ShrinkRcToSize(rc);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
void ShrinkRcToSize(RECT *rc) {
|
|
|
|
void ShrinkRcToSize(RECT *rc) {
|
|
|
|
isRTL ? rc->right = rc->left - rc->right : rc->right -= rc->left;
|
|
|
|
_isRTL ? rc->right = rc->left - rc->right : rc->right -= rc->left;
|
|
|
|
rc->bottom -= rc->top;
|
|
|
|
rc->bottom -= rc->top;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
void DoCalcGripperRect(RECT* rc, RECT rcCorr, POINT pt) {
|
|
|
|
void DoCalcGripperRect(RECT* rc, RECT rcCorr, POINT pt) {
|
|
|
@ -111,41 +111,41 @@ protected :
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
// Handle
|
|
|
|
// Handle
|
|
|
|
HINSTANCE _hInst;
|
|
|
|
HINSTANCE _hInst = nullptr;
|
|
|
|
HWND _hParent;
|
|
|
|
HWND _hParent = nullptr;
|
|
|
|
HWND _hSelf;
|
|
|
|
HWND _hSelf = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
// data of container
|
|
|
|
// data of container
|
|
|
|
tDockMgr _dockData;
|
|
|
|
tDockMgr _dockData;
|
|
|
|
DockingManager *_pDockMgr;
|
|
|
|
DockingManager *_pDockMgr = nullptr;
|
|
|
|
DockingCont *_pCont;
|
|
|
|
DockingCont *_pCont = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
// mouse offset in moving rectangle
|
|
|
|
// mouse offset in moving rectangle
|
|
|
|
POINT _ptOffset;
|
|
|
|
POINT _ptOffset = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
// remembers old mouse point
|
|
|
|
// remembers old mouse point
|
|
|
|
POINT _ptOld;
|
|
|
|
POINT _ptOld = { 0 };
|
|
|
|
BOOL _bPtOldValid;
|
|
|
|
BOOL _bPtOldValid = FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
// remember last drawn rectangle (jg)
|
|
|
|
// remember last drawn rectangle (jg)
|
|
|
|
RECT _rcPrev;
|
|
|
|
RECT _rcPrev = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
// for sorting tabs
|
|
|
|
// for sorting tabs
|
|
|
|
HWND _hTab;
|
|
|
|
HWND _hTab = nullptr;
|
|
|
|
HWND _hTabSource;
|
|
|
|
HWND _hTabSource = nullptr;
|
|
|
|
BOOL _startMovingFromTab;
|
|
|
|
BOOL _startMovingFromTab = FALSE;
|
|
|
|
int _iItem;
|
|
|
|
int _iItem = 0;
|
|
|
|
RECT _rcItem;
|
|
|
|
RECT _rcItem = { 0 };
|
|
|
|
TCITEM _tcItem;
|
|
|
|
TCITEM _tcItem;
|
|
|
|
|
|
|
|
|
|
|
|
HDC _hdc;
|
|
|
|
HDC _hdc = nullptr;
|
|
|
|
HBITMAP _hbm;
|
|
|
|
HBITMAP _hbm = nullptr;
|
|
|
|
HBRUSH _hbrush;
|
|
|
|
HBRUSH _hbrush = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
// is class registered
|
|
|
|
// is class registered
|
|
|
|
static BOOL _isRegistered;
|
|
|
|
static BOOL _isRegistered;
|
|
|
|
|
|
|
|
|
|
|
|
// get layout direction
|
|
|
|
// get layout direction
|
|
|
|
bool isRTL;
|
|
|
|
bool _isRTL = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|