Ejemplo n.º 1
0
MBOOL
ISP_MGR_G2C_T::
apply(EIspProfile_T eIspProfile)
{
    if (!isEnable()) { // Reset to unit matrix
        reinterpret_cast<ISP_CAM_G2C_CONV_0A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0A))->G2C_CNV_00 = 512;
        reinterpret_cast<ISP_CAM_G2C_CONV_0A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0A))->G2C_CNV_01 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_0B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0B))->G2C_CNV_02 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_0B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0B))->G2C_Y_OFST = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_1A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1A))->G2C_CNV_10 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_1A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1A))->G2C_CNV_11 = 512;
        reinterpret_cast<ISP_CAM_G2C_CONV_1B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1B))->G2C_CNV_12 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_1B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1B))->G2C_U_OFST = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_2A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2A))->G2C_CNV_20 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_2A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2A))->G2C_CNV_21 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_2B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2B))->G2C_CNV_22 = 512;
        reinterpret_cast<ISP_CAM_G2C_CONV_2B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2B))->G2C_V_OFST = 0;
    }

    ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_G2C(isEnable());

    TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                           eTuningMgrFunc_G2c_Conv);

    // TOP 
    TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P2, G2C_EN, isEnable());
    
    TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                                 static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), 
                                                 m_u4RegInfoNum);

    dumpRegInfo("G2C");

    return MTRUE;
}
Ejemplo n.º 2
0
MBOOL
ISP_MGR_G2C_T::
apply(EIspProfile_T eIspProfile, isp_reg_t* pReg)
{
    if (!isEnable()) { // Reset to unit matrix
        reinterpret_cast<ISP_CAM_G2C_CONV_0A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0A))->G2C_CNV_00 = 512;
        reinterpret_cast<ISP_CAM_G2C_CONV_0A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0A))->G2C_CNV_01 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_0B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0B))->G2C_CNV_02 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_0B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_0B))->G2C_Y_OFST = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_1A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1A))->G2C_CNV_10 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_1A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1A))->G2C_CNV_11 = 512;
        reinterpret_cast<ISP_CAM_G2C_CONV_1B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1B))->G2C_CNV_12 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_1B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_1B))->G2C_U_OFST = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_2A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2A))->G2C_CNV_20 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_2A_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2A))->G2C_CNV_21 = 0;
        reinterpret_cast<ISP_CAM_G2C_CONV_2B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2B))->G2C_CNV_22 = 512;
        reinterpret_cast<ISP_CAM_G2C_CONV_2B_T*>(REG_INFO_VALUE_PTR(CAM_G2C_CONV_2B))->G2C_V_OFST = 0;
    }

    ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_G2C(isEnable());

    // TOP 
    ISP_WRITE_ENABLE_BITS(pReg, CAM_CTL_EN_P2, G2C_EN, isEnable());
    
    writeRegs(static_cast<RegInfo_T*>(m_pRegInfo), m_u4RegInfoNum, pReg);

    dumpRegInfo("G2C");

    return MTRUE;
}
Ejemplo n.º 3
0
	type_result NEModule::execute()
	{
		//	pre:
		//		Enable 체크:
		if( ! isEnable()) return RESULT_SUCCESS | RESULT_ABORT_ACTION;
		//		외부 바인딩:
		getArguments().bind();	//	내부에서 Binding이 되어있으면 시도하지 않는다.
		//		로컬 스택 등록:
		NENodeManager::LocalStack& localstack = Kernal::getInstance().getNodeManager().getLocalStack();
		//			ModuleCodeSet에서도 로컬스택을 조정하는데, 왜 여기서도 스택을 조정하는가:
		//				ModuleCodeSet::execute()를 수행하지않고, ModuleCodeSet[n].execute()를 하는 경우가
		//				있기 때문이다.
		NEModuleCodeSet& before_stage_moduleset = localstack.getRecentModuleSet();
		localstack._setRecentModuleSet(getOwner());




		//	main:
		NEArgumentSet& args = getArguments();
		for (int n = 0; n < args.getLength(); n++)
			args[n]._onPrepareExecute();

		type_result result = _onExecute();

		for (int n = 0; n < args.getLength(); n++)
			args[n]._onPostExecute();
		localstack._setRecentModuleSet(before_stage_moduleset);
		return result;
	}
void AnimatedFloat::update(float time)
{
	if (isEnable())
	{
		_value += GetDeltha(time);
		bool outofrange = (_deltha > 0.0f) ? _value >= _valuemax : _value <= _valuemax;
		if (outofrange)
		{
			_value = _valuemax;
			if (_looped)
			{
				_loopcounter++;
				_value = (_oneDirectionLoop) ? _valuemin : _valuemax;
				_deltha = (_oneDirectionLoop) ? _deltha : -_deltha;
				if (!_oneDirectionLoop)
				{
					_valuemax = _valuemin;
					_valuemin = _value;
				}
			}
		}
	}
	if (_valueReference)
	{
		*_valueReference = _value;
	}
}
Ejemplo n.º 5
0
MBOOL
ISP_MGR_GGM_T::
apply(EIspProfile_T eIspProfile)
{
    MBOOL bGAMMA_EN = isEnable();

    // TOP 
    TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P2, GGM_EN, bGAMMA_EN);

    ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_GGM(bGAMMA_EN);

    // RB table
    TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                           eTuningMgrFunc_Ggm_Rb);
    
    TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                                 static_cast<TUNING_MGR_REG_IO_STRUCT*>((MVOID*)m_rIspRegInfo_GGM_RB), 
                                                 GGM_LUT_SIZE);

    // G table
    TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                           eTuningMgrFunc_Ggm_G);

    TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                                 static_cast<TUNING_MGR_REG_IO_STRUCT*>((MVOID*)m_rIspRegInfo_GGM_G), 
                                                 GGM_LUT_SIZE);

    return MTRUE;
}
Ejemplo n.º 6
0
void GTextButton::onRender()
{
	Vec2i const& pos  = getWorldPos();
	Vec2i const& size = getSize();

	glEnable(GL_BLEND);
	glBlendFunc(GL_ONE, GL_ONE);
	if( isEnable() )
	{
		if( getButtonState() == BS_HIGHLIGHT )
			glColor3f(0.0, 0.5, 0.0);
		else
			glColor3f(0.0, 0.25, 0.0);
	}
	else
	{
		glColor3f(0.05, 0.05, 0.05);
	}

	drawRect( pos , size );

	if( isEnable() )
	{
		if( getButtonState() == BS_HIGHLIGHT )
			glColor3f(0.0, 1.0, 0.0);
		else
			glColor3f(0.0, 0.5, 0.0);
	}
	else
	{
		glColor3f(0.1, 0.1, 0.1);
	}

	drawRectLine( pos , size );

	glColor3f(1.0, 1.0, 1.0);

	glDisable(GL_BLEND);

	if( isEnable() )
		text->setColor(Color(50,255,50));
	else
		text->setColor(Color(150,150,150));

	getRenderSystem()->drawText( text , pos  + size / 2  );

}
/*---------------------------------------------------------------------*//**
	描画
**//*---------------------------------------------------------------------*/
void FieldItemUnit::render(const RenderCtx* rc)
{
	if(isEnable())
	{
		GameRenderCtx* grc = (GameRenderCtx*)rc;
		Renderer* rdr = rc->getRenderer();

		#if 0	// 黄色いソリッドな三角▼描画
		
			rdr->bindTexture(0L);
			rdr->setSolidColor(0, 255, 0, 255);
			rdr->setCulling(false);

			Vector3F vtx[3];
			f32 theta = grc->getFrameCount() * 0.1f;
			f32 fsin = ::sinf(theta);
			f32 fcos = ::cosf(theta);
			vtx[0].copy(_pos);
			vtx[1].set(vtx[0].x() - 20.0f * fcos, vtx[0].y() + 50.0f, vtx[0].z() - 20.0f * fsin);
			vtx[2].set(vtx[0].x() + 20.0f * fcos, vtx[0].y() + 50.0f, vtx[0].z() + 20.0f * fsin);
			RendererUtils::render3dTriangles(rdr, vtx, 0L, 0L, 0L, 3, RendererUtils::TRIANGLES);

			rdr->setCulling(true);

		#elif 0

			// テクスチャ設定
			rdr->bindTexture(Game::getGame()->getGui()->getGuiTexture());
			// 加算アルファ合成
			rdr->setAlphaBlendFunc(Renderer::AFUNC_ADD);
			// 背面カリングなし
			rdr->setCulling(false);

			// 回転する板ポリゴンを描画
			f32 fsin = ::sinf(_thetaMapMark);
			f32 fcos = ::cosf(_thetaMapMark);
			f32 xr = HW_MAP_MARK * fcos;
			f32 zr = HW_MAP_MARK * fsin;
			const Vector3F* center = _pos;
			Vector3F vtx[4];
			f32 x1 = center->x() - xr;
			f32 x2 = center->x() + xr;
			f32 z1 = center->z() - zr;
			f32 z2 = center->z() + zr;
			f32 y1 = center->y() + H_MAP_MARK;
			f32 y2 = center->y();
			vtx[0].set(x1, y1, z1);
			vtx[1].set(x2, y1, z2);
			vtx[2].set(x1, y2, z1);
			vtx[3].set(x2, y2, z2);
			RendererUtils::render3dTriangles(rdr, vtx, 0L, (const Vector2F*)_uvarrMapMark, 0L, 4, RendererUtils::TRIANGLE_STRIP);

			// 背面カリングあり
			rdr->setCulling(false);

		#endif
	}
}
Ejemplo n.º 8
0
MBOOL
ISP_MGR_RPG_T::
apply(EIspProfile_T eIspProfile)
{
    addressErrorCheck("Before ISP_MGR_RPG_T::apply()");

    MY_LOG_IF(IsDebugEnabled(), "%s(): isEnable() = %d\n", __FUNCTION__, isEnable());

    if (m_eSensorTG == ESensorTG_1) {
        TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                               eTuningMgrFunc_Rpg);
    
        // TOP
        TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P1, RPG_EN, isEnable());

        ISP_MGR_CTL_EN_P1_T::getInstance(m_eSensorDev).setEnable_RPG(isEnable());
    
        // Register setting
        TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                                     static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), 
                                                     m_u4RegInfoNum);
    }
    else {
        TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                               eTuningMgrFunc_Rpg_d);
    
        // TOP
        TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P1_D, RPG_D_EN, isEnable());

        ISP_MGR_CTL_EN_P1_D_T::getInstance(m_eSensorDev).setEnable_RPG(isEnable());
    
        // Register setting
        TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                                     static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), 
                                                     m_u4RegInfoNum);        
    }
    
    addressErrorCheck("After ISP_MGR_RPG_T::apply()");

    dumpRegInfo("RPG");

    return  MTRUE;
}
Ejemplo n.º 9
0
bool Layer::isAvailable(const G3MEventContext* ec,
                        const Tile* tile) const {
  if (!isEnable()) {
    return false;
  }
  if (_condition == NULL) {
    return true;
  }
  return _condition->isAvailable(ec, tile);
}
Ejemplo n.º 10
0
T&  TUICore<T>::enable( bool beE = true )
{
    if ( isEnable() != beE )
    {
        if ( beE )
            _removeFlag( UF_DISABLE );
        else
            _addFlag( UF_DISABLE );

        _this()->onEnable( beE );
    }
    return *_this();
}
Ejemplo n.º 11
0
bool appl::TextPluginCtags::onReceiveShortCut(appl::TextViewer& _textDrawer,
                                              const std::string& _shortCutName) {
	if (isEnable() == false) {
		return false;
	}
	if (_shortCutName == "appl::TextPluginCtags::OpenCtagsFile") {
		APPL_INFO("Request opening ctag file");
		ememory::SharedPtr<ewol::widget::FileChooser> tmpWidget = ewol::widget::FileChooser::create();
		if (tmpWidget == nullptr) {
			APPL_ERROR("Can not allocate widget  == > display might be in error");
			return true;
		}
		tmpWidget->propertyLabelTitle.set("Open Exuberant Ctags file");
		tmpWidget->propertyLabelValidate.set("Open");
		// try to get the current folder :
		std::string path = _textDrawer.getBufferPath();
		APPL_ERROR("get path : '" << path << "'");
		if (path != "") {
			tmpWidget->propertyPath.set(path);
		}
		ewol::getContext().getWindows()->popUpWidgetPush(tmpWidget);
		tmpWidget->signalValidate.connect(sharedFromThis(), &appl::TextPluginCtags::onCallbackOpenCtagsOpenFileReturn);
		return true;
	} else if (_shortCutName == "appl::TextPluginCtags::JumpDestination") {
		if (_textDrawer.hasBuffer() == false) {
			return false;
		}
		std::string textToSearch;
		if (_textDrawer.hasTextSelected() == true) {
			_textDrawer.copy(textToSearch, _textDrawer.selectStart(), _textDrawer.selectStop() );
		} else {
			appl::Buffer::Iterator _beginPos;
			appl::Buffer::Iterator _endPos;
			if (_textDrawer.getPosAround(_textDrawer.cursor(), _beginPos, _endPos) == false) {
				APPL_WARNING("Can not get data around...");
				return true;
			}
			_textDrawer.copy(textToSearch, _beginPos, _endPos);
		}
		jumpTo(textToSearch);
		return true;
	} else if (_shortCutName == "appl::TextPluginCtags::JumpBack") {
		if (_textDrawer.hasBuffer() == false) {
			return false;
		}
		return true;
	}
	return false;
}
Ejemplo n.º 12
0
// class CompletionMethodMigemoMixin {{{
void ib::CompletionMethodMigemoMixin::beforeMatch(std::vector<ib::CompletionValue*> &candidates, const std::string &input) { // {{{
  auto migemo = ib::Singleton<ib::Migemo>::getInstance();
  if(migemo->isEnable() && input.size() >= ib::Migemo::MIN_LENGTH){
    const auto pattern = migemo->query((unsigned char*)input.c_str());
    regex_ = new ib::Regex((char*)pattern, ib::Regex::NONE);
    migemo->release(pattern);

    if(regex_->init() != 0){
      delete regex_;
      regex_ = nullptr;
    }else{
      candidates.clear();
    }
  }
} // }}}
Ejemplo n.º 13
0
MBOOL
ISP_MGR_SEEE_T::
apply(EIspProfile_T eIspProfile, isp_reg_t* pReg)
{
    MBOOL bSEEE_EN = isEnable();

    ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_SEEE(bSEEE_EN);

    // TOP
    ISP_WRITE_ENABLE_BITS(pReg, CAM_CTL_EN_P2, SEEE_EN, bSEEE_EN);
    
    writeRegs(static_cast<RegInfo_T*>(m_pRegInfo), m_u4RegInfoNum, pReg);

    dumpRegInfo("SEEE");

    return  MTRUE;
}
Ejemplo n.º 14
0
MBOOL
ISP_MGR_GGM_T::
apply(EIspProfile_T eIspProfile, isp_reg_t* pReg)
{
    MBOOL bGAMMA_EN = isEnable();

    // TOP 
    ISP_WRITE_ENABLE_BITS(pReg, CAM_CTL_EN_P2, GGM_EN, bGAMMA_EN);

    ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_GGM(bGAMMA_EN);

    // RB table
    writeRegs(static_cast<RegInfo_T*>(m_rIspRegInfo_GGM_RB), GGM_LUT_SIZE, pReg);

    // G table
    writeRegs(static_cast<RegInfo_T*>(m_rIspRegInfo_GGM_G), GGM_LUT_SIZE, pReg);

    return MTRUE;
}
Ejemplo n.º 15
0
Archivo: menu.cpp Proyecto: easy63/RPG
void CMenu::setVisible(bool _bVisible)
{
	bVisible = _bVisible;

	if(bVisible)
	{
		if(iActiveItem < 0 && vMenuItems.size() > 0)
		{
			iActiveItem = 0;
		}

		CEngine::instance()->bindObject(pWindow, RENDER_LAYER_INTERFACE);
		for(int i = 0;i < vMenuItems.size();i++)
		{
			if(i >= iStartItem && i < (iStartItem + iQtyItemsWindow))
			{
				CEngine::instance()->bindObject(vMenuItems[i], RENDER_LAYER_INTERFACE_TEXT);
			}
			else
			{
				CEngine::instance()->unbindObject(vMenuItems[i]);
			}
		}
		setEnable(isEnable());
		update();
	}
	else
	{
		iActiveItem = -1;
		iStartItem = 0;
		CEngine::instance()->unbindObject(pWindow);
		for(auto &iter : vMenuItems)
		{
			iter->setActive(false);
			CEngine::instance()->unbindObject(iter);
		}
		setEnable(false);
	}
}
Ejemplo n.º 16
0
MBOOL
ISP_MGR_SEEE_T::
apply(EIspProfile_T eIspProfile)
{
    TuningMgr::getInstance().updateEngine(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                           eTuningMgrFunc_Seee);

    MBOOL bSEEE_EN = isEnable();

    ISP_MGR_CTL_EN_P2_T::getInstance(m_eSensorDev).setEnable_SEEE(bSEEE_EN);

    // TOP
    TUNING_MGR_WRITE_ENABLE_BITS(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), CAM_CTL_EN_P2, SEEE_EN, bSEEE_EN);

    // Register setting
    TuningMgr::getInstance().tuningMgrWriteRegs(static_cast<ESoftwareScenario>(m_rIspDrvScenario[eIspProfile]), 
                                                 static_cast<TUNING_MGR_REG_IO_STRUCT*>(m_pRegInfo), 
                                                 m_u4RegInfoNum);

    dumpRegInfo("SEEE");

    return  MTRUE;
}
/*---------------------------------------------------------------------*//**
	フレーム制御
**//*---------------------------------------------------------------------*/
void FieldItemUnit::exec(ExecRes* res, const ExecCtx* ec)
{
	ItemUnit::exec(res, ec);

	if(isEnable())
	{
		// 瞬き処理
		if(_fcntShow <= 0.0f)
		{
			_fcntShow = (f32)FRAME_BLINK_MIN + (f32)(FRAME_BLINK_MAX - FRAME_BLINK_MIN) * CalcUtils::randF();

			// パーティクル表示
			Vector3F pos(*getPosition());
			pos.y() += 20.0f;	// 少し地面から浮かす
			ParticleSys* ptclsys = Game::getGame()->getParticleSys(); ASSERT(ptclsys != 0L);
			u16 ptclid = ptclsys->appearParticle(GameParticleDef::PTCLK_FILD_ITEM_BLINK, &pos, 0);
			if(ptclid != 0)
			{
				Particle* ptcl = ptclsys->getParticle(ptclid);
				if(ptcl != 0L)
				{
					ptcl->setScale(1.0f + CalcUtils::randF());	// 1.0f ~ 2.0f
				}
			}
		}
		else
		{
			_fcntShow -= ec->getDeltaFrame();
		}

		// エネルギー状態を配置情報に伝達
		if(_pobjRef != 0L)
		{
			_pobjRef->eleneStat()->copy(_cstat->getEleneStat());
		}
	}
}
Ejemplo n.º 18
0
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TBool CMainContainer::HandlePopUpMenuSelectionL(TInt& aCommand)
{
	TBool ret(EFalse);
	
	TBool isEnable(EFalse),isDisable(EFalse),isRemove(EFalse),isaPreview(EFalse);
	ShowMenuItemsL(isEnable,isDisable,isRemove,isaPreview);
	
	if(!isRemove && !isaPreview){
		ret = ETrue;
		aCommand = EProfModify;
	}else{
	
		TBuf<100> hjelpper;
		CAknSinglePopupMenuStyleListBox* list = new(ELeave) CAknSinglePopupMenuStyleListBox;
		CleanupStack::PushL(list);
	
		CAknPopupList* popupList = CAknPopupList::NewL(list,R_AVKON_SOFTKEYS_OK_CANCEL);
		CleanupStack::PushL(popupList);
	
		list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
		list->CreateScrollBarFrameL(ETrue);
		list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
	
		CArrayFixFlat<TInt>* cmdArray = new (ELeave) CArrayFixFlat<TInt>(5);
		CleanupStack::PushL(cmdArray);
		CDesCArrayFlat* Array = new (ELeave) CDesCArrayFlat(5);
		CleanupStack::PushL(Array);

		if(isEnable){
			StringLoader::Load(hjelpper,R_CMD_ENABLE);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfEnable);
		}else if(isDisable){
			StringLoader::Load(hjelpper,R_CMD_DISABLE);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfDisable);
		}
		
		if(isaPreview && !iDimPreview){
			StringLoader::Load(hjelpper,R_CMD_MODIFY);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfModify);
	
			StringLoader::Load(hjelpper,R_CMD_PREVIEW);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfTest);		
		}

		if(isRemove){
			StringLoader::Load(hjelpper,R_CMD_DELETE);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfRemove);		
		}

		list->Model()->SetItemTextArray(Array);
		CleanupStack::Pop();//Array
		list->Model()->SetOwnershipType(ELbmOwnsItemArray);
	
		if (popupList->ExecuteLD())
		{
			TInt Selected = list->CurrentItemIndex();
			if(Selected >= 0 && Selected < cmdArray->Count())
			{
				ret = ETrue;
				aCommand = cmdArray->At(Selected);
			}
		}
	
		CleanupStack::PopAndDestroy(1); // cmdArray
		CleanupStack::Pop();            // popuplist
		CleanupStack::PopAndDestroy(1); // list
	}
	
	return ret;
}
Ejemplo n.º 19
0
bool AnimatedFloat::stoped()
{
	return (!isEnable()) || (!_looped && (_value == _valuemax));
}
Ejemplo n.º 20
0
	void print (std::string msg) {
		if (isEnable ()) {
			std::cout << std::string(level,' ')
				  << msg << std::endl;
		}
	}