Пример #1
0
        public virtual void Initialize(string _category = null, ISkinFile _file = null)
        {
            if (category == null)
            {
                _category = DefaultCategory;
            }
            if (file == null)
            {
                _file = DefaultSkinFile;
            }

            file     = _file;
            category = _category;

            TopLeftCorner     = GetTexture(file, category, "TopLeftCorner");
            TopRightCorner    = GetTexture(file, category, "TopRightCorner");
            BottomLeftCorner  = GetTexture(file, category, "BottomLeftCorner");
            BottomRightCorner = GetTexture(file, category, "BottomRightCorner");

            TopBorder    = GetTexture(file, category, "TopBorder");
            BottomBorder = GetTexture(file, category, "BottomBorder");
            LeftBorder   = GetTexture(file, category, "LeftBorder");
            RightBorder  = GetTexture(file, category, "RightBorder");

            Inside = GetTexture(file, category, "Inside");

            Font = GetMonoFont(file, category, "Font");

            base.BaseInitialize();
        }
 private static void InitializeFonts()
 {
     TryAddFont(SeFont.GetFontData());
     TryAddFont(MonoFont.GetFontData());
     TryAddFont(AbhayaLibreMedium.GetFontData());
     TryAddFont(BitstreamVeraSans.GetFontData());
 }
Пример #3
0
        public virtual void Initialize(string category = null, ISkinFile file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (file == null)
            {
                file = DefaultSkinFile;
            }

            //Textures
            Top                   = GetTexture(file, category, "Top");
            Bottom                = GetTexture(file, category, "Bottom");
            DropdownBorder        = file.GetColor(category, "DropdownBorder");
            DropdownBody          = file.GetColor(category, "DropdownBody");
            HighlightBorder       = file.GetColor(category, "HighlightBorder");
            HighlightBody         = file.GetColor(category, "HighlightBody");
            SeparatorColor        = file.GetColor(category, "SeparatorColor");
            ElementHighlightColor = file.GetColor(category, "ElementHighlightColor");

            //Fonts
            Font = GetMonoFont(file, category, "Font");

            //Colors
            FontColor          = file.GetColor(category, "FontColor");
            FontHighlightColor = file.GetColor(category, "FontHighlightColor");

            base.BaseInitialize();
        }
Пример #4
0
        public TextInputMachine(IKeyboardInput _keyboardInput, MonoFont font)
        {
            keyboardInput = _keyboardInput;

            Font         = font;
            AllowedChars = "";
            foreach (string line in font.Characters)
            {
                AllowedChars += line;
            }
        }
Пример #5
0
        public static void ReleaseResources()
        {
            VBO?.Dispose();
            VAO?.Dispose();

            NormalFont?.Dispose();
            SmallFont?.Dispose();
            TextRenderer?.Dispose();
            UIShader?.Dispose();

            NormalFont?.Dispose();
            SmallFont?.Dispose();
            MonoFont?.Dispose();
        }
Пример #6
0
        public virtual void Initialize(string category = null, ISkinFile file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (file == null)
            {
                file = DefaultSkinFile;
            }

            Font = GetMonoFont(file, category, "Font");

            base.BaseInitialize();
        }
Пример #7
0
        public MonoFont GetFont(int resourceGroup, string category, string name)
        {
            MonoFontDataVariables vars = fonts[category][name];

            MonoFont font = new MonoFont(
                SpriteSheet.GetSingleSprite(resourceManager, vars.Texture, resourceGroup),
                vars.Characters,
                vars.CharWidth,
                vars.CharHeight,
                vars.GridSize,
                vars.HorizontalSpace,
                vars.VerticalSpace);

            return(font);
        }
Пример #8
0
        public virtual void Initialize(string category = null, ISkinFile _file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (_file == null)
            {
                _file = DefaultSkinFile;
            }

            file = _file;

            TopRightCorner              = GetTexture(file, category, "TopRightCorner");
            BottomLeftCorner            = GetTexture(file, category, "BottomLeftCorner");
            BottomRightCorner           = GetTexture(file, category, "BottomRightCorner");
            UpperFieldBottomRightCorner = GetTexture(file, category, "UpperFieldBottomRightCorner");

            TopBorder    = GetTexture(file, category, "TopBorder");
            BottomBorder = GetTexture(file, category, "BottomBorder");
            LeftBorder   = GetTexture(file, category, "LeftBorder");
            MiddleBorder = GetTexture(file, category, "MiddleBorder");
            RightBorder  = GetTexture(file, category, "RightBorder");

            Inside = GetTexture(file, category, "Inside");

            FolderSign = GetTexture(file, category, "FolderSign");

            IconTop    = GetTexture(file, category, "IconTop");
            IconBottom = GetTexture(file, category, "IconBottom");
            IconLeft   = GetTexture(file, category, "IconLeft");
            IconRight  = GetTexture(file, category, "IconRight");
            IconInside = GetTexture(file, category, "IconInside");
            IconUpSign = GetTexture(file, category, "IconUpSign");

            IconInsidePressed = GetTexture(file, category, "IconInsidePressed");
            IconUpSignPressed = GetTexture(file, category, "IconUpSignPressed");

            Font = GetMonoFont(file, category, "Font");

            inputMachine = new TextInputMachine(KeyboardInput, Font);

            base.BaseInitialize();
        }
Пример #9
0
        public virtual void Initialize(string category = null, ISkinFile file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (file == null)
            {
                file = DefaultSkinFile;
            }

            TopLeftCorner     = GetTexture(file, category, "TopLeftCorner");
            TopRightCorner    = GetTexture(file, category, "TopRightCorner");
            BottomLeftCorner  = GetTexture(file, category, "BottomLeftCorner");
            BottomRightCorner = GetTexture(file, category, "BottomRightCorner");

            TopBorder    = GetTexture(file, category, "TopBorder");
            BottomBorder = GetTexture(file, category, "BottomBorder");
            LeftBorder   = GetTexture(file, category, "LeftBorder");
            RightBorder  = GetTexture(file, category, "RightBorder");

            //Button
            ButtonTopLeftCorner     = GetTexture(file, category, "ButtonTopLeftCorner");
            ButtonTopRightCorner    = GetTexture(file, category, "ButtonTopRightCorner");
            ButtonBottomLeftCorner  = GetTexture(file, category, "ButtonBottomLeftCorner");
            ButtonBottomRightCorner = GetTexture(file, category, "ButtonBottomRightCorner");

            ButtonTopBorder    = GetTexture(file, category, "ButtonTopBorder");
            ButtonBottomBorder = GetTexture(file, category, "ButtonBottomBorder");
            ButtonLeftBorder   = GetTexture(file, category, "ButtonLeftBorder");
            ButtonRightBorder  = GetTexture(file, category, "ButtonRightBorder");

            ButtonInside        = GetTexture(file, category, "ButtonInside");
            ButtonInsidePressed = GetTexture(file, category, "ButtonInsidePressed");

            Font = GetMonoFont(file, category, "Font");

            FontColor = file.GetColor(category, "FontColor");

            ReloadPageSizes();

            base.BaseInitialize();
        }
Пример #10
0
        public virtual void Initialize(string category = null, ISkinFile file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (file == null)
            {
                file = DefaultSkinFile;
            }

            TopLeftCorner     = GetTexture(file, category, "TopLeftCorner");
            TopRightCorner    = GetTexture(file, category, "TopRightCorner");
            BottomLeftCorner  = GetTexture(file, category, "BottomLeftCorner");
            BottomRightCorner = GetTexture(file, category, "BottomRightCorner");

            TopBorder    = GetTexture(file, category, "TopBorder");
            BottomBorder = GetTexture(file, category, "BottomBorder");
            LeftBorder   = GetTexture(file, category, "LeftBorder");
            RightBorder  = GetTexture(file, category, "RightBorder");

            Inside = GetTexture(file, category, "Inside");

            TopLeftCornerPressed     = GetTexture(file, category, "TopLeftCornerPressed");
            TopRightCornerPressed    = GetTexture(file, category, "TopRightCornerPressed");
            BottomLeftCornerPressed  = GetTexture(file, category, "BottomLeftCornerPressed");
            BottomRightCornerPressed = GetTexture(file, category, "BottomRightCornerPressed");

            TopBorderPressed    = GetTexture(file, category, "TopBorderPressed");
            BottomBorderPressed = GetTexture(file, category, "BottomBorderPressed");
            LeftBorderPressed   = GetTexture(file, category, "LeftBorderPressed");
            RightBorderPressed  = GetTexture(file, category, "RightBorderPressed");

            InsidePressed = GetTexture(file, category, "InsidePressed");

            Font = GetMonoFont(file, category, "Font");

            Pressed = false;

            base.BaseInitialize();
        }
Пример #11
0
        public virtual void Initialize(int bufferWidth, int bufferHeight, string category = null, ISkinFile file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (file == null)
            {
                file = DefaultSkinFile;
            }
            display = new char[bufferWidth, bufferHeight];
            Font    = GetMonoFont(file, category, "Font");

            Width  = bufferWidth * (Font.CharWidth + Font.HorizontalSpace);
            Height = bufferHeight * (Font.CharHeight + Font.VerticalSpace);

            inputMachine              = new TextInputMachine(KeyboardInput, Font);
            inputMachine.CursorMoved += new TextInputMachine.CursorEvent(machine_CursorMoved);
            inputMachine.Cursor       = inputMachine.Cursor;       //This will call machine_CursorMoved()

            base.BaseInitialize();
        }
Пример #12
0
        public virtual void Initialize(string category = null, ISkinFile file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (file == null)
            {
                file = DefaultSkinFile;
            }

            TopLeftCorner     = GetTexture(file, category, "TopLeftCorner");
            TopRightCorner    = GetTexture(file, category, "TopRightCorner");
            BottomLeftCorner  = GetTexture(file, category, "BottomLeftCorner");
            BottomRightCorner = GetTexture(file, category, "BottomRightCorner");

            TopBorder    = GetTexture(file, category, "TopBorder");
            BottomBorder = GetTexture(file, category, "BottomBorder");
            LeftBorder   = GetTexture(file, category, "LeftBorder");
            RightBorder  = GetTexture(file, category, "RightBorder");

            LeftHeader  = GetTexture(file, category, "LeftHeader");
            RightHeader = GetTexture(file, category, "RightHeader");
            TopHeader   = GetTexture(file, category, "TopHeader");

            Inside = GetTexture(file, category, "Inside");

            Header = true;

            CloseButton   = GetTexture(file, category, "CloseButton");
            CloseButtonOn = true;

            Font = GetMonoFont(file, category, "Font");

            base.BaseInitialize();
        }
Пример #13
0
        public virtual void Initialize(int columns, string category = null, ISkinFile file = null)
        {
            if (category == null)
            {
                category = DefaultCategory;
            }
            if (file == null)
            {
                file = DefaultSkinFile;
            }

            TopLeftCorner     = GetTexture(file, category, "TopLeftCorner");
            TopRightCorner    = GetTexture(file, category, "TopRightCorner");
            BottomLeftCorner  = GetTexture(file, category, "BottomLeftCorner");
            BottomRightCorner = GetTexture(file, category, "BottomRightCorner");

            TopBorder    = GetTexture(file, category, "TopBorder");
            BottomBorder = GetTexture(file, category, "BottomBorder");
            LeftBorder   = GetTexture(file, category, "LeftBorder");
            RightBorder  = GetTexture(file, category, "RightBorder");

            Inside = GetTexture(file, category, "Inside");

            //Button
            ButtonTopLeftCorner     = GetTexture(file, category, "ButtonTopLeftCorner");
            ButtonTopRightCorner    = GetTexture(file, category, "ButtonTopRightCorner");
            ButtonBottomLeftCorner  = GetTexture(file, category, "ButtonBottomLeftCorner");
            ButtonBottomRightCorner = GetTexture(file, category, "ButtonBottomRightCorner");

            ButtonTopBorder    = GetTexture(file, category, "ButtonTopBorder");
            ButtonBottomBorder = GetTexture(file, category, "ButtonBottomBorder");
            ButtonLeftBorder   = GetTexture(file, category, "ButtonLeftBorder");
            ButtonRightBorder  = GetTexture(file, category, "ButtonRightBorder");

            ButtonInside        = GetTexture(file, category, "ButtonInside");
            ButtonInsidePressed = GetTexture(file, category, "ButtonInsidePressed");

            Font = GetMonoFont(file, category, "Font");

            ColumnButtonColor = file.GetColor(category, "ColumnButtonColor");
            ListElementColor  = file.GetColor(category, "ListElementColor");

            SelectedElementColor   = file.GetColor(category, "SelectedElementColor");
            ElementUnderMouseColor = file.GetColor(category, "ElementUnderMouseColor");

            Width  = 100;
            Height = 100;

            //Set default sizes:
            int totalsize = 0;

            for (int n = 0; n < columns; n++)
            {
                columnNames.Add(Convert.ToString(n));
                totalsize += Font.MeasureString(columnNames[n]).X + ButtonLeftBorder.Width + ButtonRightBorder.Width;
            }

            for (int n = 0; n < columns; n++)
            {
                float fraction = (Font.MeasureString(columnNames[n]).X + ButtonLeftBorder.Width + ButtonRightBorder.Width) / (float)totalsize;
                columnSizes.Add((int)Math.Round(Width * fraction, 0));
            }

            sortTypes = new bool[columns];

            base.BaseInitialize();
        }