Fixed problems with drag cursor and table sizing

This commit is contained in:
cmanske%netscape.com 1998-10-15 19:34:55 +00:00
Родитель 4eb7c52086
Коммит 499c96d255
3 изменённых файлов: 9 добавлений и 12 удалений

Просмотреть файл

@ -2131,12 +2131,9 @@ CWinCX::OnLButtonDownForLayerCX(UINT uFlags, CPoint &cpPoint, XY& Point,
if( bSizeTable ||
(pElement && EDT_CanSizeObject(pMWContext, pElement, Point.x, Point.y)) )
{
// Flag to override the normal lock when sizing corners
// (This is ignored when sizing table elements)
BOOL bLock = (uFlags & MK_CONTROL) != 0;
XP_Rect rect;
EDT_ClearSelection(pMWContext);
if( EDT_StartSizing(pMWContext, pElement, Point.x, Point.y, bLock, &rect) )
if( EDT_StartSizing(pMWContext, pElement, Point.x, Point.y, (uFlags & MK_CONTROL) != 0, &rect) )
{
// Force redraw of table or cells that might have been selected
// else we have XOR conflicts and garbage at overlaps
@ -3285,9 +3282,9 @@ CWinCX::OnMouseMoveForLayerCX(UINT uFlags, CPoint& cpPoint,
{
// We are sizing
BOOL bLock = !(BOOL)(uFlags & MK_CONTROL);
// 4th param = Don't lock aspect ratio if Ctrl is pressed
XP_Rect new_rect;
if( EDT_GetSizingRect(pMWContext, xVal, yVal, bLock, &new_rect) )
if( EDT_GetSizingRect(pMWContext, xVal, yVal, (uFlags & MK_CONTROL) != 0, &new_rect) )
{
// Remove last sizing feedback
DisplaySelectionFeedback(LO_ELE_SELECTED, m_rectSizing);

Просмотреть файл

@ -1202,7 +1202,7 @@ BOOL CNetscapeEditView::PreTranslateMessage(MSG * pMsg)
if( pMsg->wParam == VK_CONTROL )
{
// Allow pressing control to change cursor
UpdateCursor();
UpdateCursor(TRUE);
}
else if( pMsg->wParam == 187 && (GetKeyState(VK_CONTROL) & 0x8000) )
{
@ -1220,19 +1220,19 @@ BOOL CNetscapeEditView::PreTranslateMessage(MSG * pMsg)
} else if( pMsg->message == WM_KEYUP &&
pMsg->wParam == VK_CONTROL )
{
UpdateCursor();
UpdateCursor(FALSE);
}
return CNetscapeView::PreTranslateMessage(pMsg);
}
void CNetscapeEditView::UpdateCursor()
void CNetscapeEditView::UpdateCursor(XP_Bool bCtrlPressed)
{
POINT pt;
GetCursorPos(&pt);
ScreenToClient(&pt);
// Send mouse_move message using current
// mouse location to trigger changing cursor
SendMessage(WM_MOUSEMOVE, 0, MAKELPARAM(pt.x, pt.y));
SendMessage(WM_MOUSEMOVE, bCtrlPressed ? MK_CONTROL : 0, MAKELPARAM(pt.x, pt.y));
}
void CNetscapeEditView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
@ -1275,7 +1275,7 @@ void CNetscapeEditView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
GetContext()->CancelSizing();
// Erase inappropriate cursors
UpdateCursor();
UpdateCursor(FALSE);
}
// Call the CGenericView's interrupt function

Просмотреть файл

@ -300,7 +300,7 @@ public:
int BuildEditHistoryMenu(HMENU hMenu, int iStartItem);
// Trigger a mouse-move message to update the cursor
void UpdateCursor();
void UpdateCursor(BOOL bCtrlPressed);
private:
BOOL OnLeftKey(BOOL bShift, BOOL bControl);