(CEGUI)如何复制一个窗口

来源:互联网 发布:c语言 define数组 编辑:程序博客网 时间:2024/06/08 04:22

//------------------------------------------------------------------------
Window* CopyWindow( const CEGUI::Window* pSource )
{
    // 创建相同类型的窗口,但名字不同
    Window* copy = CEGUI::WindowManager::getSingleton().createWindow(pSource->getType(), pSource->getName() + "_copy");

    // 复制窗口属性

    CEGUI::PropertySet::Iterator propertyIt = pSource->getPropertyIterator();

    while (!propertyIt.isAtEnd())
    {
      const CEGUI::String propertyName = propertyIt.getCurrentKey();
      copy->setProperty(propertyName,  pSource->getProperty(propertyName));
      propertyIt++;
   }

   //返回窗口
   return copy;
}