当前位置: 首页>>代码示例>>C++>>正文


C++ Action函数代码示例

本文整理汇总了C++中Action函数的典型用法代码示例。如果您正苦于以下问题:C++ Action函数的具体用法?C++ Action怎么用?C++ Action使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Action函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetMousePos

void LineEdit::DragAndDrop(Point p, PasteClip& d)
{
	if(IsReadOnly()) return;
	int c = GetMousePos(p);
	if(AcceptText(d)) {
		NextUndo();
		int a = sb.y;
		int sell, selh;
		WString text = GetWString(d);
		if(GetSelection(sell, selh)) {
			if(c >= sell && c < selh) {
				RemoveSelection();
				if(IsDragAndDropSource())
					d.SetAction(DND_COPY);
				c = sell;
			}
			else
			if(d.GetAction() == DND_MOVE && IsDragAndDropSource()) {
				if(c > sell)
					c -= selh - sell;
				RemoveSelection();
				d.SetAction(DND_COPY);
			}
		}
		int count = Insert(c, text);
		sb.y = a;
		SetFocus();
		SetSelection(c, c + count);
		Action();
		return;
	}
	if(!d.IsAccepted()) return;
	if(!isdrag) {
		isdrag = true;
		ScrollIntoCursor();
	}
	Point dc = Null;
	if(c >= 0)
		dc = GetColumnLine(c);
	if(dc != dropcaret) {
		RefreshDropCaret();
		dropcaret = dc;
		RefreshDropCaret();
	}
}
开发者ID:pedia,项目名称:raidget,代码行数:45,代码来源:LineEdit.cpp

示例2: GetMousePos

void DocEdit::DragAndDrop(Point p, PasteClip& d)
{
	if(IsReadOnly()) return;
	int c = GetMousePos(p);
	if(AcceptText(d)) {
		NextUndo();
		int a = sb;
		int sell, selh;
		WString txt = GetWString(d);
		if(GetSelection(sell, selh)) {
			if(c >= sell && c < selh) {
				if(!IsReadOnly())
					RemoveSelection();
				if(IsDragAndDropSource())
					d.SetAction(DND_COPY);
				c = sell;
			}
			else
			if(d.GetAction() == DND_MOVE && IsDragAndDropSource()) {
				if(c > sell)
					c -= selh - sell;
				if(!IsReadOnly())
					RemoveSelection();
				d.SetAction(DND_COPY);
			}
		}
		int count = Insert(c, txt);
		sb = a;
		SetFocus();
		SetSelection(c, c + count);
		Action();
		return;
	}
	if(!d.IsAccepted()) return;
	Point dc = Null;
	if(c >= 0) {
		Point cr = GetCaret(c);
		dc = Point(cr.x + 1, cr.y);
	}
	if(dc != dropcaret) {
		RefreshDropCaret();
		dropcaret = dc;
		RefreshDropCaret();
	}
}
开发者ID:guowei8412,项目名称:upp-mirror,代码行数:45,代码来源:DocEdit.cpp

示例3: Action

  //Does not save distance tables!  This is
  //to save lightweight data!!
  ///Does not save R or buffers!
  void Bead_ParticleSet::RestoreOldData()
  {
    //    for (int i=0;i<R.size();i++)
    //      R[i]=R_saved[i];
    for(int i=0; i<Gradients_saved.size(); i++) *Gradients[i] = *(Gradients_saved[i]);
    for(int i=0; i<Laplacians_saved.size(); i++) *Laplacians[i] = *(Laplacians_saved[i]);
    for(int i=0; i<DriftVectors_saved.size(); i++) *DriftVectors[i] = *(DriftVectors_saved[i]);
    //    Action=Action_saved;
    for (int ipsi=0;ipsi<nPsi;ipsi++)
      for (int i=0;i<3;i++)
	Action(ipsi,i)=Action_saved(ipsi,i);

    BeadSignWgt=BeadSignWgt_saved;
    TransProb[0]=TransProb_saved[0];
    TransProb[1]=TransProb_saved[1];
    Properties=properties_saved;
    Drift=Drift_saved;
  }
开发者ID:digideskio,项目名称:qmcpack,代码行数:21,代码来源:Bead_ParticleSet.cpp

示例4: Core_EnableStepping

void MemCheck::JitBefore(u32 addr, bool write, int size, u32 pc)
{
	int mask = MEMCHECK_WRITE | MEMCHECK_WRITE_ONCHANGE;
	if (write && (cond & mask) == mask)
	{
		lastAddr = addr;
		lastPC = pc;
		lastSize = size;

		// We have to break to find out if it changed.
		Core_EnableStepping(true);
	}
	else
	{
		lastAddr = 0;
		Action(addr, write, size, pc);
	}
}
开发者ID:AdmiralCurtiss,项目名称:ppsspp,代码行数:18,代码来源:Breakpoints.cpp

示例5: PerformActionForDir

DWORD PerformActionForDir(HWND hwnd, DWORD (*Action)(HWND,const char*), BOOL recursive)
{
	HANDLE sh;
	char  *name;
	DWORD  sum;

	sum=0;
	name=pafDir+lstrlen(pafDir);
	lstrcat(pafDir,"*.*");
    sh=FindFirstFile(pafDir,&pafdW32fd);
	*name=0;
    if (sh!=INVALID_HANDLE_VALUE)
    {
		do
		{
			if (IsAllCancelled())
				break;
			if (pafdW32fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
			{
				if ((recursive) && (pafdW32fd.cFileName[0]!='.'))
				{
					name=pafDir+lstrlen(pafDir);
					lstrcat(pafDir,pafdW32fd.cFileName);
					lstrcat(pafDir,"\\");
					sum+=PerformActionForDir(hwnd,Action,recursive);
					*name=0;
				}
			}
			else
			{
				name=pafDir+lstrlen(pafDir);
				lstrcat(pafDir,pafdW32fd.cFileName);
				ShowProgressHeaderMsg(pafDir);
				ResetCancelFlag();
				sum+=Action(hwnd,pafDir);
				*name=0;
			}
		}
		while (FindNextFile(sh,&pafdW32fd));
		FindClose(sh);
    }

	return sum;
}
开发者ID:ValeryAnisimovsky,项目名称:GameAudioPlayer,代码行数:44,代码来源:Misc.c

示例6: start

void start()
{
	ClockWise(1,0,number[0][med]);
	ClockWise(1,0,number[0][med]);
	ClockWise(1,0,number[0][med]);
	ClockWise(3,0,number[1][med]);
	ClockWise(5,0,number[2][med]);
	ClockWise(7,0,number[3][med]);
	while(JudgeToGO(7,number[3][med])!=1);
	
	ClockWise(2,0,number[0][_high]);
	while(JudgeToGO(2,number[0][_high])!=1);
	REG_Write(4,0,number[1][_high]);
	REG_Write(8,0,number[3][_high]);
	Action();
	while(JudgeToGO(8,number[3][_high])!=1);
	ClockWise(6,0,number[2][_high]);
	while(JudgeToGO(6,number[2][_high])!=1);
}
开发者ID:MrChang0,项目名称:rubik,代码行数:19,代码来源:mofang.c

示例7: Updatable

// Gunner Constructor
Gunner::Gunner(const GunnerTemplate &aTemplate, unsigned int aId)
: Updatable(aId)
{
	SetAction(Action(this, &Gunner::Update));

	Entity *entity = Database::entity.Get(mId);
#ifdef GUNNER_TRACK_DEQUE
	mTrackPos.push_back(entity->GetPosition());
	mTrackPos.push_back(entity->GetPosition());
#else
	mTrackCount = xs_CeilToInt(aTemplate.mFollowLength/GUNNER_TRACK_GRANULARITY) + 2;
	mTrackPos = new Vector2[mTrackCount];
	mTrackFirst = 0;
	mTrackLast = 1;
	mTrackPos[mTrackFirst] = entity->GetPosition();
	mTrackPos[mTrackLast] = entity->GetPosition();
#endif
	mTrackLength = 0.0f;
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:20,代码来源:Gunner.cpp

示例8: Confidence

Action UCTAgent::UCB1(const State & state, const double exploration)
{
    double max = -1.0e6;
    std::vector<int> ties;

    for (int i = 0; i < ActionSize; ++i) {
        double tmp = qtable_[state][i] + exploration * Confidence(state_counts_[state], state_action_counts_[state][i]);

        if (tmp >= max) {
            if (tmp > max) {
                max = tmp;
                ties.clear();
            }
            ties.push_back(i);
        }
    }

    return Action(ties[rand() % ties.size()]);
}
开发者ID:aijunbai,项目名称:maxq-op,代码行数:19,代码来源:uct.cpp

示例9: GetLastVisibleTab

void HeaderCtrl::MouseMove(Point p, dword keyflags) {
	if(isdrag) {
		ti = GetLastVisibleTab() + 1;
		for(int i = 0; i < GetCount(); i++)
			if(col[i].visible) {
				Rect r = GetTabRect(i).OffsetedHorz(-sb);
				if(p.x < r.left + r.Width() / 2) {
					ti = i;
					break;
				}
			}
		dragx = p.x;
		Refresh();
		return;
	}
	int q = GetSplit(p.x);
	int cx = ~q;
	if(cx >= 0 && cx < col.GetCount() && !IsNull(col[cx].tip))
		Tip(col[cx].tip);
	if(mode == FIXED)
		return;
	q = IsNull(q) || q >= 0 ? -1 : -1 - q;
	if(q != light)
		Refresh();
	if(!HasCapture())
		return;
	Size sz = GetSize();
	int x = mode == SCROLL ? p.x + sb : min(sz.cx, p.x);
	if(split >= 0) {
		int w = x - colRect.left;
		if(w < 0) w = 0;
		if(w != GetTabWidth(split)) {
			SetTabWidth0(split, w);
			Refresh();
			if(track) {
				Sync();
				Action();
				WhenLayout();
			}
		}
	}
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:42,代码来源:HeaderCtrl.cpp

示例10: MoveTab

void HeaderCtrl::LeftUp(Point, dword) {
	if(isdrag) {
		if(li >= 0 && ti >= 0)
			MoveTab(li, ti);
		li = ti = -1;
		Refresh();
	}
	else
	if(pushi >= 0 && push)
		col[pushi].WhenAction();
	push = false;
	ti = li = pushi = -1;
	isdrag = false;
	Refresh();
	if(split >= 0 && !track) {
		Action();
		WhenLayout();
	}
	DoSbTotal();
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:20,代码来源:HeaderCtrl.cpp

示例11: Updatable

Weapon::Weapon(const WeaponTemplate &aTemplate, unsigned int aId)
: Updatable(aId)
, mControlId(0)
, mChannel(aTemplate.mChannel)
, mPrevFire(0.0f)
, mTrack(0)
, mBurst(0)
, mTimer(0.0f)
, mPhase(aTemplate.mPhase)
, mAmmo(0)
{
	SetAction(Action(this, &Weapon::Update));

	// if the weapon uses ammo...
	if (aTemplate.mCost)
	{
		// find the specified resource
		mAmmo = FindResource(aId, aTemplate.mType);
	}
}
开发者ID:Fissuras,项目名称:videoventure,代码行数:20,代码来源:WeaponOriginal.cpp

示例12: TEST

TEST(newFrontendActionFactory, InjectsSourceFileCallbacks) {
  VerifyEndCallback EndCallback;

  FixedCompilationDatabase Compilations("/", std::vector<std::string>());
  std::vector<std::string> Sources;
  Sources.push_back("/a.cc");
  Sources.push_back("/b.cc");
  ClangTool Tool(Compilations, Sources);

  Tool.mapVirtualFile("/a.cc", "void a() {}");
  Tool.mapVirtualFile("/b.cc", "void b() {}");

  std::unique_ptr<FrontendActionFactory> Action(
      newFrontendActionFactory(&EndCallback, &EndCallback));
  Tool.run(Action.get());

  EXPECT_TRUE(EndCallback.Matched);
  EXPECT_EQ(2u, EndCallback.BeginCalled);
  EXPECT_EQ(2u, EndCallback.EndCalled);
}
开发者ID:CODECOMMUNITY,项目名称:clang,代码行数:20,代码来源:ToolingTest.cpp

示例13: if

//=========================================================================
void TaxNodeVisitor::VisitLeavesToRoot(TreeTaxNode *node)
{
    if ( node->getGnode()  == NULL )
    {
        if ( createGraphNodes )
            graphView->CreateGraphNode(node);
        else if ( !visitNullGnodes )
            return;
    }
    bool visit_children = shouldVisitChildren(node);
    if ( visit_children )
    {
        beforeVisitChildren(node);
        ThreadSafeListLocker<TreeTaxNode *> locker(&node->children);
        for ( TaxNodeIterator it  = node->children.begin(); it != node->children.end(); it++ )
            VisitLeavesToRoot(*it);
        afterVisitChildren(node);
    }
    Action(node);
}
开发者ID:vryukhko,项目名称:marva,代码行数:21,代码来源:tree_tax_node.cpp

示例14: loadAction

static std::error_code loadAction(ExecState& exec, const JSObject& ruleObject, Action& action, bool& validSelector)
{
    VM& vm = exec.vm();
    auto scope = DECLARE_THROW_SCOPE(vm);

    validSelector = true;
    const JSValue actionObject = ruleObject.get(&exec, Identifier::fromString(&exec, "action"));
    if (!actionObject || scope.exception() || !actionObject.isObject())
        return ContentExtensionError::JSONInvalidAction;

    const JSValue typeObject = actionObject.get(&exec, Identifier::fromString(&exec, "type"));
    if (!typeObject || scope.exception() || !typeObject.isString())
        return ContentExtensionError::JSONInvalidActionType;

    String actionType = typeObject.toWTFString(&exec);

    if (actionType == "block")
        action = ActionType::BlockLoad;
    else if (actionType == "ignore-previous-rules")
        action = ActionType::IgnorePreviousRules;
    else if (actionType == "block-cookies")
        action = ActionType::BlockCookies;
    else if (actionType == "css-display-none") {
        JSValue selector = actionObject.get(&exec, Identifier::fromString(&exec, "selector"));
        if (!selector || scope.exception() || !selector.isString())
            return ContentExtensionError::JSONInvalidCSSDisplayNoneActionType;

        String s = selector.toWTFString(&exec);
        if (!isValidSelector(s)) {
            // Skip rules with invalid selectors to be backwards-compatible.
            validSelector = false;
            return { };
        }
        action = Action(ActionType::CSSDisplayNoneSelector, s);
    } else if (actionType == "make-https") {
        action = ActionType::MakeHTTPS;
    } else
        return ContentExtensionError::JSONInvalidActionType;

    return { };
}
开发者ID:eocanha,项目名称:webkit,代码行数:41,代码来源:ContentExtensionParser.cpp

示例15: chkForFingerPrint

//************************************************************************************************************************************************
void chkForFingerPrint()
{
	if (fps.IsPressFinger())
	{
                wdt_reset();	//reset the watchdog timer for any normal op that may take time.	
                fps.CaptureFinger(false);
		int id = fps.Identify1_N();
		if (id < 200)
		{
			//Serial.print("Verified ID:");
			//Serial.println(id);
                        blink(OKLedPin, 100, 2);
                        Action(1);   //Open the Garage door
		}
		else
		{
			//Serial.println("Finger not found");
                        blink(NotOKLedPin, 100, 3);
		}
	}  
}
开发者ID:gion86,项目名称:Fingerprint,代码行数:22,代码来源:GarageDoorMonitor.c


注:本文中的Action函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。