Beispiel #1
0
        public Alert(Manager manager, string alertText, string title = "Alert", bool autoClose = true, Control control = null, String icon = null)
            : base(manager)
        {
            yPos = 16;

            AutoClose = autoClose;
            Resizable = true;
            CloseButtonVisible = false;
            Text = title;
            if (control != null) {
                Add(control);
                yPos += control.Height + 16;
            }

            if (icon != null) {
                CreateIcon(icon);
            }

            if (alertText != String.Empty) {
                CreateTextContent(alertText);
            }

            CreateButtons();

            Height = DenyButton.Top + DenyButton.Height + 50;
            Width = Math.Max(MinWidth + 48, (Icon != null ? Icon.Width + 16 : 0) + (TextLabel != null ? TextLabel.Width + 16 : 0) + 20);
        }
Beispiel #2
0
 public ServerList(Manager _manager, String[] _headers, List<String[]> _data)
 {
     manager = _manager;
     headers = _headers;
     data = _data;
     Init();
 }
Beispiel #3
0
    ////////////////////////////////////////////////////////////////////////////

    #endregion

    #region //// Construstors //////

    ////////////////////////////////////////////////////////////////////////////       
    public CheckBox(Manager manager): base(manager)
    {
      CheckLayer(Skin, lrChecked);      

      Width = 64;
      Height = 16;           
    }    
 ////////////////////////////////////////////////////////////////////////////
 public ClipBox(Manager manager): base(manager)
 {            
   Color =  Color.Transparent;
   BackColor = Color.Transparent;
   CanFocus = false;
   Passive = true;      
 } 
 public Control CreateControl(Manager manager, Control parent, PropertyInfo field, object existingData)
 {
     var textToShow = existingData == null ? "0" : existingData.ToString();
     var textBox = new ValidationTextField(manager, "0", Constants.RegexValidations.Number) { Text = textToShow, Name = field.Name, Parent = parent };
     textBox.Init();
     return textBox;
 }
        ////////////////////////////////////////////////////////////////////////////
        public Container(Manager manager)
            : base(manager)
        {
            sbVert = new ScrollBar(manager, Orientation.Vertical);
              sbVert.Init();
              sbVert.Detached = false;
              sbVert.Anchor = Anchors.Top | Anchors.Right | Anchors.Bottom;
              sbVert.ValueChanged += new EventHandler(ScrollBarValueChanged);
              sbVert.Range = 0;
              sbVert.PageSize = 0;
              sbVert.Value = 0;
              sbVert.Visible = false;

              sbHorz = new ScrollBar(manager, Orientation.Horizontal);
              sbHorz.Init();
              sbHorz.Detached = false;
              sbHorz.Anchor = Anchors.Right | Anchors.Left | Anchors.Bottom;
              sbHorz.ValueChanged += new EventHandler(ScrollBarValueChanged);
              sbHorz.Range = 0;
              sbHorz.PageSize = 0;
              sbHorz.Value = 0;
              sbHorz.Visible = false;

              Add(sbVert, false);
              Add(sbHorz, false);
        }
 public StartupDialogSystem(Manager p_manager, Dictionary<string, Texture2D> p_textures)
 {
     manager = p_manager;
     hasChangedTilemap = false;
     requestToChangeTilemap = false;
     textures = p_textures;
 }
        public FormManager(GraphicsDeviceManager _graphics, Game _game, Manager _manager)
        {
            this.graphics = _graphics;
            this.parent = _game;

            manager = _manager;
        }
Beispiel #9
0
 /// <summary>
 /// Class constructor.
 /// </summary>
 public Timer(Manager manager)
     : base(manager)
 {
     //Initialize stuff
     m_Font = null;
     m_Time = TimeSpan.Zero;
 }
Beispiel #10
0
        /// <summary>
        /// Creates a new combo box control.
        /// </summary>
        /// <param name="manager">GUI manager for the combo box control.</param>
        public ComboBox(Manager manager)
            : base(manager)
        {
            // Set dimensions of the combo box text box control.
            Height = 20;
            Width = 64;
            ReadOnly = true;

            // Configure the combo box drop-down button control.
            btnDown = new Button(Manager);
            btnDown.Init();
            btnDown.Skin = new SkinControl(Manager.Skin.Controls["ComboBox.Button"]);
            btnDown.CanFocus = false;
            btnDown.Click += new EventHandler(btnDown_Click);
            Add(btnDown, false);

            // Configure the combo box drop-down list control.
            lstCombo = new ListBox(Manager);
            lstCombo.Init();
            lstCombo.HotTrack = true;
            lstCombo.Detached = true;
            lstCombo.Visible = false;
            lstCombo.Click += new EventHandler(lstCombo_Click);
            lstCombo.FocusLost += new EventHandler(lstCombo_FocusLost);
            lstCombo.Items = items;
            manager.Input.MouseDown += new MouseEventHandler(Input_MouseDown);
        }
Beispiel #11
0
        /// <summary>
        /// Game constructor.  Creates a new GraphicsDeviceManager and sets the root directory to "Content".
        /// </summary>
        public VTank()
        {
            GraphicsDeviceManager = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            Manager = new Manager(this, GraphicsDeviceManager);
            GraphicsDeviceManager.PreparingDeviceSettings += this.graphics_PreparingDeviceSettings;

            FormManager = new FormManager(GraphicsDeviceManager, this, Manager);
            Manager.SkinDirectory = @"Content\Skins\";

            // Set the resolution and full screen values in constructor so that it starts
            // with these values without needing graphics.ApplyChanges().
            Options = Options.ReadOptions();
            invocationBuffer = new InvocationBuffer();
            string resolution = Options.Video.Resolution;
            int width = int.Parse(resolution.Substring(0, resolution.IndexOf("x")));
            int height = int.Parse(resolution.Substring(resolution.IndexOf("x") + 1));

            GraphicsDeviceManager.PreferredBackBufferWidth = width;
            GraphicsDeviceManager.PreferredBackBufferHeight = height;
            GraphicsDeviceManager.IsFullScreen = !Options.Video.Windowed;

            Width = width;
            Height = height;
        }
Beispiel #12
0
 public StateSystem(Manager p_manager)
     : base()
 {
     shouldShutdown = false;
     manager = p_manager;
     canvasCanBeReached = false;
 }
        public ToolWindow(Sidebar sidebar)
        {
            this.sidebar = sidebar;
            this.manager = sidebar.manager;
            toolBar = new SideBar(manager);
            OrbIt.game.MainWindow.Add(toolBar);
            toolBar.MouseOver += delegate { UserInterface.tomShaneWasClicked = true; };
            toolBar.MouseOut += delegate { UserInterface.tomShaneWasClicked = false; };
            toolBar.Anchor = Anchors.Top | Anchors.Right | Anchors.Bottom;
            toolBar.Init();
            toolBar.Height = OrbIt.game.MainWindow.ClientArea.Height;
            toolBar.Width = 70;
            toolBar.Left = OrbIt.game.MainWindow.ClientArea.Width - toolBar.Width;

            buttonTextures["select"] = Assets.btnTextures[0, 0];
            buttonTextures["random"] = Assets.btnTextures[1, 0];
            buttonTextures["spawn"] = Assets.btnTextures[0, 1];
            buttonTextures["level"] = Assets.btnTextures[1, 1];
            buttonTextures["forceSpawn"] = Assets.btnTextures[0, 2];
            buttonTextures["forcePush"] = Assets.btnTextures[1, 2];
            buttonTextures["control"] = Assets.btnTextures[0, 3];
            buttonTextures["static"] = Assets.btnTextures[1, 3];
            buttonTextures["remove"] = Assets.btnTextures[0, 4];
            buttonTextures["resize"] = Assets.btnTextures[1, 4];
        }
 public ChatInputForm(Manager _manager, Vector2 _pos, int width)
 {
     manager = _manager;
     Init(_pos, width);
     Position = _pos;
     manager.Add(txtBox);
 }
Beispiel #15
0
        ////////////////////////////////////////////////////////////////////////////
        public Window(Manager manager)
            : base(manager)
        {
            CheckLayer(Skin, lrWindow);
              CheckLayer(Skin, lrCaption);
              CheckLayer(Skin, lrFrameTop);
              CheckLayer(Skin, lrFrameLeft);
              CheckLayer(Skin, lrFrameRight);
              CheckLayer(Skin, lrFrameBottom);
              CheckLayer(Manager.Skin.Controls[skButton], lrButton);
              CheckLayer(Manager.Skin.Controls[skShadow], lrShadow);

              SetDefaultSize(640, 480);
              SetMinimumSize(100, 75);

              btnClose = new Button(manager);
              btnClose.Skin = new SkinControl(Manager.Skin.Controls[skButton]);
              btnClose.Init();
              btnClose.Detached = true;
              btnClose.CanFocus = false;
              btnClose.Text = null;
              btnClose.Click += new EventHandler(btnClose_Click);
              btnClose.SkinChanged += new EventHandler(btnClose_SkinChanged);

              AdjustMargins();

              AutoScroll = true;
              Movable = true;
              Resizable = true;
              Center();

              Add(btnClose, false);

              oldAlpha = Alpha;
        }
    ////////////////////////////////////////////////////////////////////////////           
    ////////////////////////////////////////////////////////////////////////////

    #endregion

    #region //// Properties ////////

    ////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////    

    #endregion

    #region //// Construstors //////

    ////////////////////////////////////////////////////////////////////////////       
    public SideBarPanel(Manager manager): base(manager)
    {     
      CanFocus = false;
      Passive = true;
      Width = 64;
      Height = 64;
    }
        ////////////////////////////////////////////////////////////////////////////       
        public ListBox(Manager manager)
            : base(manager)
        {
            Width = 64;
            Height = 64;
            MinimumHeight = 16;

            sbVert = new ScrollBar(Manager, Orientation.Vertical);
            sbVert.Init();
            sbVert.Parent = this;
            sbVert.Left = Left + Width - sbVert.Width - Skin.Layers["Control"].ContentMargins.Right;
            sbVert.Top = Top + Skin.Layers["Control"].ContentMargins.Top;
            sbVert.Height = Height - Skin.Layers["Control"].ContentMargins.Vertical;
            sbVert.Anchor = Anchors.Top | Anchors.Right | Anchors.Bottom;
            sbVert.PageSize = 25;
            sbVert.Range = 1;
            sbVert.PageSize = 1;
            sbVert.StepSize = 10;

            pane = new ClipBox(manager);
            pane.Init();
            pane.Parent = this;
            pane.Top = Skin.Layers["Control"].ContentMargins.Top;
            pane.Left = Skin.Layers["Control"].ContentMargins.Left;
            pane.Width = Width - sbVert.Width - Skin.Layers["Control"].ContentMargins.Horizontal - 1;
            pane.Height = Height - Skin.Layers["Control"].ContentMargins.Vertical;
            pane.Anchor = Anchors.All;
            pane.Passive = true;
            pane.CanFocus = false;
            pane.Draw += new DrawEventHandler(DrawPane);

            CanFocus = true;
            Passive = false;
        }
Beispiel #18
0
      private const int refreshTime = 300; //ms
    #endregion
   
    #region //// Constructors //////

    ////////////////////////////////////////////////////////////////////////////
    public StackPanel(Manager manager, Orientation orientation): base(manager)
    {
      this.orientation = orientation;
      this.Color = Color.Transparent;
      this.autoRefresh = true;
      refreshTimer = new TimeSpan(0, 0, 0, 0, refreshTime);
    }
Beispiel #19
0
 public ConsoleArea(Manager manager)
     : base(manager)
 {
     data = new Queue<string>();
     TextColor = Color.Green;
     BackgroundColor = Color.Black;
 }
Beispiel #20
0
        public virtual void CreatePlayerInfo(Manager manager, Player player, Control control, ref int yPos)
        {
            var playerAvatar = player.Avatar;

            var imageIcon = new Button(manager) {
                Glyph = new Glyph(playerAvatar),
                Height = (int)(playerAvatar.Height / 1.5),
                Width = (int)(playerAvatar.Width / 1.5),
                Left = 16,
                Top = 16,
                Parent = control,
                Color = player.PlayerColor,
                Name = IgnoreString
            };
            imageIcon.Init();
            imageIcon.FocusGained += (sender, args) => imageIcon.Enabled = false;

            var descriptionText = new Label(manager) {
                Left = imageIcon.Left + imageIcon.Width + 16, Width = 200,
                Height = imageIcon.Height,
                Top = 25,
                Text = String.Format(
                    "Player Name : {0}\n\n" +
                    "Player Cash : ${1:N0}\n\n" +
                    "Player Total Worth : ${2:N0}\n\n" +
                    "Player Position : {3:N0}\n\n",
                    player.Name, player.Cash, player.TotalValue, PlayerPos(player)),
                Alignment = Alignment.TopLeft,
                Parent = control,
                Name = IgnoreString
            };
            descriptionText.Init();

            yPos = imageIcon.Top + imageIcon.Height + 16;
        }
Beispiel #21
0
 /// <summary>
 /// Creates a new TabControl.
 /// </summary>
 /// <param name="manager">GUI manager for the control.</param>
 public TabControl(Manager manager)
     : base(manager)
 {
     GamePadActions = new TabControlGamePadActions();
     Manager.Input.GamePadDown += new GamePadEventHandler(Input_GamePadDown);
     this.CanFocus = false;
 }
Beispiel #22
0
        protected override void LoadContent(PloobsEngine.Engine.GraphicInfo GraphicInfo, PloobsEngine.Engine.GraphicFactory factory, PloobsEngine.SceneControl.IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            ngui = Gui as NeoforceGui;
            manager = ngui.Manager;

            Window window = new Window(manager);
            window.Init();
            window.Text = "Options";
            window.Width = 480;
            window.Height = 200;
            window.Center();
            window.Visible = true;

            Button button = new Button(manager);
            button.Init();
            button.Text = "OK";
            button.Width = 72;
            button.Height = 24;
            button.Left = (window.ClientWidth / 2) - (button.Width / 2);
            button.Top = window.ClientHeight - button.Height - 8;
            button.Anchor = Anchors.Bottom;
            button.Parent = window;
            button.Click += new TomShane.Neoforce.Controls.EventHandler(button_Click);

            manager.Add(window);
        }
        public CollapsePanel(Manager manager, Control parent, string Name, int expandedHeight = 100, bool extended = true)
        {
            this.panel = new GroupPanel(manager);
            panel.Init();
            panel.Height = expandedHeight;
            panel.Width = parent.Width - 20;
            panel.Resizable = true;
            //panel.Text = "  " + Name.Trim();
            Text = Name;
            this.collapseButton = new Button(manager);
            collapseButton.Init();
            collapseButton.Width = 15;
            collapseButton.Height = 18;
            collapseButton.Text = "^";
            collapseButton.Click += collapseButton_Click;
            this.ExpandedHeight = expandedHeight;

            this.panelControls = new Dictionary<string, Control>();
            this.parent = parent;
            parent.Add(panel);
            parent.Add(collapseButton);
            this.IsExtended = extended;

            parent.Refresh();
        }
        private UnitInfoDialog(Manager manager)
            : base(manager)
        {
            Init();

            Height = 300;
            Width = 500;

            txtBox = new TextBox(manager);
            txtBox.Init();
            txtBox.Width = ClientWidth;
            txtBox.Height = ClientHeight - 30;
            txtBox.Left = 0;
            txtBox.Top = 0;
            txtBox.Parent = this;

            okButton = new Button(manager);
            okButton.Init();
            okButton.Text = "OK";
            okButton.Width = txtBox.Width; ;
            okButton.Height = 30;
            okButton.Top = txtBox.Height;
            okButton.Parent = this;
            okButton.Click += new TomShane.Neoforce.Controls.EventHandler(okButton_Click);

            manager.Add(this);
        }
Beispiel #25
0
    ////////////////////////////////////////////////////////////////////////////    

    #endregion

    #region //// Construstors //////

    ////////////////////////////////////////////////////////////////////////////       
    public Label(Manager manager): base(manager)
    {      
      CanFocus = false;    
      Passive = true;    
      Width = 64;
      Height = 16;    
    }
        private NewEraWindow(Manager manager, Era era)
            : base(manager)
        {
            Init();

            Width = 950;
            Height = 550;

            _lblEraImage = new ImageBox(manager);
            _lblEraImage.Init();
            _lblEraImage.Left = 4;
            _lblEraImage.Top = 10;          
            _lblEraImage.Width = 924;
            _lblEraImage.Height = 472;
            _lblEraImage.Image = era.Image;
            Add(_lblEraImage);

            _lblDescription = new Label(manager);
            _lblDescription.Init();
            _lblDescription.Left = 4;
            _lblDescription.Top = 482;
            _lblDescription.Width = 924;
            _lblDescription.Height = 16;
            _lblDescription.Text = string.Format(Strings.TXT_KEY_UI_NEWERA_WELCOME, era.Title);
            Add(_lblDescription);

            Manager.Add(this);
        }
 public static void Show(Manager manager, Era era, string title)
 {
     NewEraWindow msgBox = new NewEraWindow(manager, era);
     msgBox.Text = title;
     msgBox.Resizable = false;
     msgBox.ShowModal();
 }
		////////////////////////////////////////////////////////////////////////////

		#endregion

		#region //// Constructors //////

		////////////////////////////////////////////////////////////////////////////
		public TabPage(Manager manager)
			: base(manager)
		{
			Color = Color.Transparent;
			Passive = true;
			CanFocus = false;
		}
        /// <summary>
        /// Create and initialize the game console form components.
        /// </summary>
        /// <param name="_manager">Parent manager that oversees the windows.</param>
        /// <param name="frame">Desired width/height of the components.</param>
        public GameConsoleForm(Manager _manager, Rectangle frame)
        {
            manager = _manager;
            windowFrame = frame;

            Initialize();
        }
Beispiel #30
0
        public GameMapBox(Manager manager)
            : base(manager)
        {
            _mapRenderer = new MapRenderer(manager);

            Initialize();
        }
Beispiel #31
0
 public AdvModControl(TomShane.Neoforce.Controls.Manager manager, Game game, Pack p) : base(manager)
 {
     this.p       = p;
     this.manager = manager;
     this.game    = game;
 }
Beispiel #32
0
 public AdvModControl(TomShane.Neoforce.Controls.Manager manager) : base(manager)
 {
     this.manager = manager;
 }