当前位置: 首页>>代码示例>>C#>>正文


C# Manager.Add方法代码示例

本文整理汇总了C#中TomShane.Neoforce.Controls.Manager.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Manager.Add方法的具体用法?C# Manager.Add怎么用?C# Manager.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TomShane.Neoforce.Controls.Manager的用法示例。


在下文中一共展示了Manager.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChatInputForm

 public ChatInputForm(Manager _manager, Vector2 _pos, int width)
 {
     manager = _manager;
     Init(_pos, width);
     Position = _pos;
     manager.Add(txtBox);
 }
开发者ID:summer-of-software,项目名称:vtank,代码行数:7,代码来源:ChatInputForm.cs

示例2: LoadContent

        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);
        }
开发者ID:tubitos,项目名称:1,代码行数:28,代码来源:Options.cs

示例3: UnitInfoDialog

        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);
        }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:27,代码来源:UnitInfoDialog.cs

示例4: EditNodeWindow

        private EditNodeWindow(Sidebar sidebar, ViewType viewType)
        {
            this.sidebar = sidebar;
            this.manager = sidebar.manager;
            neoSidebar = new NeoSidebar(manager);
            neoSidebar.Init();
            int tomtom = 5;
            neoSidebar.ClientArea.BackColor = UserInterface.TomDark;
            neoSidebar.BackColor = Color.Black;
            neoSidebar.BevelBorder = BevelBorder.All;
            Margins tomtomtomtom = new Margins(tomtom, tomtom, tomtom, tomtom);
            neoSidebar.ClientMargins = tomtomtomtom;

            neoSidebar.Left = sidebar.master.Left;
            neoSidebar.Width = sidebar.Width;
            neoSidebar.Top = 0;
            neoSidebar.Resizable = false;
            neoSidebar.Movable = false;
            neoSidebar.Height = OrbIt.ScreenHeight;
            neoSidebar.Text = "Edit";
            manager.Add(neoSidebar);

            int width = 120;
            int offset = neoSidebar.Width - width - 20;

            titlePanelEditNode = new TitlePanel(sidebar, neoSidebar, "Edit", true);
            titlePanelEditNode.btnBack.Click += (s, e) =>
            {
                sidebar.groupsView.UpdateGroups();
                manager.Remove(neoSidebar);
            };

            HeightCounter += titlePanelEditNode.Height;

            lblName = new Label(manager);
            lblName.Init();
            lblName.Parent = neoSidebar;
            lblName.Left = LeftPadding;
            lblName.Top = HeightCounter;
            lblName.Width = width;

            txtName = new TextBox(manager);
            txtName.Init();
            txtName.Parent = neoSidebar;
            txtName.Top = HeightCounter;
            txtName.Width = width;
            txtName.Left = offset;
            HeightCounter += txtName.Height + LeftPadding;
            txtName.TextColor = Color.Black;
            txtName.Enabled = false;

            componentView = new ComponentView(sidebar, neoSidebar, 0, HeightCounter, viewType);
            componentView.Width = neoSidebar.Width - 20;
            componentView.insView.Height += componentView.insView.Height / 2;

            neoSidebar.Width += 100;
            neoSidebar.Width -= 100;
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:58,代码来源:EditNodeWindow.cs

示例5: MessageBox

 public MessageBox(Manager manager, MessageBoxType type)
     : base(manager)
 {
     Type = type;
     buttons = new List<Button>();
     Init();
     manager.Add(window);
     Pop();
 }
开发者ID:summer-of-software,项目名称:vtank,代码行数:9,代码来源:MessageBox.cs

示例6: LoadLevelWindow

        //, Control under)
        public LoadLevelWindow(Sidebar sidebar)
        {
            previouslyPaused = sidebar.ui.IsPaused;
            sidebar.ui.IsPaused = true;
            sidebar.master.Visible = false;
            Control par = sidebar.tbcViews.TabPages[0];
            UserInterface.GameInputDisabled = true;
            this.manager = sidebar.manager;
            this.sidebar = sidebar;
            tomShaneSidebar = new TomShaneSidebar(manager);
            tomShaneSidebar.Init();
            tomShaneSidebar.Left = sidebar.master.Left;
            tomShaneSidebar.Width = par.Width;
            tomShaneSidebar.Top = 20;
            tomShaneSidebar.Height = par.Height + 15;
            tomShaneSidebar.BevelBorder = BevelBorder.All;
            tomShaneSidebar.BevelColor = Color.Black;
            tomShaneSidebar.Left = LeftPadding;
            tomShaneSidebar.Text = "Load Level";
            tomShaneSidebar.BackColor = new Color(30, 60, 30);
            manager.Add(tomShaneSidebar);

            wallGroup = sidebar.room.groups.walls;
            foreach(Node n in wallGroup.entities)
            {
                previousWallNodes.Add(n);
            }

            TitlePanel titlePanelAddComponent = new TitlePanel(sidebar, tomShaneSidebar, "Load Level", false);
            //titlePanelAddComponent.btnBack.Click += Close;
            HeightCounter += titlePanelAddComponent.Height;

            normalView = new NormalView(sidebar, tomShaneSidebar, 0, 100, Height: 350);
            normalView.Width -= 15;
            PopulateLevelSaves();

            normalView.OnSelectionChanged += normalView_OnSelectionChanged;

            btnLoad = new Button(manager);
            btnLoad.Init();
            tomShaneSidebar.Add(btnLoad);
            btnLoad.Text = "Load";
            btnLoad.Top = 500;
            btnLoad.Left = LeftPadding * 4;
            btnLoad.Width = 70;
            btnLoad.Click += btnLoad_Click;

            btnCancel = new Button(manager);
            btnCancel.Init();
            tomShaneSidebar.Add(btnCancel);
            btnCancel.Text = "Cancel";
            btnCancel.Top = 500;
            btnCancel.Left = btnLoad.Left + btnLoad.Width + 50;
            btnCancel.Width = 70;
            btnCancel.Click += btnCancel_Click;
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:57,代码来源:LoadLevelWindow.cs

示例7: TowerBaseInfoWindow

 public TowerBaseInfoWindow(Manager manager)
     : base(manager)
 {
     lblInterval = new Label(manager);
     lblDamage = new Label(manager);
     lblDescription = new RappingLabel(manager);
     lblRange = new Label(manager);
     lblPrice = new Label(manager);
     manager.Add(this);
 }
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:10,代码来源:TowerBaseInfoWindow.cs

示例8: GameOverWindow

 public GameOverWindow(Manager manager, GamePlayScreen screen)
     : base(manager)
 {
     GamePlayScreen = screen;
     LostMessage = new RappingLabel(manager);
     Points = new Label(manager);
     RestartGame = new Button(manager);
     GoMainMenu = new Button(manager);
     ExitGame = new Button(manager);
     manager.Add(this);
 }
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:11,代码来源:GameOverWindow.cs

示例9: GamemodeWindow

        public GamemodeWindow(Sidebar sidebar)
        {
            this.manager = sidebar.manager;
            this.sidebar = sidebar;

            window = new Window(manager);
            window.Init();
            window.Left = sidebar.master.Left;
            window.Width = sidebar.master.Width;
            window.Top = 0;
            window.Height = 600;
            window.Text = "Game Mode";
            manager.Add(window);

            TitlePanel titlePanel = new TitlePanel(sidebar, window, "Game Mode", true);
            titlePanel.btnBack.Click += (s, e) => window.Close();

            HeightCounter += titlePanel.topPanel.Height + LeftPadding * 2;

            lblMode = new Label(manager);
            lblMode.Init();
            lblMode.Parent = window;
            lblMode.Top = HeightCounter;
            lblMode.Left = LeftPadding;
            lblMode.Text = "Game Mode Options";
            lblMode.Width = 120;
            lblMode.TextColor = Color.Black;

            //cbMode = new ComboBox(manager);
            //cbMode.Init();
            //cbMode.Parent = window;
            //cbMode.Left = lblMode.Left + lblMode.Width;
            //cbMode.Top = HeightCounter;
            //cbMode.Width = 100;
            //
            //foreach (GameModes m in Enum.GetValues(typeof(GameModes)))
            //{
            //    cbMode.Items.Add(m);
            //}
            HeightCounter += lblMode.Height + LeftPadding * 3;

            insViewModes = new InspectorView(sidebar, window, LeftPadding, HeightCounter);
            insViewModes.Width -= 20;
            insViewModes.Height -= 100;
            HeightCounter += insViewModes.Height + LeftPadding * 3;
            insViewModes.SetRootObject(OrbIt.globalGameMode);

            //insViewGlobal = new InspectorView(sidebar, window, LeftPadding, HeightCounter);
            //insViewGlobal.Width -= 20;
            //insViewGlobal.Height -= 100;

            window.Refresh();
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:53,代码来源:GamemodeWindow.cs

示例10: ShowSimpleInputDialog

        /// <summary>
        /// Shows the simple input dialog.
        /// </summary>
        public void ShowSimpleInputDialog(Manager manager, string caption, string text, string initialValue,
            TomShane.Neoforce.Controls.EventHandler okBtnEventHandler)
        {
            window = new Window(manager);
            window.Init();
            window.Width = 450;
            window.Height = 150;
            window.Text = caption;
            window.Closing += OnSimpleInputDialogClosing;
            window.Visible = true;

            Label label = new Label(manager);
            label.Init();
            label.Text = text;
            label.Width = 400;
            label.Height = 20;
            label.Left = 5;
            label.Top = 5;
            label.Parent = window;

            TextBox textBox = new TextBox(manager);
            textBox.Init();
            textBox.Width = 400;
            textBox.Height = 20;
            textBox.Left = 5;
            textBox.Top = 40;
            textBox.Text = initialValue;
            textBox.Parent = window;

            Button btnSimpleInputDialogOk = new Button(manager);
            btnSimpleInputDialogOk.Init();
            btnSimpleInputDialogOk.Text = "Ok";
            btnSimpleInputDialogOk.Width = 100;
            btnSimpleInputDialogOk.Height = 30;
            btnSimpleInputDialogOk.Left = 5;
            btnSimpleInputDialogOk.Top = 75;
            btnSimpleInputDialogOk.Click += okBtnEventHandler;
            btnSimpleInputDialogOk.Click += OnClickBtnSimpleInputDialogOk;
            btnSimpleInputDialogOk.Tag = textBox; // Textbox as Tag, to access the value
            btnSimpleInputDialogOk.Parent = window;

            Button btnSimpleInputDialogCancel = new Button(manager);
            btnSimpleInputDialogCancel.Init();
            btnSimpleInputDialogCancel.Text = "Cancel";
            btnSimpleInputDialogCancel.Width = 100;
            btnSimpleInputDialogCancel.Height = 30;
            btnSimpleInputDialogCancel.Left = 110;
            btnSimpleInputDialogCancel.Top = 75;
            btnSimpleInputDialogCancel.Click += OnClickBtnSimpleInputDialogCancel;
            btnSimpleInputDialogCancel.Parent = window;

            manager.Add(window);
        }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:56,代码来源:SimpleInputDialog.cs

示例11: AddComponentWindow

        private AddComponentWindow(Sidebar sidebar, Control under, DetailedView view, bool addToGroup = true)
        {
            this.under = under;
            under.Visible = false;
            sidebar.master.Visible = false;
            this.addToGroup = addToGroup;

            Control par = sidebar.tbcViews.TabPages[0];
            UserInterface.GameInputDisabled = true;
            this.view = view;
            this.manager = sidebar.manager;
            this.sidebar = sidebar;
            neoSidebar = new NeoSidebar(manager);
            neoSidebar.Init();
            neoSidebar.Left = sidebar.master.Left;
            neoSidebar.Width = par.Width;
            neoSidebar.Top = 5;
            neoSidebar.Height = par.Height + 15;
            neoSidebar.BevelBorder = BevelBorder.All;
            neoSidebar.BevelColor = Color.Black;
            neoSidebar.Left = LeftPadding;
            neoSidebar.Text = "Add Component";
            neoSidebar.BackColor = new Color(30, 60, 30);
            manager.Add(neoSidebar);

            TitlePanel titlePanelAddComponent = new TitlePanel(sidebar, neoSidebar, "Add Component", true);
            titlePanelAddComponent.btnBack.Click += Close;
            HeightCounter += titlePanelAddComponent.Height;
            NewLabel("Add", 15, false);
            NewLabel("Name", 50, false);
            int left = 145;
            NewLabel("AO", left, false);
            NewLabel("AS", left + 20, false);
            NewLabel("DR", left + 40, false);

            btnAdd = new Button(manager);
            btnAdd.Init();
            btnAdd.Parent = neoSidebar;
            btnAdd.Width = 150;
            btnAdd.Top = neoSidebar.Height - btnAdd.Height * 2;
            btnAdd.Left = neoSidebar.Width / 2 - btnAdd.Width / 2;
            btnAdd.Text = "Add Components";
            btnAdd.Click += AddComponents;
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:44,代码来源:AddComponentWindow.cs

示例12: ShowChooseEnumDialog

        /// <summary>
        /// Shows the chose enum dialog.
        /// </summary>
        public void ShowChooseEnumDialog(Manager manager, string caption, Type type, EnumChooseEventHandler btnEventHandler)
        {
            _type = type;
            _handler = btnEventHandler;

            window = new Window(manager);
            window.Init();
            window.Width = 175;
            window.Text = caption;
            window.Icon = IconProvider.ApplicationIcon;
            window.CaptionVisible = true;
            window.Closing += OnChooseEnumDialogClosing;
            window.Visible = true;

            if (!type.IsEnum)
            {
                CloseDialog();
            }
            else
            {
                int offsetY = 5;

                foreach (object value in Enum.GetValues(type))
                {
                    string name = value.ToString();

                    Button btnEnumName = new Button(manager);
                    btnEnumName.Init();
                    btnEnumName.Text = name;
                    btnEnumName.Width = 150;
                    btnEnumName.Height = 30;
                    btnEnumName.Left = 5;
                    btnEnumName.Top = offsetY;
                    btnEnumName.Tag = value;
                    btnEnumName.Click += OnClickBtnEnumName;
                    btnEnumName.Parent = window;

                    offsetY += 35;
                }

                window.Height = offsetY + 35;
                manager.Add(window);
            }
        }
开发者ID:mrommel,项目名称:MiRo.SimHexWorld,代码行数:47,代码来源:ChooseEnumDialog.cs

示例13: EditLinkWindow

        public EditLinkWindow(Sidebar sidebar, Link link, string FieldName)
        {
            this.sidebar = sidebar;
            this.manager = sidebar.manager;
            neoSidebar = new NeoSidebar(manager);
            neoSidebar.Init();
            int tomtom = 5;
            neoSidebar.ClientArea.BackColor = UserInterface.TomDark;
            neoSidebar.BackColor = Color.Black;
            neoSidebar.BevelBorder = BevelBorder.All;
            Margins tomtomtomtom = new Margins(tomtom, tomtom, tomtom, tomtom);
            neoSidebar.ClientMargins = tomtomtomtom;

            neoSidebar.Left = sidebar.master.Left;
            neoSidebar.Width = sidebar.Width;
            neoSidebar.Top = 0;
            neoSidebar.Resizable = false;
            neoSidebar.Movable = false;
            neoSidebar.Height = OrbIt.ScreenHeight;
            neoSidebar.Text = "Edit";
            manager.Add(neoSidebar);

            int width = 120;
            int offset = neoSidebar.Width - width - 20;

            titlePanelEditNode = new TitlePanel(sidebar, neoSidebar, "Edit" + FieldName, true);
            titlePanelEditNode.btnBack.Click += (s, e) =>
            {
                sidebar.groupsView.UpdateGroups();
                manager.Remove(neoSidebar);
            };

            HeightCounter += titlePanelEditNode.Height;

            componentView = new ComponentView(sidebar, neoSidebar, 0, HeightCounter, ViewType.Link);
            componentView.Width = neoSidebar.Width - 20;
            componentView.insView.Height += componentView.insView.Height / 2;

            neoSidebar.Width += 100;
            neoSidebar.Width -= 100;

            componentView.SwitchLink(link);
        }
开发者ID:GameMakersUnion,项目名称:BoulderDash-OrbIt,代码行数:43,代码来源:EditLinkWindow.cs

示例14: GuiInitialize


//.........这里部分代码省略.........
            spnMutRate.Minimum = 0;
            spnMutRate.Rounding = 0;
            spnMutRate.Value = Game1.Globals.MutationRate;
            spnMutRate.Step = 1;
            spnMutRate.Passive = true;
            spnMutRate.Text = Convert.ToString(spnMutRate.Value);
            spnMutRate.Parent = wndSettings;

            lblSolar = new Label(manager);
            lblSolar.Init();
            lblSolar.Parent = wndSettings;
            lblSolar.Left = 10;
            lblSolar.Top = 60;
            lblSolar.Text = "Solar Radiation:";
            lblSolar.Width = 130;
            lblSolar.Height = 20;

            spnSolar = new SpinBox(manager, SpinBoxMode.Range);
            spnSolar.Init();
            spnSolar.ReadOnly = true;
            spnSolar.Width = 60;
            spnSolar.Height = 20;
            spnSolar.Top = 80;
            spnSolar.Left = 10;
            spnSolar.Maximum = 10;
            spnSolar.Minimum = 0;
            spnSolar.Rounding = 0;
            spnSolar.Step = 1;
            spnSolar.Value = Game1.Globals.SolarIntensity;
            spnSolar.Passive = true;
            spnSolar.Text = Convert.ToString(spnSolar.Value);
            spnSolar.Parent = wndSettings;

            lblLifeSpan = new Label(manager);
            lblLifeSpan.Init();
            lblLifeSpan.Parent = wndSettings;
            lblLifeSpan.Left = 10;
            lblLifeSpan.Top = 110;
            lblLifeSpan.Text = "Life in Mins:";
            lblLifeSpan.Width = 130;
            lblLifeSpan.Height = 20;

            spnLifeSpan = new SpinBox(manager, SpinBoxMode.Range);
            spnLifeSpan.Init();
            spnLifeSpan.ReadOnly = true;
            spnLifeSpan.Width = 60;
            spnLifeSpan.Height = 20;
            spnLifeSpan.Top = 130;
            spnLifeSpan.Left = 10;
            spnLifeSpan.Maximum = 30;
            spnLifeSpan.Minimum = 0;
            spnLifeSpan.Rounding = 0;
            spnLifeSpan.Step = 1;
            spnLifeSpan.Value = Game1.Globals.SymetLifespan;
            spnLifeSpan.Passive = true;
            spnLifeSpan.Text = Convert.ToString(spnLifeSpan.Value);
            spnLifeSpan.Parent = wndSettings;

            lblSpeed = new Label(manager);
            lblSpeed.Init();
            lblSpeed.Parent = wndSettings;
            lblSpeed.Left = 10;
            lblSpeed.Top = 160;
            lblSpeed.Text = "Game Speed:";
            lblSpeed.Width = 130;
            lblSpeed.Height = 20;

            spnSpeed = new SpinBox(manager, SpinBoxMode.Range);
            spnSpeed.Init();
            spnSpeed.ReadOnly = true;
            spnSpeed.Width = 60;
            spnSpeed.Height = 20;
            spnSpeed.Top = 180;
            spnSpeed.Left = 10;
            spnSpeed.Maximum = 10;
            spnSpeed.Minimum = 0;
            spnSpeed.Rounding = 0;
            spnSpeed.Step = 1;
            spnSpeed.Value = Game1.Globals.SymetSpeed;
            spnSpeed.Text = Convert.ToString(spnSpeed.Value);
            spnSpeed.Passive = true;
            spnSpeed.Parent = wndSettings;

            // Create Done Button.
            btnSettingsClose = new Button(manager);
            btnSettingsClose.Init();
            btnSettingsClose.Text = "Done";
            btnSettingsClose.Width = 72;
            btnSettingsClose.Height = 24;
            btnSettingsClose.Left = 400 - 92;
            btnSettingsClose.Top = 300 - 64;
            btnSettingsClose.Anchor = Anchors.Bottom;
            btnSettingsClose.Parent = wndSettings;
            btnSettingsClose.Click += new MouseEventHandler(btnDone_Click);
            #endregion

            // Add the window controls to the manager processing queue.
            manager.Add(BottomBar);
            manager.Add(wndSettings);
        }
开发者ID:Eamnon,项目名称:Emergence,代码行数:101,代码来源:Forms.cs

示例15: DetoxConsole

        /// <summary>
        /// Default Constructor
        /// </summary>
        /// <param name="manager"></param>
        public DetoxConsole(Manager manager)
            : base(manager)
        {
            // Initialize this control..
            base.Init();
            base.Left = base.Top = 0;
            base.Name = "frmConsole";
            base.Width = Terraria.MainGame.Window.ClientBounds.Width;
            base.Height = 250;
            base.Alpha = 255;
            base.Resizable = false;
            //
            //
            //
            this._console = new TomShane.Neoforce.Controls.Console(manager)
                {
                    Anchor = Anchors.All,
                    Name = "DetoxConsole",
                    Width = base.ClientArea.Width,
                    Height = base.ClientArea.Height,
                    ChannelsVisible = false,
                    MessageFormat = ConsoleMessageFormats.TimeStamp,
                    TextColor = Color.White
                };
            this._console.Channels.AddRange(new[]
                {
                    new ConsoleChannel(0, "About", Color.Chartreuse),
                    new ConsoleChannel(1, "Default", Color.White),
                    new ConsoleChannel(2, "Warning", Color.Yellow),
                    new ConsoleChannel(3, "Error", Color.Red)
                });
            this._console.SelectedChannel = 1;
            this._console.MessageSent += (sender, e) =>
                {
                    // Ensure the command is valid..
                    if (string.IsNullOrEmpty(e.Message.Text) || !e.Message.Text.StartsWith("/"))
                        return;

                    // Attempt to handle the command..
                    e.Handled = ConsoleCommands.ProcessCommand(e.Message.Text);
                    if (!e.Handled)
                    {
                        this.LogConsoleMessage(new DetoxAPI.ConsoleMessage("Invalid command or command error occurred.", ConsoleMessageType.Error));
                        e.Handled = true;
                    }
                };
            this._console.Init();
            //
            //
            //
            base.Add(this._console);
            manager.Add(this);

            // Attach device settings event to resize console..
            manager.DeviceSettingsChanged += args =>
                {
                    // Adjust the base panel size..
                    base.Width = Terraria.MainGame.Window.ClientBounds.Width;
                    base.Height = 250;

                    // Adjust the console size..
                    this._console.Width = base.ClientArea.Width;
                    this._console.Height = base.ClientArea.Height;
                };

            // Locate the console textbox..
            var consoleEdit = this._console.Controls.SingleOrDefault(c => c.GetType() == typeof(TextBox));
            if (consoleEdit == null) return;

            consoleEdit.KeyDown += (sender, e) =>
                {
                    // Prevent tilde from being processed..
                    if (e.Key == Keys.OemTilde)
                        e.Handled = true;

                    // Force escape to remove focus from the console..
                    if (e.Key == Keys.Escape)
                    {
                        consoleEdit.Focused = false;
                        e.Handled = true;
                    }
                };
            consoleEdit.KeyPress += (sender, e) =>
                {
                    if (e.Key == Keys.OemTilde)
                        e.Handled = true;
                };
            consoleEdit.KeyUp += (sender, e) =>
                {
                    if (e.Key == Keys.OemTilde)
                        e.Handled = true;
                };
            consoleEdit.TextChanged += (sender, e) =>
                {
                    consoleEdit.Suspended = true;
                    consoleEdit.Text = consoleEdit.Text.Replace("`", "");
//.........这里部分代码省略.........
开发者ID:999eagle,项目名称:Detox,代码行数:101,代码来源:DetoxConsole.cs


注:本文中的TomShane.Neoforce.Controls.Manager.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。