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


C++ Widget::GetTypeName方法代码示例

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


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

示例1: ProtoDeSerializeButtonBindings

        void TabSet::ProtoDeSerializeButtonBindings(const XML::Node& SelfRoot)
        {
            this->SubSetBindings.clear();

            XML::Attribute CurrAttrib;
            XML::Node BindingsNode = SelfRoot.GetChild( "SubSetBindings" );

            if( !BindingsNode.Empty() ) {
                if( BindingsNode.GetAttribute("Version").AsInt() == 1 ) {
                    for( XML::NodeIterator BindingNodeIt = BindingsNode.begin() ; BindingNodeIt != BindingsNode.end() ; ++BindingNodeIt )
                    {
                        if( (*BindingNodeIt).GetAttribute("Version").AsInt() == 1 ) {
                            UInt16 ConfigID = 0;
                            String ButtonName;

                            CurrAttrib = (*BindingNodeIt).GetAttribute("ConfigID");
                            if( !CurrAttrib.Empty() )
                                ConfigID = static_cast<UInt16>( CurrAttrib.AsUint() );

                            CurrAttrib = (*BindingNodeIt).GetAttribute("ButtonName");
                            if( !CurrAttrib.Empty() )
                                ButtonName = CurrAttrib.AsString();

                            if( !ButtonName.empty() ) {
                                Widget* NamedButton = this->ParentScreen->GetWidget(ButtonName);
                                if( NamedButton != NULL && NamedButton->GetTypeName() == StackButton::TypeName ) {
                                    this->SetButtonConfig(ConfigID,static_cast<StackButton*>(NamedButton));
                                }else{
                                    StringStream ExceptionStream;
                                    ExceptionStream << "Named StackButton \"" << ButtonName << "\" not found when deserializing Widget named \"" << this->GetName() << "\".";
                                    MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,ExceptionStream.str());
                                }
                            }
                        }else{
                            MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("SubSetBindings") + ": Not Version 1.");
                        }
                    }
                }else{
                    MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("SubSetBindings") + ": Not Version 1.");
                }
            }
        }
开发者ID:,项目名称:,代码行数:42,代码来源:

示例2: ProtoDeSerializeGroupButtons

        void RadioButton::ProtoDeSerializeGroupButtons(const XML::Node& SelfRoot)
        {
            this->RemoveFromButtonGroup();

            XML::Attribute CurrAttrib;
            XML::Node ButtonsNode = SelfRoot.GetChild( "GroupButtons" );

            if( !ButtonsNode.Empty() ) {
                if( ButtonsNode.GetAttribute("Version").AsInt() == 1 ) {
                    for( XML::NodeIterator ButtonNodeIt = ButtonsNode.begin() ; ButtonNodeIt != ButtonsNode.end() ; ++ButtonNodeIt )
                    {
                        if( (*ButtonNodeIt).GetAttribute("Version").AsInt() == 1 ) {
                            String GroupButtonName;

                            CurrAttrib = (*ButtonNodeIt).GetAttribute("GroupButtonName");
                            if( !CurrAttrib.Empty() )
                                GroupButtonName = CurrAttrib.AsString();

                            if( !GroupButtonName.empty() ) {
                                Widget* NamedButton = this->ParentScreen->GetWidget(GroupButtonName);
                                if( NamedButton != NULL && NamedButton->GetTypeName() == RadioButton::TypeName ) {
                                    this->AddToButtonGroup( static_cast<RadioButton*>( NamedButton ) );
                                }else{
                                    StringStream ExceptionStream;
                                    ExceptionStream << "Named Widget \"" << GroupButtonName << "\" not found or not a RadioButton when deserializing Widget named \"" << this->GetName() << "\".";
                                    MEZZ_EXCEPTION(ExceptionBase::PARAMETERS_EXCEPTION,ExceptionStream.str());
                                }
                            }
                        }else{
                            MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("GroupButtons") + ": Not Version 1.");
                        }
                    }
                }else{
                    MEZZ_EXCEPTION(ExceptionBase::INVALID_VERSION_EXCEPTION,"Incompatible XML Version for " + String("GroupButtons") + ": Not Version 1.");
                }
            }
        }
开发者ID:,项目名称:,代码行数:37,代码来源:


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