Beispiel #1
0
//////////////////
// detail: Note that this works for input only
//
UINT CDragDropMgr::ProcessMessage(const MSG* pMsg, BOOL bAllowNcDrag)
{
    if (!m_pMainWnd)
        return FALSE;

	const MSG& msg = *pMsg;

	if (IsSourceWnd(msg.hwnd)) 
    {
		if (msg.message == WM_LBUTTONDOWN || (bAllowNcDrag && msg.message == WM_NCLBUTTONDOWN) ||
			msg.message == WM_RBUTTONDOWN || (bAllowNcDrag && msg.message == WM_NCRBUTTONDOWN)) 
			return OnButtonDown(msg);

        else if (msg.message == WM_MOUSEMOVE) 
			return OnMouseMove(msg);

        else if (msg.message == WM_LBUTTONUP || msg.message == WM_RBUTTONUP) 
			return OnButtonUp(msg);

        else if (m_iState && ((msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE) ||
							   msg.message == WM_CONTEXTMENU || msg.message == WM_KILLFOCUS)) 
        {
			SendDragMessage(WM_DD_DRAGABORT);
			SetState(NONE);

			return TRUE;
		}
	}
	return FALSE;
}
Beispiel #2
0
HRESULT CBMWnd::OnButtonDown(WPARAM wParam, LPARAM lParam)
{	
	POINT	ptMouse;
	ptMouse.x = LOWORD(lParam);
	ptMouse.y = HIWORD(lParam);
	
	return OnButtonDown(ptMouse);
}
Beispiel #3
0
int GWinControl::HandleNotifyMessage(u32 message, NMHDR* pNotifyData)
{
	switch ( message )
	{
		case NM_CLICK:		if ( OnButtonDown( GMouse::Left, int2(-1,-1) ) )	return 0;	break;
		case NM_DBLCLK:		if ( OnDoubleClick( GMouse::Left, int2(-1,-1) ) )	return 0;	break;
		case NM_RCLICK:		if ( OnButtonDown( GMouse::Right, int2(-1,-1) ) )	return 0;	break;
		case NM_RDBLCLK:	if ( OnDoubleClick( GMouse::Right, int2(-1,-1) ) )	return 0;	break;

		default:
			//GDebug::Print("Unhandled Notify Message 0x%04x\n",message);		
			break;
/*
		GWinTreeView* pTree = (GWinTreeView*)pControl;
		case TVN_BEGINLABELEDIT:
		{
			//	about to edit a label, return 0 to allow change, 1 to reject editing
			NMTVDISPINFO* pEditInfo = (NMTVDISPINFO*)pNotifyData;
			GWinTreeItem* pItem = pTree->FindItem( pEditInfo->item.hItem );
			Bool AllowEdit = pTree->AllowItemEdit( pItem, pEditInfo );
			return AllowEdit ? 0 : 1;
		}
		break;

		case TVN_ENDLABELEDIT:
		{
			//	editing label has finished. return FALSE to reject change
			NMTVDISPINFO* pEditInfo = (NMTVDISPINFO*)pNotifyData;

			//	if we have a null string, it was cancelled anyway
			if ( pEditInfo->item.pszText == NULL )
				return FALSE;

			GWinTreeItem* pItem = pTree->FindItem( pEditInfo->item.hItem );
			return pTree->FinishItemEdit( pItem, pEditInfo );
		}
		break;

		case TVN_SELCHANGED:
			pTree->Selected( (GWinTreeView*)pControl, (NMTREEVIEW*)pNotifyData );
			break;
*/
	};

	return 0;
}
Beispiel #4
0
LRESULT CSVGGradientEditCtl::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	POINT point;
	point.x = (short)LOWORD(lParam);
	point.y = (short)HIWORD(lParam);

	OnButtonDown(wParam, point, 0, FALSE);

	return 0;
}
Beispiel #5
0
/*
	CleanupStuff -- Removes properties and hotspots from windows in
		movieinfo structure.  Frees the handle to the movieinfo, too!
*/
LONG FAR PASCAL _export SbClsProc (HWND hwnd, USHORT msg,
	USHORT wp, LONG lp)
{
	HANDLE hglb;
	PMOVIEINFO pMovieInfo;
	LRESULT lr;
	hglb = GetProp(hwnd, (LPSTR)szMovieInfo);
	pMovieInfo = (PMOVIEINFO)GlobalLock(hglb);
	switch (msg)
	{
	case WM_LBUTTONDOWN:
		if (0 == (OnButtonDown(pMovieInfo, msg, wp, lp)))
		{
			Terminate(pMovieInfo);
			return 0L;
		}
		break;
	case MM_MCINOTIFY:
		switch(wp)
		{
		case MCI_NOTIFY_SUCCESSFUL:
			pMovieInfo->fPlaying = FALSE;
			Terminate(pMovieInfo);
			return 0L;
		}
		break;
	case WM_DESTROY:
		lr = CallWindowProc(pMovieInfo->lpfnOldProc, hwnd, msg, wp, lp);
		RemoveProp(hwnd, (LPSTR)szMovieInfo);
		if (pMovieInfo)
			DeleteHotspotList(pMovieInfo);
		if (pMovieInfo)
			SetWindowLong (hwnd, GWL_WNDPROC,
			(LONG) pMovieInfo->lpfnOldProc);
		GlobalUnlock(hglb);
		GlobalFree(hglb);
		hglb = NULL;
		pMovieInfo = NULL;
		break;
	}
	if (pMovieInfo)
	{
		lr = CallWindowProc(pMovieInfo->lpfnOldProc, hwnd, msg, wp, lp);
		if (hglb)
			GlobalUnlock(hglb);
		return (lr);
	}
	else
		return 0L;
}
Beispiel #6
0
void Player::handleEvent(Event* evt)
{
	if (evt->get_eventPhase() != CAPTURING_PHASE)
	{
		if (*evt->get_type() == L"mousedown")
		{
			evt->stopPropagation();
			OnButtonDown(dynamic_cast<UI::MouseEvent*>(evt));
		}
		else if (*evt->get_type() == L"mouseup")
		{
			evt->stopPropagation();
			OnButtonUp(dynamic_cast<UI::MouseEvent*>(evt));
		}
		else if (*evt->get_type() == L"mousemove")
		{
			evt->stopPropagation();
			OnMouseMove(dynamic_cast<UI::MouseEvent*>(evt));
		}
	}
}
ManageBookmarksDlg::ManageBookmarksDlg(QWidget* parent):QDialog(parent)
{
	setupUi(this);

	for(int i=0;i<KpxBookmarks::count();i++){
		QListWidgetItem* item=new QListWidgetItem(ListWidget);
		item->setData(Qt::UserRole,i);
		item->setText(KpxBookmarks::title(i));
	}
    connect(Button_Add,SIGNAL(clicked()),this,SLOT(OnButtonAdd()));
    connect(Button_Edit,SIGNAL(clicked()),this,SLOT(OnButtonEdit()));
    connect(Button_Delete,SIGNAL(clicked()),this,SLOT(OnButtonDelete()));
    connect(Button_Up,SIGNAL(clicked()),this,SLOT(OnButtonUp()));
	connect(Button_Down,SIGNAL(clicked()),this,SLOT(OnButtonDown()));
	connect(ListWidget,SIGNAL(itemDoubleClicked(QListWidgetItem*)),this,SLOT(edit(QListWidgetItem*)));
	connect(buttonBox->button(QDialogButtonBox::Close),SIGNAL(clicked()),this,SLOT(close()));

    Button_Add->setIcon(getIcon("bookmark_add"));
	Button_Edit->setIcon(getIcon("bookmark_edit"));
    Button_Delete->setIcon(getIcon("bookmark_del"));
    Button_Up->setIcon(getIcon("up"));
    Button_Down->setIcon(getIcon("down"));
}
Beispiel #8
0
void cCredits::OnMouseDown(eMButton aButton)
{
	OnButtonDown();
}
Beispiel #9
0
void cPreMenu::OnMouseDown(eMButton aButton)
{
	OnButtonDown();
}
Beispiel #10
0
/*
	SbClsProc -- catches WM_LBUTTONDOWN, MM_MCINOTIFY, and WM_DESTROY
		messages.  See each message for more info.
		Gets movieinfo ahead of time for all 3 message handlers.
*/ 
LONG FAR PASCAL _export SbClsProc (HWND hwnd, USHORT msg,
     USHORT wp, LONG lp)
{
    HANDLE hglb;
    PMOVIEINFO pMovieInfo;
    LRESULT lr;
    
    hglb = GetProp(hwnd, (LPSTR)szMovieInfo);
    if (!hglb)
        {
        dbg("ERROR: Invalid global memory handle (no window property)");
        pMovieInfo = NULL;
        }
    else pMovieInfo = (PMOVIEINFO)GlobalLock(hglb);

    switch (msg)
    {
    	/*
    		WM_LBUTTONDOWN -- passes point to OnButtonDown and
    			terminates movie if it returns FALSE.
    	 */
        case WM_LBUTTONDOWN:
            if (0 == (OnButtonDown(pMovieInfo, msg, wp, lp)))                
                {
                Terminate(pMovieInfo);
                return 0L;
                }        
            break;            
    
        case MM_MCINOTIFY:
            /* This is where we check the status of an AVI  */
            /* movie that might have been playing.  We do   */
            /* the play with MCI_NOTIFY on so we should get */
            /* a MCI_NOTIFY_SUCCESSFUL if the play      */
            /* completes on it's own.           */
            switch(wp){
                case MCI_NOTIFY_SUCCESSFUL:
                    /* the play finished, let's rewind */
                    /* and clear our flag.         */                
                    dbg("subclass MCI_NOTIFY_SUCCESSFUL");
                    pMovieInfo->fPlaying = FALSE;
                    Terminate(pMovieInfo); /* this will call our WM_DESTROY */
                    return 0L;
                }
            break;            

		/*
			WM_DESTROY -- calls the AVI's WM_DESTROY handler, so that
				AVI doesn't think this window exists when it acutally
				doesn't.  Then we Terminate() the movie and
				CleanupStuff() to free the movieinfo
		 */
        case WM_DESTROY:
        	lr = CallWindowProc(pMovieInfo->lpfnOldProc, hwnd, msg, wp, lp);
			Terminate(pMovieInfo);
 			CleanupStuff(hwnd,pMovieInfo,hglb);            
            hglb = NULL;
            pMovieInfo = NULL;
        break;
        default:
        	/* by default we want the AVI windowproc to do its normal thing */
        	lr = CallWindowProc(pMovieInfo->lpfnOldProc, hwnd, msg, wp, lp);
    }

	/* at this point we may or may not have a movieinfo.  If we do,
		we ought to unlock it.
	 */
    if (pMovieInfo)
        {
        if (hglb)
            GlobalUnlock(hglb);
        return (lr);
        }
    else
        return 0L;
}
void cDemoEndText::OnMouseDown(eMButton aButton)
{
	OnButtonDown();
}