void CToolManagerHardDisk::OnBnClickedBtnPartation()
{
	// TODO: 在此添加控件通知处理程序代码
	if (m_nPartNo == -1 || m_nPhyNo == -1 || m_nLogicNo == -1)
	{
		return;
	}
	CDlgDiskPartation dlg;
	dlg.m_nRecord = m_diskinfo.vStorageDeviceInfoAll[m_nLogicNo].diPartitions[0].uiTotalSpace;
	dlg.m_nSnap = m_diskinfo.vStorageDeviceInfoAll[m_nLogicNo].diPartitions[1].uiTotalSpace;
	dlg.m_nTotal = dlg.m_nSnap + dlg.m_nRecord;
	if (IDOK == dlg.DoModal())
	{
		CString strTemp("");
		strTemp.Format("%s", _CS("HDDManager.SuceToExecute"));
		if ( IDOK == MessageBox( strTemp , _CS( "OneClick.Prompt" ) , MB_OKCANCEL  | MB_ICONQUESTION ) )
		{
			memset(&m_DiskCtl, 0, sizeof(m_DiskCtl));
			m_DiskCtl.iAction = SDK_STORAGE_DEVICE_CONTROL_PARTITIONS;
			m_DiskCtl.iSerialNo = m_nLogicNo;
			m_DiskCtl.iPartSize[0] = dlg.m_nRecord;
			m_DiskCtl.iPartSize[1] = dlg.m_nSnap;
			OnExecute(&m_DiskCtl);
		}
	}
}
void UGameplayCueNotify_Static::HandleGameplayCue(AActor* MyTarget, EGameplayCueEvent::Type EventType, FGameplayCueParameters Parameters)
{
	if (MyTarget && !MyTarget->IsPendingKill())
	{
		K2_HandleGameplayCue(MyTarget, EventType, Parameters);

		switch (EventType)
		{
		case EGameplayCueEvent::OnActive:
			OnActive(MyTarget, Parameters);
			break;

		case EGameplayCueEvent::WhileActive:
			WhileActive(MyTarget, Parameters);
			break;

		case EGameplayCueEvent::Executed:
			OnExecute(MyTarget, Parameters);
			break;

		case EGameplayCueEvent::Removed:
			OnRemove(MyTarget, Parameters);
			break;
		};
	}
	else
	{
		ABILITY_LOG(Warning, TEXT("Null Target"));
	}
}
示例#3
0
文件: FW_Cmd.cpp 项目: KnowNo/backup
// virtual 
BOOL FW_Cmd::OnCmdMsg( UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo )
{
	BOOL bOK = CCmdTarget::OnCmdMsg( nID, nCode, pExtra, pHandlerInfo );
	if(!bOK)
	{
		if(nID == GetCmdId())
		{
			switch(nCode)
			{
			case CN_COMMAND:
				{
					// pHandlerInfo!=NULL means it is checking whether the command should be enable,
					// otherwise the command is executed
					if(!pHandlerInfo)
					{
						if(!OnExecute())
							OnTerminate();
					}
					bOK = TRUE;
				}
				break;
			case CN_UPDATE_COMMAND_UI:
				{
					OnUpdateCmdUI((CCmdUI*)pExtra);
					bOK = TRUE;	// Enable the command
				}
				break;
			default:
				break;
			}
		}
	}
	return bOK;
}
示例#4
0
bool CGUIWindowEventLog::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
{
  if (itemNumber < 0 && itemNumber >= m_vecItems->Size())
    return false;

  CFileItemPtr item = m_vecItems->Get(itemNumber);
  if (item == nullptr)
    return false;

  switch (button)
  {
  case CONTEXT_BUTTON_INFO:
    return OnSelect(item);

  case CONTEXT_BUTTON_DELETE:
    return OnDelete(item);

  case CONTEXT_BUTTON_ACTIVATE:
    return OnExecute(item);

  default:
    break;
  }

  return CGUIMediaWindow::OnContextButton(itemNumber, button);
}
示例#5
0
void ArdunityController::execute()
{
	if(updated)
	{
		OnExecute();		
		updated = false;
	}
}
示例#6
0
bool CGUIWindowEventLog::OnSelect(CFileItemPtr item)
{
  if (item == nullptr)
    return false;

  OnExecute(item);
  return true;
}
示例#7
0
void ThreadPoolWait::Run(WaitResult result)
{
	RETURN_IF_NULL(mCommand);
	mResult = result;
	if (mResult == WaitResult::Success)
	{
		OnExecute();
	}
}
void CToolManagerHardDisk::OnBnClickedBtnRecover()
{
	// TODO: 在此添加控件通知处理程序代码
	if (m_nPartNo == -1 || m_nPhyNo == -1 || m_nLogicNo == -1)
	{
		return;
	}
	CString strTemp("");
	strTemp.Format("%s", _CS("HDDManager.SuceToExecute"));
	if ( IDOK == MessageBox( strTemp , _CS( "OneClick.Prompt" ) , MB_OKCANCEL  | MB_ICONQUESTION ) )
	{
		memset(&m_DiskCtl, 0, sizeof(m_DiskCtl));
		m_DiskCtl.iAction = SDK_STORAGE_DEVICE_CONTROL_RECOVER;
		m_DiskCtl.iPartNo = m_nPartNo;
		m_DiskCtl.iSerialNo = m_nLogicNo;
		OnExecute(&m_DiskCtl);
	}
}
void CToolManagerHardDisk::OnBnClickedBtnSnap()
{
	// TODO: 在此添加控件通知处理程序代码
	if (m_nPartNo == -1 || m_nPhyNo == -1 || m_nLogicNo == -1)
	{
		return;
	}
	CString strTemp("");
	strTemp.Format("%s", _CS("HDDManager.TipSetToSnapShotDriver"));
	if ( IDOK == MessageBox( strTemp , _CS( "OneClick.Prompt" ) , MB_OKCANCEL  | MB_ICONQUESTION ) )
	{
		memset(&m_DiskCtl, 0, sizeof(m_DiskCtl));
		m_DiskCtl.iAction = SDK_STORAGE_DEVICE_CONTROL_SETTYPE;
		m_DiskCtl.iPartNo = m_nPartNo;
		m_DiskCtl.iSerialNo = m_nLogicNo;
		m_DiskCtl.iType = SDK_DRIVER_SNAPSHOT;
		OnExecute(&m_DiskCtl);
	}
}
void CControlLineStyleSelector::OnClick(BOOL bKeyboard, CPoint pt)
{
	if (!m_bEnabled) return;
	
	int nHit = HitTest(pt);
	if (nHit == -1) return;

	m_nPressed = nHit;

	if (!bKeyboard) 
	{			
		ClickToolBarButton();
	} 
	else
	{
		OnExecute();
	}
	m_nPressed = -1;
}
void CThreadProcessor::execute()
{
	try
	{
		while(true)
		{
            if(!wait_for_new_job())
                return;
            
            OnExecute();

			{
				lkt lk(mtx);
				if(state==st_stopping)return;
				state=st_wait_task;
				PostMessage(WM_COMPLETE,0,0);
                cond.notify_all();
			}
		}
	}
	catch(std::exception& e)
	{
		if(state==st_stopping)return;
		error_t err;
		err.message=std::string("std::exception: ")+e.what();
		add_message(err);
		PostMessage(WM_COMPLETE,0,0);
	}
	catch(...)
	{
		if(state==st_stopping)return;
		error_t err;
		err.message="unknown exception";
		add_message(err);
		PostMessage(WM_COMPLETE,0,0);
	}
}
示例#12
0
/**************************************************************************
IContextMenu::InvokeCommand
	Carries out the command associated with a shortcut menu item.

Parameters
	pici	Pointer to a CMINVOKECOMMANDINFO or CMINVOKECOMMANDINFOEX
			structure containing information about the command.
			For further details, see the Remarks section. 

Return Value
	Returns NOERROR if successful, or an OLE-defined error value otherwise.
**************************************************************************/
STDMETHODIMP CContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
{
	if(HIWORD(lpcmi->lpVerb))
	{
		//the command is being sent via a verb
		return NOERROR;
	}
	
	if(LOWORD(lpcmi->lpVerb) > IDM_LAST)
		return m_pContextMenu->InvokeCommand(lpcmi);
		//return ResultFromScode(E_INVALIDARG);

	switch(LOWORD(lpcmi->lpVerb))
	{
	case IDM_EXPLORE:
	case IDM_OPEN:
		OnOpenFolder(lpcmi);
		break;
		
	case IDM_RENAME:
		break;
	
	case IDM_EXECUTE:
		OnExecute();
		break;
	
	case IDM_CREATE_FOLDER:
		OnCreateNewFolder();
		break;
	
	case IDM_DELETE_FOLDER:
		OnDelete();
		break;

	case IDM_PROPERTIES:
		OnShowProperties();
		break;

	case IDM_ADDEXTFOLDER:
		OnCreateExtensionFolder();
		break;

	case IDM_HIDEEXTENSION:
		OnHideExtension();
		break;

	case IDM_SHOWONLYEXTENSION:
		OnShowOnlyExtension();
		break;

	case IDM_OPENCONTAININGFOLDER1:
		OnOpenContainingFolder();
		break;

	case IDM_CLEARSEARCH:
		OnClearSearch();
		break;

//	default:
//		return m_pContextMenu->InvokeCommand(lpcmi);
	}
	
	return NOERROR;
}
void AGameplayCueNotify_Actor::HandleGameplayCue(AActor* MyTarget, EGameplayCueEvent::Type EventType, const FGameplayCueParameters& Parameters)
{
    SCOPE_CYCLE_COUNTER(STAT_HandleGameplayCueNotifyActor);

    if (Parameters.MatchedTagName.IsValid() == false)
    {
        ABILITY_LOG(Warning, TEXT("GameplayCue parameter is none for %s"), *GetNameSafe(this));
    }

    // Handle multiple event gating
    {
        if (EventType == EGameplayCueEvent::OnActive && !bAllowMultipleOnActiveEvents && bHasHandledOnActiveEvent)
        {
            return;
        }

        if (EventType == EGameplayCueEvent::WhileActive && !bAllowMultipleWhileActiveEvents && bHasHandledWhileActiveEvent)
        {
            return;
        }

        if (EventType == EGameplayCueEvent::Removed && bHasHandledOnRemoveEvent)
        {
            return;
        }
    }

    // If cvar is enabled, check that the target no longer has the matched tag before doing remove logic. This is a simple way of supporting stacking, such that if an actor has two sources giving him the same GC tag, it will not be removed when the first one is removed.
    if (GameplayCueNotifyTagCheckOnRemove > 0 && EventType == EGameplayCueEvent::Removed)
    {
        if (IGameplayTagAssetInterface* TagInterface = Cast<IGameplayTagAssetInterface>(MyTarget))
        {
            if (TagInterface->HasMatchingGameplayTag(Parameters.MatchedTagName))
            {
                return;
            }
        }
    }

    if (MyTarget && !MyTarget->IsPendingKill())
    {
        K2_HandleGameplayCue(MyTarget, EventType, Parameters);

        // Clear any pending auto-destroy that may have occurred from a previous OnRemove
        SetLifeSpan(0.f);

        switch (EventType)
        {
        case EGameplayCueEvent::OnActive:
            OnActive(MyTarget, Parameters);
            bHasHandledOnActiveEvent = true;
            break;

        case EGameplayCueEvent::WhileActive:
            WhileActive(MyTarget, Parameters);
            bHasHandledWhileActiveEvent = true;
            break;

        case EGameplayCueEvent::Executed:
            OnExecute(MyTarget, Parameters);
            break;

        case EGameplayCueEvent::Removed:
            bHasHandledOnRemoveEvent = true;
            OnRemove(MyTarget, Parameters);

            if (bAutoDestroyOnRemove)
            {
                if (AutoDestroyDelay > 0.f)
                {
                    FTimerDelegate Delegate = FTimerDelegate::CreateUObject(this, &AGameplayCueNotify_Actor::GameplayCueFinishedCallback);
                    GetWorld()->GetTimerManager().SetTimer(FinishTimerHandle, Delegate, AutoDestroyDelay, false);
                }
                else
                {
                    GameplayCueFinishedCallback();
                }
            }
            break;
        };
    }
    else
    {
        ABILITY_LOG(Warning, TEXT("Null Target called for event %d on GameplayCueNotifyActor %s"), (int32)EventType, *GetName() );
        if (EventType == EGameplayCueEvent::Removed)
        {
            // Make sure the removed event is handled so that we don't leak GC notify actors
            GameplayCueFinishedCallback();
        }
    }
}
示例#14
0
void CXTPTabManagerNavigateButton::PerformClick(HWND hWnd, CPoint pt)
{
	if ((::GetCapture() != NULL) || !m_bEnabled)
		return;

	::SetCapture(hWnd);

	BOOL  bClick = FALSE;

	DWORD dwStart = GetTickCount();
	for (;;)
	{
		if (m_bEnabled && GetTickCount() - dwStart > 20)
		{
			dwStart = GetTickCount();
			OnExecute(TRUE);
		}

		BOOL bPressed = m_rcButton.PtInRect(pt);

		if (bPressed != m_bPressed)
		{
			m_bPressed = bPressed;
			m_pManager->RedrawControl(m_rcButton, TRUE);
		}
		MSG msg;

		if (!::PeekMessage(&msg, NULL, NULL, NULL, PM_NOREMOVE))
			continue;

		VERIFY(::GetMessage(&msg, NULL, 0, 0));

		if (::GetCapture() != hWnd)
		{
			DispatchMessage (&msg);
			goto ExitLoop;
		}
		switch (msg.message)
		{
			case WM_MOUSEMOVE:
				pt = CPoint((short signed)LOWORD(msg.lParam), (short signed)HIWORD(msg.lParam));
				break;

			case WM_LBUTTONUP:
				bClick = m_bPressed;
				goto ExitLoop;

			case WM_KEYDOWN:
				if (msg.wParam != VK_ESCAPE)
					break;

			case WM_CANCELMODE:
			case WM_RBUTTONDOWN:
				goto ExitLoop;

			default:
				DispatchMessage (&msg);
				break;
		}
	}

ExitLoop:
	ReleaseCapture();
	m_bPressed = FALSE;
	m_pManager->PerformMouseMove(hWnd, pt);
	m_pManager->RedrawControl(NULL, FALSE);

	if (bClick)
	{
		OnExecute(FALSE);
	}
}