예제 #1
0
	void PropertyFieldSkin::onFillValues()
	{
		WidgetStyle::VectorString values = WidgetTypes::getInstance().findWidgetStyle(mCurrentWidget->getTypeName())->skin;

		// добавляем скины и шаблоны
		MyGUI::ResourceManager::EnumeratorPtr resource = MyGUI::ResourceManager::getInstance().getEnumerator();
		while (resource.next())
		{
			MyGUI::ResourceSkin* resourceSkin = resource.current().second->castType<MyGUI::ResourceSkin>(false);
			if (resourceSkin != nullptr)
			{
				if (!MyGUI::utility::startWith(resourceSkin->getResourceName(), "LE_"))
					values.push_back(replaceTags("ColourDefault") + resourceSkin->getResourceName());
			}

			MyGUI::ResourceLayout* resourceLayout = resource.current().second->castType<MyGUI::ResourceLayout>(false);
			if (resourceLayout != nullptr)
			{
				if (!MyGUI::utility::endWith(resourceLayout->getResourceName(), ".layout"))
				{
					if (!MyGUI::utility::startWith(resourceLayout->getResourceName(), "LE_"))
						values.push_back(replaceTags("ColourDefault") + resourceLayout->getResourceName());
				}
			}
		}

		mField->removeAllItems();
		for (WidgetStyle::VectorString::iterator iter = values.begin(); iter != values.end(); ++iter)
			mField->addItem(*iter);
		mField->beginToItemFirst();
	}
예제 #2
0
	void PropertyFieldFont::onFillValues()
	{
		WidgetStyle::VectorString values;

		const std::string DEFAULT_STRING = "[DEFAULT]";
		values.push_back(replaceTags("ColourDefault") + DEFAULT_STRING);
		values.push_back("Default");

		MyGUI::ResourceManager::EnumeratorPtr resource = MyGUI::ResourceManager::getInstance().getEnumerator();
		while (resource.next())
		{
			MyGUI::IFont* resourceFont = resource.current().second->castType<MyGUI::IFont>(false);
			if (resourceFont != nullptr)
				values.push_back(resourceFont->getResourceName());
		}

		for (WidgetStyle::VectorString::iterator iter = values.begin(); iter != values.end(); ++iter)
			mField->addItem(*iter);
		mField->beginToItemFirst();
	}
예제 #3
0
	void View::initialiseImages()
	{
		MyGUI::ResourceManager::EnumeratorPtr resource = MyGUI::ResourceManager::getInstance().getEnumerator();
		while (resource.next())
		{
			MyGUI::ResourceImageSetPtr image = resource.current().second->castType<MyGUI::ResourceImageSet>(false);
			if (image != nullptr)
			{
				//mComboResource->addItem(image->getResourceName(), image);
				mMultiList->addItem(image->getResourceName(), image);
				mMultiList->setSubItemNameAt(1, mMultiList->getItemCount()-1, image->getResourceID().empty() ? "" : image->getResourceID().print());
			}
		}

		/*typedef std::vector<MyGUI::ResourceImageSetPtr> Resources;
		Resources resources = MyGUI::ResourceManager::getInstance().getResources<MyGUI::ResourceImageSet>();
		for (Resources::iterator iter=resources.begin(); iter!=resources.end(); ++iter)
		{
			mMultiList->addItem((*iter)->getResourceName(), (*iter));
			mMultiList->setSubItemNameAt(1, mMultiList->getItemCount()-1, (*iter)->getResourceID().print());
		}*/
	}