Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions dependency/MainDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,11 @@ LRESULT CMainDlg::OnLButtonDown(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOO
int y = GET_Y_LPARAM(lParam);
if (x >= left_spliter_xpos_ - kSpliterHitTestWidth && x <= left_spliter_xpos_ + kSpliterHitTestWidth) {
left_splitting = true;
::SetCapture(m_hWnd);
}
else if (y >= right_spliter_ypos - kSpliterHitTestWidth && y <= right_spliter_ypos + kSpliterHitTestWidth) {
right_splitting = true;
::SetCapture(m_hWnd);
}
return 0;
}
Expand All @@ -678,14 +680,9 @@ LRESULT CMainDlg::OnMouseMove(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL&
int y = GET_Y_LPARAM(lParam);
if (x >= left_spliter_xpos_ - kSpliterHitTestWidth && x <= left_spliter_xpos_ + kSpliterHitTestWidth) {
::SetCursor(left_spliter_cursor);
::SetCapture(m_hWnd);
}
else if (y >= right_spliter_ypos - kSpliterHitTestWidth && y <= right_spliter_ypos + kSpliterHitTestWidth) {
::SetCursor(right_spliter_cursor);
::SetCapture(m_hWnd);
}
else {
::ReleaseCapture();
}
if (wParam == MK_LBUTTON && (left_splitting || right_splitting)) {
RECT rc;
Expand All @@ -703,7 +700,7 @@ LRESULT CMainDlg::OnMouseMove(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL&
right_spliter_ypos = y;
}
//根据新的分界位置发送WM_SIZE消息,重新调整左右控件的位置
SendMessage(m_hWnd, WM_SIZE, 0, MAKELPARAM(rc.right, rc.bottom));
::PostMessage(m_hWnd, WM_SIZE, 0, MAKELPARAM(rc.right, rc.bottom));
}
return 0;
}
Expand Down