Пример #1
0
        //void InitializeScheme(ref string scheme, ref string prefix)
        //{
        //	var schemeConfigSection = ConfigurationManager.GetSection("schemeSection") as SchemeConfigurationSection;
        //	if (schemeConfigSection != null)
        //	{
        //		var widthRatio = _graphicsDeviceManager.PreferredBackBufferWidth / (float)_minDisplayMode.Width;
        //		var heightRatio = _graphicsDeviceManager.PreferredBackBufferHeight / (float)_minDisplayMode.Height;
        //		var ratio = Math.Min(widthRatio, heightRatio);

        //		scheme = schemeConfigSection.DefaultScheme;
        //		foreach (var schemeElement in schemeConfigSection.Schemes.Cast<SchemeElement>().OrderBy(x => x.Point))
        //		{
        //			if (schemeElement.Point <= ratio)
        //			{
        //				scheme = schemeElement.Scheme;
        //				prefix = schemeElement.Prefix;
        //				UIConfiguration.Ratio = schemeElement.Point;
        //			}
        //		}
        //	}
        //	UIConfiguration.RatioPrefix = prefix.Replace("-", "");
        //}

        private static void InitialiseDefaultResourceGroups()
        {
            //// set the default resource groups to be used
            ImageManager.SetImagesetDefaultResourceGroup("imagesets");
            Font.SetDefaultResourceGroup("fonts");
            Scheme.SetDefaultResourceGroup("schemes");
            WidgetLookManager.SetDefaultResourceGroup("looknfeels");
            WindowManager.SetDefaultResourceGroup("layouts");
            //CEGUI::ScriptModule::setDefaultResourceGroup("lua_scripts");
            AnimationManager.SetDefaultResourceGroup("animations");

            //// setup default group for validation schemas
            //CEGUI::XMLParser* parser = CEGUI::System::getSingleton().getXMLParser();
            //if (parser->isPropertyPresent("SchemaDefaultResourceGroup"))
            //    parser->setProperty("SchemaDefaultResourceGroup", "schemas");
        }
Пример #2
0
        public Rectf GetViewRenderArea(ItemView itemView, bool hscroll, bool vscroll)
        {
            var wlf          = WidgetLookManager.GetSingleton().GetWidgetLook(itemView.GetLookNFeel());
            var scrollSuffix = string.Empty;

            if (vscroll)
            {
                scrollSuffix += "V";
            }

            if (hscroll)
            {
                scrollSuffix += "H";
            }

            if (!String.IsNullOrEmpty(scrollSuffix))
            {
                scrollSuffix += "Scroll";
            }

            var areaNames = new[] { "ItemRenderingArea", "ItemRenderArea" };
            var suffixes  = new[] { scrollSuffix, "" };

            for (var suffixId = 0; suffixId < 2; suffixId++)
            {
                var suffix = suffixes[suffixId];

                for (var areaId = 0; areaId < 2; ++areaId)
                {
                    var fullAreaName = areaNames[areaId] + suffix;

                    if (wlf.IsNamedAreaPresent(fullAreaName))
                    {
                        return(wlf.GetNamedArea(fullAreaName).GetArea().GetPixelRect(itemView));
                    }
                }
            }

            throw new UnknownObjectException("There is no item rendering area defined!");
        }