// WM_NCLBUTTONUP handler 
BOOL cef_dark_window::HandleNcLeftButtonUp(UINT uHitTest, LPPOINT point)
{
    NonClientButtonStateData oldData(mNonClientData);

    mNonClientData.Reset();

    UpdateNonClientButtons();

    switch (oldData.mActiveButton) 
    {
    case HTCLOSE:
        if (oldData.mButtonOver) {
            SendMessage (WM_SYSCOMMAND, SC_CLOSE, (LPARAM)POINTTOPOINTS(*point));
            TrackNonClientMouseEvents(false);
        }
        return TRUE;
    case HTMAXBUTTON:
        if (oldData.mButtonOver) {
            if (IsZoomed()) 
                SendMessage (WM_SYSCOMMAND, SC_RESTORE, (LPARAM)POINTTOPOINTS(*point));
            else 
                SendMessage (WM_SYSCOMMAND, SC_MAXIMIZE, (LPARAM)POINTTOPOINTS(*point));
            TrackNonClientMouseEvents(false);
        }
        return TRUE;
    case HTMINBUTTON:
        if (oldData.mButtonOver) {
            SendMessage (WM_SYSCOMMAND, SC_MINIMIZE, (LPARAM)POINTTOPOINTS(*point));
            TrackNonClientMouseEvents(false);
        }
        return TRUE;
    }
    
    return FALSE;
}
Ejemplo n.º 2
0
void CPartsListCtrl::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// If a popup edit is in progress within the parts bar's MIDI target page,
	// defer selection to avoid applying the target change to the wrong part.
	CMidiTargetDlg&	PartsMTDlg = theApp.GetMain()->GetPartsBar().GetMidiTargetDlg();
	if (PartsMTDlg.IsEditing()) {	// if parts MIDI target edit in progress
		PartsMTDlg.EndEdit();	// end edit, applying MIDI target change
		PostMessage(WM_LBUTTONDOWN, nFlags, POINTTOPOINTS(point));	// defer selection
	} else	// normal case
		CGridCtrl::OnLButtonDown(nFlags, point);
}
Ejemplo n.º 3
0
void CChildView::OnNcLButtonDown(UINT nHitTest, CPoint point)
{
	CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
	bool fLeftMouseBtnUnassigned = !AssignedToCmd(wmcmd::LDOWN);

	if (!pFrame->m_fFullScreen && (pFrame->IsCaptionHidden() || fLeftMouseBtnUnassigned)) {
		BYTE bFlag = 0;
		switch (nHitTest) {
			case HTTOP:
				bFlag = WMSZ_TOP;
				break;
			case HTTOPLEFT:
				bFlag = WMSZ_TOPLEFT;
				break;
			case HTTOPRIGHT:
				bFlag = WMSZ_TOPRIGHT;
				break;
			case HTLEFT:
				bFlag = WMSZ_LEFT;
				break;
			case HTRIGHT:
				bFlag = WMSZ_RIGHT;
				break;
			case HTBOTTOM:
				bFlag = WMSZ_BOTTOM;
				break;
			case HTBOTTOMLEFT:
				bFlag = WMSZ_BOTTOMLEFT;
				break;
			case HTBOTTOMRIGHT:
				bFlag = WMSZ_BOTTOMRIGHT;
				break;
		}

		if (bFlag) {
			pFrame->PostMessage(WM_SYSCOMMAND, (SC_SIZE | bFlag), (LPARAM)POINTTOPOINTS(point));
		} else {
			CWnd::OnNcLButtonDown(nHitTest, point);
		}
	}
}