Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Game1"/> class.
        /// </summary>
        public Game1() : base(new Point(1024, 768), new Point(1024, 768))
        {

            // Load
            UseVerticalSync = true;
            ShowMouseCursor = true;

            _skinManager = new SkinManager("Default");
            _screenManager = new ScreenManager(this, _skinManager, "Font/Arial", 14);
            GrhInfo.Load(ContentPaths.Build, _screenManager.Content);

            var ts = new TestScreen(_screenManager);
            _screenManager.ActiveScreen = ts;

            Closed += Game1_Closed;

            KeyPressed += Game1_KeyPressed;

            // Shove GUI elements into a texture atlas so we can test them with atlasing
            var guiGrhs = GrhInfo.GrhDatas.SelectMany(x => x.Frames).Distinct()
                .Where(x => x.Categorization.Category.ToString().StartsWith("gui", StringComparison.OrdinalIgnoreCase));

            _guiTextureAtlas = new TextureAtlas(guiGrhs);

            Run();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Game1"/> class.
        /// </summary>
        public Game1() : base(new Point(1024, 768), new Point(1024, 768))
        {
            // Load
            UseVerticalSync = true;
            ShowMouseCursor = true;

            _skinManager   = new SkinManager("Default");
            _screenManager = new ScreenManager(this, _skinManager, "Font/Arial", 14);
            GrhInfo.Load(ContentPaths.Build, _screenManager.Content);

            var ts = new TestScreen(_screenManager);

            _screenManager.ActiveScreen = ts;

            Closed += Game1_Closed;

            KeyPressed += Game1_KeyPressed;

            // Shove GUI elements into a texture atlas so we can test them with atlasing
            var guiGrhs = GrhInfo.GrhDatas.SelectMany(x => x.Frames).Distinct()
                          .Where(x => x.Categorization.Category.ToString().StartsWith("gui", StringComparison.OrdinalIgnoreCase));

            _guiTextureAtlas = new TextureAtlas(guiGrhs);

            Run();
        }
Exemplo n.º 3
0
            /// <summary>
            /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
            /// from the given <paramref name="skinManager"/>.
            /// </summary>
            /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
            public override void LoadSkin(ISkinManager skinManager)
            {
                base.LoadSkin(skinManager);

                Sprite = GUIManager.SkinManager.GetSprite("item_slot");
                // SpriteOccupied =
            }
Exemplo n.º 4
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            BorderNormal  = skinManager.GetBorder(_controlSkinName);
            BorderOver    = skinManager.GetBorder(_controlSkinName, "MouseOver");
            BorderPressed = skinManager.GetBorder(_controlSkinName, "Pressed");

            Border = BorderNormal;
        }
Exemplo n.º 5
0
 public Startup(ISkinManager skinManager, ILayoutManager layoutManager, ITvStoreSelector storeSelector,
                IDialogManager dialogManager)
 {
     _skinManager   = skinManager;
     _layoutManager = layoutManager;
     _storeSelector = storeSelector;
     _dialogManager = dialogManager;
 }
Exemplo n.º 6
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            BorderNormal = skinManager.GetBorder(_controlSkinName);
            BorderOver = skinManager.GetBorder(_controlSkinName, "MouseOver");
            BorderPressed = skinManager.GetBorder(_controlSkinName, "Pressed");

            Border = BorderNormal;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ScreenManager"/> class.
        /// </summary>
        /// <param name="game">The <see cref="IGameContainer"/>.</param>
        /// <param name="skinManager">The <see cref="ISkinManager"/> used to manage all the general skinning
        /// between all screens.</param>
        /// <param name="defaultFontName">The asset name of the default font.</param>
        /// <param name="defaultFontSize">The size of the default font.</param>
        /// <exception cref="ArgumentNullException"><paramref name="game"/> is null.</exception>
        /// <exception cref="ArgumentNullException"><paramref name="skinManager"/> is null.</exception>
        public ScreenManager(IGameContainer game, ISkinManager skinManager, string defaultFontName, int defaultFontSize)
        {
            if (game == null)
            {
                throw new ArgumentNullException("game");
            }
            if (skinManager == null)
            {
                throw new ArgumentNullException("skinManager");
            }

            _game = game;

            _game.RenderWindowChanged -= _game_RenderWindowChanged;
            _game.RenderWindowChanged += _game_RenderWindowChanged;

            _skinManager = skinManager;

            _content        = ContentManager.Create();
            _drawingManager = new DrawingManager(_game.RenderWindow);

            _audioManager = Audio.AudioManager.GetInstance(_content);

            // Add event listeners to the input-related events
            _game.KeyPressed -= _game_KeyPressed;
            _game.KeyPressed += _game_KeyPressed;

            _game.KeyReleased -= _game_KeyReleased;
            _game.KeyReleased += _game_KeyReleased;

            _game.TextEntered -= _game_TextEntered;
            _game.TextEntered += _game_TextEntered;

            _game.MouseButtonPressed -= _game_MouseButtonPressed;
            _game.MouseButtonPressed += _game_MouseButtonPressed;

            _game.MouseButtonReleased -= _game_MouseButtonReleased;
            _game.MouseButtonReleased += _game_MouseButtonReleased;

            _game.MouseMoved -= _game_MouseMoved;
            _game.MouseMoved += _game_MouseMoved;

            _game.GainedFocus -= _game_GainedFocus;
            _game.GainedFocus += _game_GainedFocus;

            _game.LostFocus -= _game_LostFocus;
            _game.LostFocus += _game_LostFocus;

            // Load the global content used between screens
            _defaultFont = _content.LoadFont(defaultFontName, defaultFontSize, ContentLevel.Global);

            // Tell the other screens to load their content, too
            foreach (var screen in _screens.Values)
            {
                screen.LoadContent();
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            if (SourceSide != null && TargetSide != null && AcceptButton != null)
            {
                SetControlPositions();
            }
        }
Exemplo n.º 9
0
        public void InitializeSkinGallery(ISkinManager skinManager, string pageGroupName, string pageName)
        {
            var pageGroup = _ribbonPageGroupMapper.MapFrom(new ButtonGroup {
                Caption = pageGroupName
            });

            pageGroup.ItemLinks.Add(_skinGalleryMapper.MapFrom(_barManager, skinManager));
            pageFrom(_barManager.Ribbon.Pages, pageName).Groups.Add(pageGroup);
        }
Exemplo n.º 10
0
 public MenuAndToolBarPresenter(IMenuAndToolBarView view, IMenuBarItemRepository menuBarItemRepository,
                                IButtonGroupRepository buttonGroupRepository, IMRUProvider mruProvider, ISkinManager skinManager, IMoBiContext context)
     : base(view, menuBarItemRepository, mruProvider)
 {
     _skinManager           = skinManager;
     _context               = context;
     _menuBarItemRepository = menuBarItemRepository;
     _buttonGroupRepository = buttonGroupRepository;
 }
Exemplo n.º 11
0
 public UserSettingsPresenter(IUserSettingsView view, IUserSettings userSettings,
                              ISkinManager skinManager, IUserSettingsPersistor userSettingsPersistor,
                              IDialogCreator dialogCreator, IPKSimConfiguration configuration, ISpeciesRepository speciesRepository) : base(view)
 {
     _userSettings          = userSettings;
     _skinManager           = skinManager;
     _userSettingsPersistor = userSettingsPersistor;
     _dialogCreator         = dialogCreator;
     _configuration         = configuration;
     _speciesRepository     = speciesRepository;
 }
 protected override void Context()
 {
     _view                  = A.Fake <IUserSettingsView>();
     _skinManager           = A.Fake <ISkinManager>();
     _userSettingsPersistor = A.Fake <IUserSettingsPersistor>();
     _dialogCreator         = A.Fake <IDialogCreator>();
     _configuration         = A.Fake <IPKSimConfiguration>();
     _userSettings          = A.Fake <IUserSettings>();
     _speciesRepostiory     = A.Fake <ISpeciesRepository>();
     sut = new UserSettingsPresenter(_view, _userSettings, _skinManager, _userSettingsPersistor, _dialogCreator, _configuration, _speciesRepostiory);
 }
Exemplo n.º 13
0
        public RibbonGalleryBarItem MapFrom(RibbonBarManager barManager, ISkinManager skinManager)
        {
            var rgbiSkins = createSkinGallery(barManager);

            foreach (var skin in skinManager.All())
            {
                var command = _container.Resolve <ActivateSkinCommand>();
                command.SkinName = skin;
                addSkinToGallery(rgbiSkins, CreateMenuButton.WithCaption(skin).WithCommand(command));
            }
            return(rgbiSkins);
        }
Exemplo n.º 14
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            _ticked        = skinManager.GetControlSprite(_controlSkinName, "Ticked");
            _tickedOver    = skinManager.GetControlSprite(_controlSkinName, "TickedMouseOver");
            _tickedPressed = skinManager.GetControlSprite(_controlSkinName, "TickedPressed");

            _unticked        = skinManager.GetControlSprite(_controlSkinName, "Unticked");
            _untickedOver    = skinManager.GetControlSprite(_controlSkinName, "UntickedMouseOver");
            _untickedPressed = skinManager.GetControlSprite(_controlSkinName, "UntickedPressed");
        }
Exemplo n.º 15
0
 public MenuAndToolBarPresenter(IMenuAndToolBarView view, IMenuBarItemRepository menuBarItemRepository,
                                IButtonGroupRepository buttonGroupRepository, IMRUProvider mruProvider,
                                ISkinManager skinManager, IStartOptions startOptions, IWorkspace workspace, IActiveSubjectRetriever activeSubjectRetriever) : base(view, menuBarItemRepository, mruProvider)
 {
     _menuBarItemRepository  = menuBarItemRepository;
     _buttonGroupRepository  = buttonGroupRepository;
     _skinManager            = skinManager;
     _startOptions           = startOptions;
     _workspace              = workspace;
     _activeSubjectRetriever = activeSubjectRetriever;
     _enabled = true;
 }
Exemplo n.º 16
0
            /// <summary>
            /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
            /// from the given <paramref name="skinManager"/>.
            /// </summary>
            /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
            public override void LoadSkin(ISkinManager skinManager)
            {
                _defaultBorder   = skinManager.GetBorder(_controlSkinName);
                _mouseOverBorder = skinManager.GetBorder(_controlSkinName, "MouseOver");

                if (IsMouseEntered)
                {
                    Border = _mouseOverBorder;
                }
                else
                {
                    Border = _defaultBorder;
                }
            }
Exemplo n.º 17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GUIManager"/> class.
        /// </summary>
        /// <param name="window">The <see cref="Window"/> that provides the input.</param>
        /// <param name="font">Default <see cref="Font"/> to use for controls added to this <see cref="GUIManager"/>.</param>
        /// <param name="skinManager">The <see cref="ISkinManager"/> that handles the skinning for this
        /// <see cref="GUIManager"/>.</param>
        /// <param name="screenSize">The initial screen size value.</param>
        /// <exception cref="ArgumentNullException"><paramref name="skinManager"/> is null.</exception>
        public GUIManager(Window window, Font font, ISkinManager skinManager, Vector2 screenSize)
        {
            if (skinManager == null)
                throw new ArgumentNullException("skinManager");

            ScreenSize = screenSize;

            Window = window;
            _skinManager = skinManager;

            Font = font;

            // Create the tooltip
            _tooltip = CreateTooltip();
        }
Exemplo n.º 18
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            // Create the toolbar buttons for the form, if needed
            if (_closeButton == null)
            {
                _closeButton           = CreateCloseButton("Close");
                _closeButton.IsVisible = IsCloseButtonVisible;
                _closeButton.Clicked  += CloseButtonClicked;
            }

            // Load the border
            Border = skinManager.GetBorder(_controlSkinName);

            // Update the toolbar button positions
            UpdateToolbarButtonPositions();
        }
Exemplo n.º 19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GUIManager"/> class.
        /// </summary>
        /// <param name="window">The <see cref="Window"/> that provides the input.</param>
        /// <param name="font">Default <see cref="Font"/> to use for controls added to this <see cref="GUIManager"/>.</param>
        /// <param name="skinManager">The <see cref="ISkinManager"/> that handles the skinning for this
        /// <see cref="GUIManager"/>.</param>
        /// <param name="screenSize">The initial screen size value.</param>
        /// <exception cref="ArgumentNullException"><paramref name="skinManager"/> is null.</exception>
        public GUIManager(Window window, Font font, ISkinManager skinManager, Vector2 screenSize)
        {
            if (skinManager == null)
            {
                throw new ArgumentNullException("skinManager");
            }

            ScreenSize = screenSize;

            Window       = window;
            _skinManager = skinManager;

            Font = font;

            // Create the tooltip
            _tooltip = CreateTooltip();
        }
Exemplo n.º 20
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Game1"/> class.
        /// </summary>
        public Game1() : base(new Point(1024, 768), new Point(1024, 768))
        {
            UseVerticalSync = true;
            ShowMouseCursor = true;

            _skinManager = new SkinManager("Default");
            _screenManager = new ScreenManager(this, _skinManager, "Font/Arial", 14);
            GrhInfo.Load(ContentPaths.Build, _screenManager.Content);

            var ts = new TestScreen(_screenManager);
            _screenManager.ActiveScreen = ts;

            Closed += Game1_Closed;

            KeyPressed += Game1_KeyPressed;

            Run();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="SettingsManagerPresentationModel"/> class.
        /// </summary>
        /// <param name="eventAggregator">The event aggregator.</param>
        /// <param name="pageManager">The page manager.</param>
        /// <param name="view">The view.</param>
        /// <param name="skinManager">The skin manager.</param>
        public SettingsManagerPresentationModel(
            IEventAggregator eventAggregator,
            IPageManager pageManager,
            ISettingsView view,
            ISkinManager skinManager)
        {
            _skinManager = skinManager;

            _view                 = view;
            _view.Model           = this;
            _view.SkinPickerModel = _skinManager;

            pageManager.Pages.Add(this);

            eventAggregator.GetEvent <SettingChangedEvent>().Subscribe(OnSettingChanged, false);
            _settingsManager = new SettingsManager("defaultsettings.settings");
            InitializeSettings();
        }
Exemplo n.º 22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Game1"/> class.
        /// </summary>
        public Game1() : base(new Point(1024, 768), new Point(1024, 768))
        {
            UseVerticalSync = true;
            ShowMouseCursor = true;

            _skinManager   = new SkinManager("Default");
            _screenManager = new ScreenManager(this, _skinManager, "Font/Arial", 14);
            GrhInfo.Load(ContentPaths.Build, _screenManager.Content);

            var ts = new TestScreen(_screenManager);

            _screenManager.ActiveScreen = ts;

            Closed += Game1_Closed;

            KeyPressed += Game1_KeyPressed;

            Run();
        }
Exemplo n.º 23
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            // Don't reload the toolbar icons if the toolbar items have not been made yet
            if (_items == null)
            {
                return;
            }

            // Re-load the toolbar icons
            for (var i = 0; i < _items.Length; i++)
            {
                if (_items[i] == null)
                {
                    continue;
                }

                _items[i].Sprite = GetItemSprite(i);
            }
        }
Exemplo n.º 24
0
            /// <summary>
            /// Updates the sprites to use for the button.
            /// </summary>
            /// <param name="skinManager">The skin manager.</param>
            void UpdateSprites(ISkinManager skinManager)
            {
                // Make sure the sprite name has been set
                if (_spriteName == null || skinManager == null)
                {
                    return;
                }

                _sprite          = skinManager.GetControlSprite(_controlSkinName, _toolbarCategory, _spriteName);
                _spriteMouseOver = skinManager.GetControlSprite(_controlSkinName, _toolbarCategory,
                                                                _spriteName + _mouseOverSpriteSuffix);

                if (IsMouseEntered)
                {
                    Sprite = _spriteMouseOver;
                }
                else
                {
                    Sprite = _sprite;
                }
            }
        protected override void Context()
        {
            _view = A.Fake <IMenuAndToolBarView>();
            _menuBarItemRepository  = A.Fake <IMenuBarItemRepository>();
            _buttonGroupRepository  = A.Fake <IButtonGroupRepository>();
            _mruProvider            = A.Fake <IMRUProvider>();
            _skinManager            = A.Fake <ISkinManager>();
            _workspace              = A.Fake <IWorkspace>();
            _activeSubjectRetriever = A.Fake <IActiveSubjectRetriever>();
            _startOptions           = A.Fake <IStartOptions>();

            sut = new MenuAndToolBarPresenter(_view, _menuBarItemRepository, _buttonGroupRepository, _mruProvider, _skinManager, _startOptions, _workspace, _activeSubjectRetriever);


            A.CallTo(() => _menuBarItemRepository[A <MenuBarItemId> ._]).ReturnsLazily(item =>
            {
                {
                    var id = item.Arguments[0].DowncastTo <MenuBarItemId>();
                    return(FindMenuById(id));
                }
            });
        }
Exemplo n.º 26
0
 public MoBiMainViewPresenter(
     IMoBiMainView view,
     IRepository <IMainViewItemPresenter> allMainViewItemPresenters,
     IProjectTask projectTask,
     ISkinManager skinManager,
     IExitCommand exitCommand,
     IEventPublisher eventPublisher,
     IUserSettings userSettings,
     ITabbedMdiChildViewContextMenuFactory contextMenuFactory,
     IMoBiConfiguration configuration,
     IWatermarkStatusChecker watermarkStatusChecker) : base(view, eventPublisher, contextMenuFactory)
 {
     _skinManager               = skinManager;
     _exitCommand               = exitCommand;
     _userSettings              = userSettings;
     _configuration             = configuration;
     _watermarkStatusChecker    = watermarkStatusChecker;
     _allMainViewItemPresenters = allMainViewItemPresenters;
     _projectTask               = projectTask;
     _view.AttachPresenter(this);
     _view.InitializeResources();
 }
Exemplo n.º 27
0
        public UserSettings(DockManager dockManager, RibbonBarManager ribbonManager, INumericFormatterOptions numericFormatterOptions,
                            ISkinManager skinManager, IPKSimConfiguration configuration, DirectoryMapSettings directoryMapSettings)
        {
            _dockManager             = dockManager;
            _ribbonManager           = ribbonManager;
            _numericFormatterOptions = numericFormatterOptions;
            _skinManager             = skinManager;
            _directoryMapSettings    = directoryMapSettings;

            DisplayUnits     = new DisplayUnitsManager();
            ComparerSettings = new ComparerSettings {
                CompareHiddenEntities = false
            };
            ProjectFiles = new List <string>();
            Rules.AddRange(AllRules.All());
            DiagramOptions            = new DiagramOptions();
            TemplateDatabasePath      = configuration.DefaultTemplateUserDatabasePath;
            JournalPageEditorSettings = new JournalPageEditorSettings();
            ParameterIdentificationFeedbackEditorSettings = new ParameterIdentificationFeedbackEditorSettings();
            SensitivityAnalysisFeedbackEditorSettings     = new SensitivityAnalysisFeedbackEditorSettings();
            ResetToDefault();
            _layoutWasExplicitelyReset = false;
        }
Exemplo n.º 28
0
            /// <summary>
            /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
            /// from the given <paramref name="skinManager"/>.
            /// </summary>
            /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
            public override void LoadSkin(ISkinManager skinManager)
            {
                if (_spriteName == null)
                {
                    return;
                }

                base.LoadSkin(skinManager);

                const string buttonsCategory = _controlSkinName + SpriteCategorization.Delimiter + "Buttons";

                // Get the sprites
                _sprite          = skinManager.GetControlSprite(buttonsCategory, _spriteName);
                _spriteMouseOver = skinManager.GetControlSprite(buttonsCategory, _spriteName + "MouseOver");
                _spritePressed   = skinManager.GetControlSprite(buttonsCategory, _spriteName + "Pressed");

                // Set the control's size to the largest of the sprites
                var newSize = Vector2.One;

                if (_sprite != null)
                {
                    newSize = newSize.Max(_sprite.Size);
                }

                if (_spriteMouseOver != null)
                {
                    newSize = newSize.Max(_spriteMouseOver.Size);
                }

                if (_spritePressed != null)
                {
                    newSize = newSize.Max(_spritePressed.Size);
                }

                ClientSize = newSize;
            }
Exemplo n.º 29
0
 public Startup(ISkinManager skinManager)
 {
     _skinManager = skinManager;
 }
Exemplo n.º 30
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            RelocateControls();
        }
Exemplo n.º 31
0
 /// <summary>
 /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
 /// from the given <paramref name="skinManager"/>.
 /// </summary>
 /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
 public override void LoadSkin(ISkinManager skinManager)
 {
     // Do not skin the ChatBubbleText
 }
Exemplo n.º 32
0
            /// <summary>
            /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
            /// from the given <paramref name="skinManager"/>.
            /// </summary>
            /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
            public override void LoadSkin(ISkinManager skinManager)
            {
                _defaultBorder = skinManager.GetBorder(_controlSkinName);
                _mouseOverBorder = skinManager.GetBorder(_controlSkinName, "MouseOver");

                if (IsMouseEntered)
                    Border = _mouseOverBorder;
                else
                    Border = _defaultBorder;
            }
Exemplo n.º 33
0
 /// <summary>
 /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
 /// from the given <paramref name="skinManager"/>.
 /// </summary>
 /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
 public override void LoadSkin(ISkinManager skinManager)
 {
     Border = skinManager.GetBorder("Chat Bubble");
 }
Exemplo n.º 34
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            // Create the toolbar buttons for the form, if needed
            if (_closeButton == null)
            {
                _closeButton = CreateCloseButton("Close");
                _closeButton.IsVisible = IsCloseButtonVisible;
                _closeButton.Clicked += CloseButtonClicked;
            }

            // Load the border
            Border = skinManager.GetBorder(_controlSkinName);

            // Update the toolbar button positions
            UpdateToolbarButtonPositions();
        }
Exemplo n.º 35
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public virtual void LoadSkin(ISkinManager skinManager)
        {
            var type = GetType();
            var name = type.Name;

            if (type.IsGenericType)
                name = name.Substring(0, name.IndexOf('`'));

            Border = skinManager.GetBorder(name);
        }
Exemplo n.º 36
0
 /// <summary>
 /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
 /// from the given <paramref name="skinManager"/>.
 /// </summary>
 /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
 public override void LoadSkin(ISkinManager skinManager)
 {
     // Do not skin the ChatBubbleText
 }
Exemplo n.º 37
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            _ticked = skinManager.GetControlSprite(_controlSkinName, "Ticked");
            _tickedOver = skinManager.GetControlSprite(_controlSkinName, "TickedMouseOver");
            _tickedPressed = skinManager.GetControlSprite(_controlSkinName, "TickedPressed");

            _unticked = skinManager.GetControlSprite(_controlSkinName, "Unticked");
            _untickedOver = skinManager.GetControlSprite(_controlSkinName, "UntickedMouseOver");
            _untickedPressed = skinManager.GetControlSprite(_controlSkinName, "UntickedPressed");
        }
Exemplo n.º 38
0
 /// <summary>
 /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
 /// from the given <paramref name="skinManager"/>.
 /// </summary>
 /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
 public override void LoadSkin(ISkinManager skinManager)
 {
     Border = skinManager.GetBorder("Chat Bubble");
 }
Exemplo n.º 39
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            // Don't reload the toolbar icons if the toolbar items have not been made yet
            if (_items == null)
                return;

            // Re-load the toolbar icons
            for (var i = 0; i < _items.Length; i++)
            {
                if (_items[i] == null)
                    continue;

                _items[i].Sprite = GetItemSprite(i);
            }
        }
Exemplo n.º 40
0
 /// <summary>
 /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
 /// from the given <paramref name="skinManager"/>.
 /// </summary>
 /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
 public override void LoadSkin(ISkinManager skinManager)
 {
     _skinManager = skinManager;
     base.LoadSkin(skinManager);
     UpdateSprites(skinManager);
 }
Exemplo n.º 41
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            RepositionSlots();
        }
Exemplo n.º 42
0
 /// <summary>
 /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
 /// from the given <paramref name="skinManager"/>.
 /// </summary>
 /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
 public override void LoadSkin(ISkinManager skinManager)
 {
     Border = skinManager.GetBorder(_controlSkinName);
 }
Exemplo n.º 43
0
            /// <summary>
            /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
            /// from the given <paramref name="skinManager"/>.
            /// </summary>
            /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
            public override void LoadSkin(ISkinManager skinManager)
            {
                if (_spriteName == null)
                    return;

                base.LoadSkin(skinManager);

                const string buttonsCategory = _controlSkinName + SpriteCategorization.Delimiter + "Buttons";

                // Get the sprites
                _sprite = skinManager.GetControlSprite(buttonsCategory, _spriteName);
                _spriteMouseOver = skinManager.GetControlSprite(buttonsCategory, _spriteName + "MouseOver");
                _spritePressed = skinManager.GetControlSprite(buttonsCategory, _spriteName + "Pressed");

                // Set the control's size to the largest of the sprites
                var newSize = Vector2.One;

                if (_sprite != null)
                    newSize = newSize.Max(_sprite.Size);

                if (_spriteMouseOver != null)
                    newSize = newSize.Max(_spriteMouseOver.Size);

                if (_spritePressed != null)
                    newSize = newSize.Max(_spritePressed.Size);

                ClientSize = newSize;
            }
Exemplo n.º 44
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            UpdateButtonPositions();
        }
Exemplo n.º 45
0
            /// <summary>
            /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
            /// from the given <paramref name="skinManager"/>.
            /// </summary>
            /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
            public override void LoadSkin(ISkinManager skinManager)
            {
                base.LoadSkin(skinManager);

                Sprite = GUIManager.SkinManager.GetSprite("item_slot");
               // SpriteOccupied = 
            }
Exemplo n.º 46
0
        /// <summary>
        /// When overridden in the derived class, loads the skinning information for the <see cref="Control"/>
        /// from the given <paramref name="skinManager"/>.
        /// </summary>
        /// <param name="skinManager">The <see cref="ISkinManager"/> to load the skinning information from.</param>
        public override void LoadSkin(ISkinManager skinManager)
        {
            base.LoadSkin(skinManager);

            RelocateControls();
        }