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


C++ TRDescription::GetTagStringList方法代码示例

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


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

示例1: SetClassProperties

// Not virtual, this is meant to act only on the class specified.  Operate on panel because that is
// the lowest level of hierarchy (not that we're going to do anything with it anyways)
bool UIPieMenu::SetClassProperties(const TRDescription& inDesc, Panel* inComponent, CSchemeManager* inSchemeManager)
{
    bool theSuccess;

    // Let parent classes go first
    theSuccess = UIPanel::SetClassProperties(inDesc, inComponent, inSchemeManager);

    if(theSuccess)
    {
        // Dynamic_cast inComponent to an PieMenu (will always succeed)
        PieMenu* thePieMenu = (PieMenu*)inComponent;

        // Read font if specified
        std::string theSchemeName;
        if(inDesc.GetTagValue(UITagScheme, theSchemeName))
        {
            if(thePieMenu)
            {
                const char* theSchemeCString = theSchemeName.c_str();
                SchemeHandle_t theSchemeHandle = inSchemeManager->getSchemeHandle(theSchemeCString);
                Font* theFont = inSchemeManager->getFont(theSchemeHandle);
                if(theFont)
                {
                    thePieMenu->SetFont(theFont);
                    thePieMenu->GetRootNode()->setFont(theFont);
                }
            }
        }

        // Set colors of root node to that of the pie menu
        Color theColor;
        thePieMenu->getFgColor(theColor);
        thePieMenu->GetRootNode()->setFgColor(theColor);

        thePieMenu->getBgColor(theColor);
        thePieMenu->GetRootNode()->setBgColor(theColor);

        // Read node distances
        float theNodeXDistance = 0.0f;
        inDesc.GetTagValue(kPieMenuNodeXDistance, theNodeXDistance);
        float theNodeYDistance = 0.0f;
        inDesc.GetTagValue(kPieMenuNodeYDistance, theNodeYDistance);
        thePieMenu->SetNodeDistance(theNodeXDistance, theNodeYDistance);

        // Set pop-up menu default image
        string theDefaultImage;
        if(inDesc.GetTagValue(kPieMenuDefaultImage, theDefaultImage))
        {
            thePieMenu->SetDefaultImage(theDefaultImage);
        }

        // Read specified image to use
        //string theNodeTargaName;
        //if(inDesc.GetTagValue(kNodeTarga, theNodeTargaName))
        //{
        //    thePieMenu->SetNodeTargaName(theNodeTargaName);
        //}

        // Now read in the nodes until there are no more.  Assumes first node is root.
        thePieMenu->GetRootNode()->SetSizeKeepCenter(theNodeXDistance*ScreenWidth(), theNodeYDistance*ScreenHeight());

        StringVector theNodeList;
        inDesc.GetTagStringList(kPieMenuNodePrefix, theNodeList);
        for(StringVector::iterator theIter = theNodeList.begin(); theIter != theNodeList.end(); theIter++)
        {
            thePieMenu->AddNode(*theIter);
        }

        // Set the connector, if any
        string theConnectorName;
        if(inDesc.GetTagValue(UIConnectorName, theConnectorName))
        {
            if(theConnectorName != "")
            {
                this->mPieMenu->SetConnectorName(theConnectorName);
            }
        }

        // Now have the piemenu recompute visible size for all nodes
        thePieMenu->RecomputeVisibleSize();

//        for(int i = 0; ; i++)
//        {
//            char theNum[4];
//            sprintf(theNum, "%d", i);
//            string theNodeName(kPieMenuNodePrefix + string(theNum));
//
//            string theNodeString;
//            if(inDesc.GetTagValue(theNodeName, theNodeString))
//            {
//                thePieMenu->AddNode(theNodeString);
//            }
//            else
//            {
//                break;
//            }
//        }

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


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