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


C++ IObject::IsButton方法代码示例

本文整理汇总了C++中IObject::IsButton方法的典型用法代码示例。如果您正苦于以下问题:C++ IObject::IsButton方法的具体用法?C++ IObject::IsButton怎么用?C++ IObject::IsButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IObject的用法示例。


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

示例1:

Button *LWF::SearchButtonInstanceByInstanceId(int instId) const
{
	if (instId < 0 || instId >= (int)m_instances.size())
		return 0;
	IObject *obj = m_instances[instId];
	while (obj) {
		if (obj->IsButton())
			return (Button *)obj;
		obj = obj->nextInstance;
	}
	return 0;
}
开发者ID:ElAleyo,项目名称:lwf,代码行数:12,代码来源:lwf_core.cpp

示例2: if

Button *Movie::SearchButtonInstanceByInstanceId(
	int instId, bool recursive) const
{
	for (IObject *instance = m_instanceHead; instance;
			instance = instance->linkInstance) {
		if (instance->IsButton() && instance->instanceId == instId) {
			return (Button *)instance;
		} else if (recursive && instance->IsMovie()) {
			Button *i = ((Movie *)instance)->SearchButtonInstanceByInstanceId(
				instId, recursive);
			if (i)
				return i;
		}
	}
	return 0;
}
开发者ID:KitoHo,项目名称:lwf,代码行数:16,代码来源:lwf_movie.cpp

示例3: PostExec

void Movie::PostExec(bool progressing)
{
	hasButton = false;
	if (!active)
		return;

	m_execedFrame = -1;
	bool postExeced = m_postExecCount == lwf->execCount;
	if (progressing && playing && !m_jumped && !postExeced) {
		++m_currentFrameInternal;
		currentFrame = m_currentFrameInternal + 1;
	}
	for (;;) {
		if (m_currentFrameInternal < 0 ||
				m_currentFrameInternal >= totalFrames) {
			m_currentFrameInternal = 0;
			currentFrame = m_currentFrameInternal + 1;
		}
		if (m_currentFrameInternal == m_execedFrame)
			break;

		m_currentFrameCurrent = m_currentFrameInternal;
		m_execedFrame = m_currentFrameCurrent;
		const Data *d = lwf->data.get();
		const Format::Frame &frame = d->frames[
			data->frameOffset + m_currentFrameCurrent];

		int controlAnimationOffset;
		IObject *instance;

		if (m_lastControlOffset == frame.controlOffset &&
				m_lastControls == frame.controls) {

			controlAnimationOffset = m_lastControlAnimationOffset;

			if (m_skipped) {
				instance = m_instanceHead;
				while (instance) {
					if (instance->IsMovie()) {
						Movie *movie = (Movie *)instance;
						movie->m_attachMovieExeced = false;
						movie->m_attachMoviePostExeced = false;
					} else if (instance->IsButton()) {
						((Button *)instance)->EnterFrame();
					}
					instance = instance->linkInstance;
				}
				hasButton = m_lastHasButton;
			} else {
				for (int dlDepth = 0; dlDepth < data->depths; ++dlDepth) {
					Object *obj = m_displayList[dlDepth].get();
					if (obj) {
						if (!postExeced) {
							obj->matrixIdChanged = false;
							obj->colorTransformIdChanged = false;
						}
						if (obj->IsMovie()) {
							Movie *movie = (Movie *)obj;
							movie->m_attachMovieExeced = false;
							movie->m_attachMoviePostExeced = false;
						} else if (obj->IsButton()) {
							((Button *)obj)->EnterFrame();
							hasButton = true;
						}
					}
				}
				m_lastHasButton = hasButton;
				m_skipped = true;
			}

		} else {
			++m_movieExecCount;
			m_instanceHead = 0;
			m_instanceTail = 0;
			m_lastControlOffset = frame.controlOffset;
			m_lastControls = frame.controls;
			controlAnimationOffset = -1;
			for (int i = 0; i < frame.controls; ++i) {
				const Format::Control &control =
					d->controls[frame.controlOffset + i];

				switch (control.controlType) {
				case Format::Control::MOVE:
					{
						const Format::Place &p = d->places[control.controlId];
						ExecObject(p.depth, p.objectId,
							p.matrixId, 0, p.instanceId, p.blendMode);
					}
					break;

				case Format::Control::MOVEM:
					{
						const Format::ControlMoveM &ctrl =
							d->controlMoveMs[control.controlId];
						const Format::Place &p = d->places[ctrl.placeId];
						ExecObject(p.depth, p.objectId,
							ctrl.matrixId, 0, p.instanceId, p.blendMode);
					}
					break;

//.........这里部分代码省略.........
开发者ID:KitoHo,项目名称:lwf,代码行数:101,代码来源:lwf_movie.cpp


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