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


C# Panel.AddWidget方法代码示例

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


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

示例1: setupStartMenu

        /// <summary>
        /// sets up the game menu state
        /// </summary>
        void setupStartMenu()
        {
            // this panel will hold all the login GUI objects
            Widget loginpanel = new Panel(100, 100, 300, 140);

            // this adds a button labelled "Play" that will transition to the battle state when clicked
            loginpanel.AddWidget(new Button(50, 100, "Play", 2, (Widget widget) =>
            {
                // instead of going to a battle, go to an overworld instead
                //stateMachine.Transition(overworld.Name);
                stateMachine.Transition(battle.Name);

            }));

            // when entering start menu state
            startMenu.enter += () =>
            {
                // add the login widget to the gui
                gui.AddWidget(loginpanel);
            };

            // when updating start menu state
            startMenu.update += (GameTime gameTime) =>
            {
                #region input handling
                // if b is pressed, transition to the battle state
                if (currentKeyState.IsKeyDown(Keys.B))
                {
                    stateMachine.Transition(battle.Name);
                }
                #endregion

            };

            // when leaving the start menu state
            startMenu.leave += () =>
            {
                // remove the login widget from the gui
                gui.RemoveWidget(loginpanel);
            };
        }
开发者ID:rbroussard54,项目名称:SpaceIsFun,代码行数:44,代码来源:StartMenu.cs

示例2: SwitchToPlayerPadlockOptions

        public void SwitchToPlayerPadlockOptions()
        {
            if (pnlPlayerPadlockAction == null) {
                pnlPlayerPadlockAction = new Panel("pnlPlayerPadlockAction");
                pnlPlayerPadlockAction.Size = new Size(300, 180);
                pnlPlayerPadlockAction.Location = new Point(0, 30);
                pnlPlayerPadlockAction.BackColor = Color.Transparent;
                pnlPlayerPadlockAction.Hide();

                chkPlayerPadlockState = new CheckBox("chkPlayerPadlockState");
                chkPlayerPadlockState.Location = new Point(5, 5);
                chkPlayerPadlockState.Size = new System.Drawing.Size(100, 14);
                chkPlayerPadlockState.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                chkPlayerPadlockState.BackColor = Color.Transparent;
                chkPlayerPadlockState.Text = "Lock";

                pnlPlayerPadlockAction.AddWidget(chkPlayerPadlockState);

                pnlEditorSegments.AddWidget(pnlPlayerPadlockAction);
            }

            HideAllOptionPanels();
            pnlPlayerPadlockAction.Show();
        }
开发者ID:blastboy,项目名称:Client,代码行数:24,代码来源:winStoryPanel.cs

示例3: UpdateServerList

        private void UpdateServerList()
        {
            serverInfoPanels = new List<Panel>();

            Widget[] infosList = new Widget[serverInfos.Count];
            int height = Constants.BUTTON_HEIGHT + 10;

            for (int i = 0; i < infosList.Length; i++) {
                Panel p = new Panel(0, height * i, ServerList.Area.Width - 10, height);
                int s = (p.Area.Width - 10) / 4;
                string IP = serverInfos[i].IP;

                p.AddWidget(new Label(0, 5, serverInfos[i].Name));
                p.AddWidget(new Label(s, 5, IP));
                p.AddWidget(new Label(s * 2, 5, serverInfos[i].PlayersCount + "/" + serverInfos[i].MaxPlayersCount));
                p.AddWidget(new Button(s * 3, 0, s, "Connect", (sender) => { Constants.Client.Connect(IP); }));

                serverInfoPanels.Add(p);
                infosList[i] = p;
            }

            ServerList.Children = new Widget[] {
                new ScrollBars() {
                    Children = infosList
                }
            };
        }
开发者ID:FingerInSky,项目名称:SpaceCrush,代码行数:27,代码来源:ChooseServer.cs

示例4: InitMapEditorWidgets


//.........这里部分代码省略.........
            optAllow.Size = new Size(75, 17);
            optAllow.Location = new Point(0, 200);
            optAllow.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optAllow.Text = "Allow";
            optAllow.Visible = false;
            optAllow.CheckChanged += new EventHandler(optAllow_CheckChanged);

            optBlock = new RadioButton("optBlock");
            optBlock.Size = new Size(75, 17);
            optBlock.Location = new Point(100, 200);
            optBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optBlock.Text = "Block";
            optBlock.Visible = false;
            optBlock.CheckChanged += new EventHandler(optBlock_CheckChanged);

            btnOK = new Button("btnOK");
            btnOK.Location = new Point(this.mapViewer.X / 4, Screen.Height - shortcutBar.Height - 32);
            btnOK.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32);
            btnOK.Font = Graphics.FontManager.LoadFont("PMU", 18);
            btnOK.Text = "Ok";
            btnOK.Visible = false;
            btnOK.Click += new EventHandler<MouseButtonEventArgs>(btnOK_Click);
            Skins.SkinManager.LoadButtonGui(btnOK);

            /*btnBack = new Button("btnBack");
            btnBack.Location = new Point(0, Screen.Height - shortcutBar.Height - 32);
            btnBack.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32);
            btnBack.Font = Graphics.FontManager.LoadFont("PMU", 18);
            btnBack.Text = "Back";
            btnBack.Visible = false;
            btnBack.Click +=new EventHandler<MouseButtonEventArgs>(btnBack_Click);
            Skins.SkinManager.LoadButtonGui(btnBack);*/

            pnlAttOptions.AddWidget(lbl1);
            pnlAttOptions.AddWidget(lbl2);
            pnlAttOptions.AddWidget(lbl3);
            pnlAttOptions.AddWidget(lbl4);
            pnlAttOptions.AddWidget(lblMode);
            pnlAttOptions.AddWidget(txt1);
            pnlAttOptions.AddWidget(txt2);
            pnlAttOptions.AddWidget(txt3);
            pnlAttOptions.AddWidget(hsb1);
            pnlAttOptions.AddWidget(hsb2);
            pnlAttOptions.AddWidget(hsb3);
            pnlAttOptions.AddWidget(picSprite);
            pnlAttOptions.AddWidget(picSprite2);
            pnlAttOptions.AddWidget(lstSound);
            pnlAttOptions.AddWidget(chkTake);
            pnlAttOptions.AddWidget(chkHidden);
            pnlAttOptions.AddWidget(nudStoryLevel);
            pnlAttOptions.AddWidget(optAllow);
            pnlAttOptions.AddWidget(optBlock);
            pnlAttOptions.AddWidget(btnTitle);

            #endregion

            optBlocked = new RadioButton("optBlocked");
            optBlocked.BackColor = Color.Transparent;
            optBlocked.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optBlocked.Location = new Point(8, 6);
            optBlocked.Size = new System.Drawing.Size(95, 17);
            optBlocked.Text = "Blocked";
            optBlocked.Checked = true;

            optNpcAvoid = new RadioButton("optNpcAvoid");
            optNpcAvoid.BackColor = Color.Transparent;
开发者ID:ChaotixBluix,项目名称:PMU-Client,代码行数:67,代码来源:winGame.MapEditor.cs

示例5: winNPCPanel


//.........这里部分代码省略.........
            lblDropItemChance.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblDropItemChance.AutoSize = true;
            lblDropItemChance.Text = "Drop Chance:";
            lblDropItemChance.Location = new Point(10, lblDropItemAmount.Y + 20);

            nudDropItemChance = new NumericUpDown("nudDropItemChance");
            nudDropItemChance.Location = new Point(85, lblDropItemChance.Y);
            nudDropItemChance.Size = new System.Drawing.Size(190, 15);
            nudDropItemChance.Minimum = 1;
            nudDropItemChance.Maximum = 100;
            nudDropItemChance.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudDropItemChance_ValueChanged);

            lblDropItemTag = new Label("lblDropItemTag");
            lblDropItemTag.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblDropItemTag.AutoSize = true;
            lblDropItemTag.Text = "Item Tag:";
            lblDropItemTag.Location = new Point(10, lblDropItemChance.Y + 20);

            txtDropItemTag = new TextBox("nudDropItemTag");
            txtDropItemTag.Location = new Point(85, lblDropItemTag.Y);
            txtDropItemTag.Size = new System.Drawing.Size(190, 15);
            txtDropItemTag.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            txtDropItemTag.TextChanged += new EventHandler(txtDropItemTag_TextChanged);

            #endregion

            btnEditorCancel = new Button("btnEditorCancel");
            btnEditorCancel.Location = new Point(20, lblDropItemTag.Y + 20);
            btnEditorCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEditorCancel.Size = new System.Drawing.Size(64, 16);
            btnEditorCancel.Visible = true;
            btnEditorCancel.Text = "Cancel";
            btnEditorCancel.Click += new EventHandler<MouseButtonEventArgs>(btnEditorCancel_Click);

            btnEditorOK = new Button("btnEditorOK");
            btnEditorOK.Location = new Point(120, lblDropItemTag.Y + 20);
            btnEditorOK.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEditorOK.Size = new System.Drawing.Size(64, 16);
            btnEditorOK.Visible = true;
            btnEditorOK.Text = "OK";
            btnEditorOK.Click += new EventHandler<MouseButtonEventArgs>(btnEditorOK_Click);

            #region NPC Selector

            pnlNPCList.AddWidget(lbxNPCList);
            pnlNPCList.AddWidget(btnBack);
            pnlNPCList.AddWidget(btnForward);
            pnlNPCList.AddWidget(btnEdit);
            pnlNPCList.AddWidget(btnCancel);

            #endregion

            #region NPC Editor

            pnlNPCEditor.AddWidget(lblName);
            pnlNPCEditor.AddWidget(txtName);
            pnlNPCEditor.AddWidget(lblAttackSay);
            pnlNPCEditor.AddWidget(txtAttackSay);
            pnlNPCEditor.AddWidget(lblForm);
            pnlNPCEditor.AddWidget(nudForm);
            pnlNPCEditor.AddWidget(lblSpecies);
            pnlNPCEditor.AddWidget(nudSpecies);
            pnlNPCEditor.AddWidget(lblRange);
            pnlNPCEditor.AddWidget(nudShinyChance);
            pnlNPCEditor.AddWidget(chkSpawnsAtDawn);
            pnlNPCEditor.AddWidget(chkSpawnsAtDay);
            pnlNPCEditor.AddWidget(chkSpawnsAtDusk);
            pnlNPCEditor.AddWidget(chkSpawnsAtNight);
            pnlNPCEditor.AddWidget(lblBehaviour);
            pnlNPCEditor.AddWidget(cmbBehaviour);
            pnlNPCEditor.AddWidget(lblRecruitRate);
            pnlNPCEditor.AddWidget(nudRecruitRate);

            for (int i = 0; i < lblMove.Length; i++) {
                pnlNPCEditor.AddWidget(lblMove[i]);
                pnlNPCEditor.AddWidget(nudMove[i]);
                pnlNPCEditor.AddWidget(lblMoveInfo[i]);
            }

            pnlNPCEditor.AddWidget(lblDropSelector);
            pnlNPCEditor.AddWidget(nudDropSelector);
            pnlNPCEditor.AddWidget(lblDropItemNum);
            pnlNPCEditor.AddWidget(nudDropItemNum);
            pnlNPCEditor.AddWidget(lblDropItemAmount);
            pnlNPCEditor.AddWidget(nudDropItemAmount);
            pnlNPCEditor.AddWidget(lblDropItemChance);
            pnlNPCEditor.AddWidget(nudDropItemChance);
            pnlNPCEditor.AddWidget(lblDropItemTag);
            pnlNPCEditor.AddWidget(txtDropItemTag);
            pnlNPCEditor.AddWidget(btnEditorCancel);
            pnlNPCEditor.AddWidget(btnEditorOK);

            #endregion

            this.AddWidget(pnlNPCList);
            this.AddWidget(pnlNPCEditor);

            RefreshNPCList();
            this.LoadComplete();
        }
开发者ID:blastboy,项目名称:Client,代码行数:101,代码来源:winNPCPanel.cs

示例6: winAdminPanel


//.........这里部分代码省略.........
            btnStories.Size = new System.Drawing.Size(134, 32);
            btnStories.Visible = true;
            btnStories.Text = "Story Editor";
            btnStories.Click += new EventHandler<MouseButtonEventArgs>(btnStories_Click);

            btnNPC = new Button("btnNPC");
            btnNPC.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnNPC.Location = new Point(200, 122);
            btnNPC.Size = new System.Drawing.Size(134, 32);
            btnNPC.Visible = true;
            btnNPC.Text = "NPC Editor";
            btnNPC.Click += new EventHandler<MouseButtonEventArgs>(btnNPC_Click);

            //btnArrows = new Button("btnArrows");
            //btnArrows.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            //btnArrows.Location = new Point(20, 156);
            //btnArrows.Size = new System.Drawing.Size(134, 32);
            //btnArrows.Visible = true;
            //btnArrows.Text = "Edit Arrows";
            //btnArrows.Click += new EventHandler<MouseButtonEventArgs>(btnArrows_Click);

            btnEmotion = new Button("btnEmotion");
            btnEmotion.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEmotion.Location = new Point(200, 156);
            btnEmotion.Size = new System.Drawing.Size(134, 32);
            btnEmotion.Visible = true;
            btnEmotion.Text = "Edit Emotions";
            btnEmotion.Click += new EventHandler<MouseButtonEventArgs>(btnEmotion_Click);

            btnRDungeons = new Button("btnRDungeons");
            btnRDungeons.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnRDungeons.Location = new Point(20, 156);
            btnRDungeons.Size = new System.Drawing.Size(134, 32);
            btnRDungeons.Visible = true;
            btnRDungeons.Text = "Edit Random Dungeons";
            btnRDungeons.Click += new EventHandler<MouseButtonEventArgs>(btnRDungeons_Click);

            btnMissions = new Button("btnMissions");
            btnMissions.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnMissions.Location = new Point(20, 190);
            btnMissions.Size = new System.Drawing.Size(134, 32);
            btnMissions.Visible = true;
            btnMissions.Text = "Edit Missions";
            btnMissions.Click += new EventHandler<MouseButtonEventArgs>(btnMissions_Click);

            btnDungeons = new Button("btnDungeons");
            btnDungeons.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnDungeons.Location = new Point(200, 190);
            btnDungeons.Size = new System.Drawing.Size(134, 32);
            btnDungeons.Visible = true;
            btnDungeons.Text = "Edit Dungeons";
            btnDungeons.Click += new EventHandler<MouseButtonEventArgs>(btnDungeons_Click);

            #region Addwidget

            pnlWeather.AddWidget(cbWeather);
            pnlWeather.AddWidget(btnApplyWeather);
            pnlPlayerInfo.AddWidget(btnBanish);
            pnlPlayerInfo.AddWidget(btnWarpTo);
            pnlPlayerInfo.AddWidget(btnKick);
            pnlPlayerInfo.AddWidget(btnSetAccess);
            pnlPlayerInfo.AddWidget(btnRespawn);
            pnlPlayerInfo.AddWidget(btnSetSprite);
            pnlPlayerInfo.AddWidget(btnWarpMeTo);
            pnlPlayerInfo.AddWidget(btnSetPlayerSprite);
            pnlPlayerInfo.AddWidget(btnWarpToMe);
            pnlPlayerInfo.AddWidget(lblPlayerName);
            pnlPlayerInfo.AddWidget(txtPlayerName);
            pnlPlayerInfo.AddWidget(lblSpriteNumber);
            pnlPlayerInfo.AddWidget(txtSpriteNumber);
            pnlPlayerInfo.AddWidget(lblAccessLevel);
            pnlPlayerInfo.AddWidget(cbAccessLevel);
            pnlPlayerInfo.AddWidget(lblMapNumber);
            pnlPlayerInfo.AddWidget(txtMapNumber);
            pnlCommands.AddWidget(btnMapEditor);
            pnlCommands.AddWidget(btnMapReport);
            pnlCommands.AddWidget(btnSpells);
            pnlCommands.AddWidget(btnItems);
            pnlCommands.AddWidget(btnShops);
            pnlCommands.AddWidget(btnEvolutions);
            pnlCommands.AddWidget(btnStories);
            pnlCommands.AddWidget(btnNPC);
            //pnlCommands.AddWidget(btnArrows);
            pnlCommands.AddWidget(btnEmotion);
            pnlCommands.AddWidget(btnRDungeons);
            pnlCommands.AddWidget(btnMissions);
            pnlCommands.AddWidget(btnDungeons);

            this.AddWidget(pnlWeather);
            this.AddWidget(btnWeather);
            this.AddWidget(pnlPlayerInfo);
            this.AddWidget(btnPlayerInfo);
            this.AddWidget(pnlCommands);
            this.AddWidget(btnCommands);

            this.LoadComplete();
            #endregion Addwidget

            #endregion Widgets
        }
开发者ID:ChaotixBluix,项目名称:PMU-Client,代码行数:101,代码来源:winAdminPanel.cs

示例7: setupStartMenu

        void setupStartMenu()
        {
            Widget loginpanel = new Panel(100, 100, 300, 140);

            loginpanel.AddWidget(new Button(50, 100, "Play", 2, (Widget widget) =>
            {
                stateMachine.Transition(battle.Name);
            }));

            startMenu.enter += () =>
            {
                gui.AddWidget(loginpanel);
            };

            startMenu.update += (GameTime gameTime) =>
            {

                if (currentKeyState.IsKeyDown(Keys.B))
                {
                    stateMachine.Transition(battle.Name);
                }

            };

            startMenu.leave += () =>
            {
                gui.RemoveWidget(loginpanel);
            };
        }
开发者ID:velhelm,项目名称:SpaceIsFun,代码行数:29,代码来源:Game1.cs

示例8: winProperties


//.........这里部分代码省略.........
            btnLoadNpc.Text = "Load Npc";
            btnLoadNpc.Click += new EventHandler<MouseButtonEventArgs>(btnLoadNpc_Click);

            #endregion

            chkScroll = new CheckBox("chkScroll");
            chkScroll.Text = "Use scroll maps?";
            chkScroll.Size = new System.Drawing.Size(200, 16);
            chkScroll.Location = new Point(54, 60);
            chkScroll.BackColor = Color.Transparent;

            lblMaxX = new Label("lblMaxX");
            lblMaxX.Font = Logic.Graphics.FontManager.LoadFont("PMU", 18);
            lblMaxX.AutoSize = true;
            lblMaxX.Location = new Point(54, 0);
            lblMaxX.Text = "Max X:";

            lblMaxY = new Label("lblMaxY");
            lblMaxY.Font = Logic.Graphics.FontManager.LoadFont("PMU", 18);
            lblMaxY.AutoSize = true;
            lblMaxY.Location = new Point(280, 0);
            lblMaxY.Text = "Max Y:";

            txtMaxX = new TextBox("txtMaxX");
            txtMaxX.Size = new System.Drawing.Size(134, 18);
            txtMaxX.Location = new Point(59, 25);
            txtMaxX.Text = properties.MaxX.ToString();

            txtMaxY = new TextBox("txtMaxY");
            txtMaxY.Size = new System.Drawing.Size(134, 18);
            txtMaxY.Location = new Point(285, 25);
            txtMaxY.Text = properties.MaxY.ToString();

            this.AddWidget(pnlGeneral);
            this.AddWidget(btnGeneral);
            this.AddWidget(pnlNPC);
            this.AddWidget(btnNPC);
            this.AddWidget(pnlScroll);
            this.AddWidget(btnScroll);

            #region General
            pnlGeneral.AddWidget(txtMapName);
            pnlGeneral.AddWidget(lblMapName);
            pnlGeneral.AddWidget(lblMapSwitchover);
            pnlGeneral.AddWidget(lblNorth);
            pnlGeneral.AddWidget(lblSouth);
            pnlGeneral.AddWidget(lblEast);
            pnlGeneral.AddWidget(lblWest);
            pnlGeneral.AddWidget(txtNorth);
            pnlGeneral.AddWidget(txtSouth);
            pnlGeneral.AddWidget(txtEast);
            pnlGeneral.AddWidget(txtWest);
            pnlGeneral.AddWidget(chkHunger);
            pnlGeneral.AddWidget(chkRecruit);
            pnlGeneral.AddWidget(chkExp);
            pnlGeneral.AddWidget(chkIndoors);
            pnlGeneral.AddWidget(chkInstanced);
            pnlGeneral.AddWidget(lblGlobal);
            pnlGeneral.AddWidget(lblMapMorality);
            pnlGeneral.AddWidget(lblMapWeather);
            pnlGeneral.AddWidget(lblMapDarkness);
            pnlGeneral.AddWidget(lblMapTimeLimit);
            pnlGeneral.AddWidget(cmbMapMorality);
            pnlGeneral.AddWidget(cmbMapWeather);
            pnlGeneral.AddWidget(nudDarkness);
            pnlGeneral.AddWidget(nudTimeLimit);
开发者ID:ChaotixBluix,项目名称:PMU-Client,代码行数:67,代码来源:winProperties.cs

示例9: winStoryPanel


//.........这里部分代码省略.........
            //nudActiveSegment.Minimum = 1;
            //nudActiveSegment.Maximum = 1;

            btnAddSegment = new Button("btnAddSegment");
            btnAddSegment.Size = new System.Drawing.Size(64, 16);
            btnAddSegment.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            btnAddSegment.Location = new Point(5, 210);
            btnAddSegment.Text = "Add";
            btnAddSegment.Click += new EventHandler<MouseButtonEventArgs>(btnAddSegment_Click);

            btnRemoveSegment = new Button("btnRemoveSegment");
            btnRemoveSegment.Size = new System.Drawing.Size(64, 16);
            btnRemoveSegment.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            btnRemoveSegment.Location = new Point(btnAddSegment.X + btnAddSegment.Width + 5, 210);
            btnRemoveSegment.Text = "Remove";
            btnRemoveSegment.Click += new EventHandler<MouseButtonEventArgs>(btnRemoveSegment_Click);

            btnLoadSegment = new Button("btnLoadSegment");
            btnLoadSegment.Size = new System.Drawing.Size(64, 16);
            btnLoadSegment.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            btnLoadSegment.Location = new Point(btnRemoveSegment.X + btnRemoveSegment.Width + 5, 210);
            btnLoadSegment.Text = "Load";
            btnLoadSegment.Click += new EventHandler<MouseButtonEventArgs>(btnLoadSegment_Click);

            btnSaveSegment = new Button("btnSaveSegment");
            btnSaveSegment.Size = new System.Drawing.Size(64, 16);
            btnSaveSegment.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            btnSaveSegment.Location = new Point(btnLoadSegment.X + btnLoadSegment.Width + 5, btnLoadSegment.Y);
            btnSaveSegment.Text = "Save";
            btnSaveSegment.Click += new EventHandler<MouseButtonEventArgs>(btnSaveSegment_Click);

            lblActions = new Label("lblActions");
            lblActions.Location = new Point(75, 5);
            lblActions.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
            lblActions.AutoSize = true;
            lblActions.Text = "Action:";

            cmbSegmentTypes = new ComboBox("cmbSegmentTypes");
            cmbSegmentTypes.Location = new Point(lblActions.X + lblActions.Width + 5, 5);
            cmbSegmentTypes.Size = new System.Drawing.Size(150, 16);
            string[] storySegmentActions = Enum.GetNames(typeof(Enums.StoryAction));
            for (int i = 0; i < storySegmentActions.Length; i++) {
                cmbSegmentTypes.Items.Add(new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), storySegmentActions[i]));
            }
            cmbSegmentTypes.ItemSelected += new EventHandler(cmbSegmentTypes_ItemSelected);
            cmbSegmentTypes.SelectItem(0);

            lbxSegments = new ListBox("lbxSegments");
            lbxSegments.Location = new Point(10, 230);
            lbxSegments.Size = new System.Drawing.Size(280, 140);
            lbxSegments.MultiSelect = false;

            #endregion

            #region List
            pnlStoryList.AddWidget(lbxStoryList);
            pnlStoryList.AddWidget(btnBack);
            pnlStoryList.AddWidget(btnForward);
            pnlStoryList.AddWidget(btnEdit);
            pnlStoryList.AddWidget(btnCancel);
            #endregion

            #region General
            pnlEditorGeneral.AddWidget(btnSegments);
            pnlEditorGeneral.AddWidget(lblName);
            pnlEditorGeneral.AddWidget(txtName);
            pnlEditorGeneral.AddWidget(lblStoryStart);
            pnlEditorGeneral.AddWidget(nudStoryStart);
            pnlEditorGeneral.AddWidget(lblExitAndContinue);
            pnlEditorGeneral.AddWidget(lbxExitAndContinue);
            pnlEditorGeneral.AddWidget(btnAddExitAndContinue);
            pnlEditorGeneral.AddWidget(nudExitAndContinueCheckpoint);
            pnlEditorGeneral.AddWidget(btnRemoveExitAndContinue);

            pnlEditorGeneral.AddWidget(btnEditorCancel);
            pnlEditorGeneral.AddWidget(btnEditorOK);
            #endregion

            #region Segments
            pnlEditorSegments.AddWidget(btnGeneral);
            //pnlEditorSegments.AddWidget(lblMaxSegments);
            //pnlEditorSegments.AddWidget(nudMaxSegments);
            //pnlEditorSegments.AddWidget(btnSaveMaxSegments);
            //pnlEditorSegments.AddWidget(lblActiveSegment);
            //pnlEditorSegments.AddWidget(nudActiveSegment);
            pnlEditorSegments.AddWidget(btnAddSegment);
            pnlEditorSegments.AddWidget(btnRemoveSegment);
            pnlEditorSegments.AddWidget(btnLoadSegment);
            pnlEditorSegments.AddWidget(btnSaveSegment);
            pnlEditorSegments.AddWidget(lblActions);
            pnlEditorSegments.AddWidget(cmbSegmentTypes);
            pnlEditorSegments.AddWidget(lbxSegments);
            #endregion

            this.AddWidget(pnlStoryList);
            this.AddWidget(pnlEditorGeneral);
            this.AddWidget(pnlEditorSegments);

            RefreshStoryList();
        }
开发者ID:blastboy,项目名称:Client,代码行数:101,代码来源:winStoryPanel.cs

示例10: SwitchToStoryScriptOptions

        public void SwitchToStoryScriptOptions()
        {
            if (pnlStoryScriptAction == null) {
                pnlStoryScriptAction = new Panel("pnlStoryScriptAction");
                pnlStoryScriptAction.Size = new Size(300, 180);
                pnlStoryScriptAction.Location = new Point(0, 30);
                pnlStoryScriptAction.BackColor = Color.Transparent;
                pnlStoryScriptAction.Hide();

                lblStoryScriptIndex = new Label("lblStoryScriptIndex");
                lblStoryScriptIndex.Location = new Point(5, 5);
                lblStoryScriptIndex.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblStoryScriptIndex.AutoSize = true;
                lblStoryScriptIndex.Text = "Script:";

                nudStoryScriptIndex = new NumericUpDown("nudStoryScriptIndex");
                nudStoryScriptIndex.Location = new Point(75, 5);
                nudStoryScriptIndex.Size = new System.Drawing.Size(100, 14);
                nudStoryScriptIndex.Maximum = Int32.MaxValue;

                lblStoryScriptParam1 = new Label("lblStoryScriptParam1");
                lblStoryScriptParam1.Location = new Point(5, 25);
                lblStoryScriptParam1.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblStoryScriptParam1.AutoSize = true;
                lblStoryScriptParam1.Text = "Script Parameter 1:";

                txtStoryScriptParam1 = new TextBox("txtStoryScriptParam1");
                txtStoryScriptParam1.Location = new Point(5, 40);
                txtStoryScriptParam1.Size = new System.Drawing.Size(270, 16);

                lblStoryScriptParam2 = new Label("lblStoryScriptParam2");
                lblStoryScriptParam2.Location = new Point(5, 60);
                lblStoryScriptParam2.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblStoryScriptParam2.AutoSize = true;
                lblStoryScriptParam2.Text = "Script Parameter 2:";

                txtStoryScriptParam2 = new TextBox("txtStoryScriptParam2");
                txtStoryScriptParam2.Location = new Point(5, 75);
                txtStoryScriptParam2.Size = new System.Drawing.Size(270, 16);

                lblStoryScriptParam3 = new Label("lblStoryScriptParam3");
                lblStoryScriptParam3.Location = new Point(5, 95);
                lblStoryScriptParam3.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblStoryScriptParam3.AutoSize = true;
                lblStoryScriptParam3.Text = "Script Parameter 3:";

                txtStoryScriptParam3 = new TextBox("txtStoryScriptParam3");
                txtStoryScriptParam3.Location = new Point(5, 110);
                txtStoryScriptParam3.Size = new System.Drawing.Size(270, 16);

                chkStoryScriptPause = new CheckBox("chkStoryScriptPause");
                chkStoryScriptPause.Location = new Point(5, 135);
                chkStoryScriptPause.Size = new System.Drawing.Size(200, 105);
                chkStoryScriptPause.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                chkStoryScriptPause.Text = "Pause until complete";

                pnlStoryScriptAction.AddWidget(lblStoryScriptIndex);
                pnlStoryScriptAction.AddWidget(nudStoryScriptIndex);
                pnlStoryScriptAction.AddWidget(lblStoryScriptParam1);
                pnlStoryScriptAction.AddWidget(txtStoryScriptParam1);
                pnlStoryScriptAction.AddWidget(lblStoryScriptParam2);
                pnlStoryScriptAction.AddWidget(txtStoryScriptParam2);
                pnlStoryScriptAction.AddWidget(lblStoryScriptParam3);
                pnlStoryScriptAction.AddWidget(txtStoryScriptParam3);
                pnlStoryScriptAction.AddWidget(chkStoryScriptPause);

                pnlEditorSegments.AddWidget(pnlStoryScriptAction);
            }

            HideAllOptionPanels();
            pnlStoryScriptAction.Show();
        }
开发者ID:blastboy,项目名称:Client,代码行数:72,代码来源:winStoryPanel.cs

示例11: SwitchToShowImageOptions

        public void SwitchToShowImageOptions()
        {
            if (pnlShowImageAction == null) {
                pnlShowImageAction = new Panel("pnlShowImageAction");
                pnlShowImageAction.Size = new Size(300, 180);
                pnlShowImageAction.Location = new Point(0, 30);
                pnlShowImageAction.BackColor = Color.Transparent;
                pnlShowImageAction.Hide();

                lbxShowImageFiles = new ListBox("lbxShowImageFiles");
                lbxShowImageFiles.Location = new Point(5, 5);
                lbxShowImageFiles.Size = new System.Drawing.Size(200, 100);
                SdlDotNet.Graphics.Font font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                string[] imageFiles = System.IO.Directory.GetFiles(IO.Paths.StartupPath + "Story/Images/");
                for (int i = 0; i < imageFiles.Length; i++) {
                    lbxShowImageFiles.Items.Add(new ListBoxTextItem(font, System.IO.Path.GetFileName(imageFiles[i])));
                }

                lblShowImageID = new Label("lblShowImageID");
                lblShowImageID.Location = new Point(5, 105);
                lblShowImageID.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblShowImageID.AutoSize = true;
                lblShowImageID.Text = "Image ID:";

                txtShowImageID = new TextBox("txtShowImageID");
                txtShowImageID.Location = new Point(75, 105);
                txtShowImageID.Size = new System.Drawing.Size(125, 15);

                lblShowImageX = new Label("lblShowImageX");
                lblShowImageX.Location = new Point(5, 125);
                lblShowImageX.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblShowImageX.AutoSize = true;
                lblShowImageX.Text = "Image X:";

                nudShowImageX = new NumericUpDown("nudShowImageX");
                nudShowImageX.Location = new Point(75, 125);
                nudShowImageX.Size = new System.Drawing.Size(125, 15);
                nudShowImageX.Maximum = 640;

                lblShowImageY = new Label("lblShowImageY");
                lblShowImageY.Location = new Point(5, 145);
                lblShowImageY.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblShowImageY.AutoSize = true;
                lblShowImageY.Text = "Image Y:";

                nudShowImageY = new NumericUpDown("nudShowImageY");
                nudShowImageY.Location = new Point(75, 145);
                nudShowImageY.Size = new System.Drawing.Size(125, 15);
                nudShowImageY.Maximum = 480;

                pnlShowImageAction.AddWidget(lbxShowImageFiles);
                pnlShowImageAction.AddWidget(lblShowImageID);
                pnlShowImageAction.AddWidget(txtShowImageID);
                pnlShowImageAction.AddWidget(lblShowImageX);
                pnlShowImageAction.AddWidget(nudShowImageX);
                pnlShowImageAction.AddWidget(lblShowImageY);
                pnlShowImageAction.AddWidget(nudShowImageY);

                pnlEditorSegments.AddWidget(pnlShowImageAction);
            }

            HideAllOptionPanels();
            pnlShowImageAction.Show();
        }
开发者ID:blastboy,项目名称:Client,代码行数:64,代码来源:winStoryPanel.cs

示例12: SwitchToShowBackgroundOptions

        public void SwitchToShowBackgroundOptions()
        {
            if (pnlShowBackgroundAction == null) {
                pnlShowBackgroundAction = new Panel("pnlShowBackgroundAction");
                pnlShowBackgroundAction.Size = new Size(300, 180);
                pnlShowBackgroundAction.Location = new Point(0, 30);
                pnlShowBackgroundAction.BackColor = Color.Transparent;
                pnlShowBackgroundAction.Hide();

                lbxShowBackgroundFiles = new ListBox("lbxShowBackgroundFiles");
                lbxShowBackgroundFiles.Location = new Point(5, 5);
                lbxShowBackgroundFiles.Size = new System.Drawing.Size(200, 100);
                SdlDotNet.Graphics.Font font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                string[] imageFiles = System.IO.Directory.GetFiles(IO.Paths.StartupPath + "Story/Backgrounds/");
                for (int i = 0; i < imageFiles.Length; i++) {
                    lbxShowBackgroundFiles.Items.Add(new ListBoxTextItem(font, System.IO.Path.GetFileName(imageFiles[i])));
                }

                pnlShowBackgroundAction.AddWidget(lbxShowImageFiles);

                pnlEditorSegments.AddWidget(pnlShowBackgroundAction);
            }

            HideAllOptionPanels();
            pnlShowBackgroundAction.Show();
        }
开发者ID:blastboy,项目名称:Client,代码行数:26,代码来源:winStoryPanel.cs

示例13: SwitchToScrollCameraOptions

        public void SwitchToScrollCameraOptions()
        {
            if (pnlScrollCameraAction == null) {
                pnlScrollCameraAction = new Panel("pnlScrollCameraAction");
                pnlScrollCameraAction.Size = new Size(300, 180);
                pnlScrollCameraAction.Location = new Point(0, 30);
                pnlScrollCameraAction.BackColor = Color.Transparent;
                pnlScrollCameraAction.Hide();

                lblScrollCameraX = new Label("lblScrollCameraX");
                lblScrollCameraX.Location = new Point(5, 5);
                lblScrollCameraX.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblScrollCameraX.AutoSize = true;
                lblScrollCameraX.Text = "X:";

                nudScrollCameraX = new NumericUpDown("nudScrollCameraX");
                nudScrollCameraX.Location = new Point(75, 5);
                nudScrollCameraX.Size = new System.Drawing.Size(100, 14);
                nudScrollCameraX.Maximum = 50;

                lblScrollCameraY = new Label("lblScrollCameraY");
                lblScrollCameraY.Location = new Point(5, 25);
                lblScrollCameraY.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblScrollCameraY.AutoSize = true;
                lblScrollCameraY.Text = "Y:";

                nudScrollCameraY = new NumericUpDown("nudScrollCameraY");
                nudScrollCameraY.Location = new Point(75, 25);
                nudScrollCameraY.Size = new System.Drawing.Size(100, 14);
                nudScrollCameraY.Maximum = 50;

                lblScrollCameraSpeed = new Label("lblScrollCameraSpeed");
                lblScrollCameraSpeed.Location = new Point(5, 45);
                lblScrollCameraSpeed.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblScrollCameraSpeed.AutoSize = true;
                lblScrollCameraSpeed.Text = "Speed:";

                nudScrollCameraSpeed = new NumericUpDown("nudScrollCameraSpeed");
                nudScrollCameraSpeed.Location = new Point(75, 45);
                nudScrollCameraSpeed.Size = new System.Drawing.Size(100, 14);
                nudScrollCameraSpeed.Maximum = Int32.MaxValue;

                chkScrollCameraPause = new CheckBox("chkScrollCameraPause");
                chkScrollCameraPause.Location = new Point(5, 65);
                chkScrollCameraPause.Size = new System.Drawing.Size(100, 14);
                chkScrollCameraPause.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                chkScrollCameraPause.BackColor = Color.Transparent;
                chkScrollCameraPause.Text = "Pause until complete";

                pnlScrollCameraAction.AddWidget(lblScrollCameraX);
                pnlScrollCameraAction.AddWidget(nudScrollCameraX);
                pnlScrollCameraAction.AddWidget(lblScrollCameraY);
                pnlScrollCameraAction.AddWidget(nudScrollCameraY);
                pnlScrollCameraAction.AddWidget(lblScrollCameraSpeed);
                pnlScrollCameraAction.AddWidget(nudScrollCameraSpeed);
                pnlScrollCameraAction.AddWidget(chkScrollCameraPause);

                pnlEditorSegments.AddWidget(pnlScrollCameraAction);
            }

            HideAllOptionPanels();
            pnlScrollCameraAction.Show();
        }
开发者ID:blastboy,项目名称:Client,代码行数:63,代码来源:winStoryPanel.cs

示例14: SwitchToSayOptions

        public void SwitchToSayOptions()
        {
            if (pnlSayAction == null) {
                pnlSayAction = new Panel("pnlSayAction");
                pnlSayAction.Size = new Size(300, 180);
                pnlSayAction.Location = new Point(0, 30);
                pnlSayAction.BackColor = Color.Transparent;
                pnlSayAction.Hide();

                lblSayText = new Label("lblSayText");
                lblSayText.Location = new Point(5, 5);
                lblSayText.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblSayText.AutoSize = true;
                lblSayText.Text = "Text:";

                txtSayText = new TextBox("txtSayText");
                txtSayText.Location = new Point(75, 5);
                txtSayText.Size = new System.Drawing.Size(200, 16);

                lblSayMugshot = new Label("lblSayMugshot");
                lblSayMugshot.Location = new Point(5, 25);
                lblSayMugshot.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblSayMugshot.AutoSize = true;
                lblSayMugshot.Text = "Mugshot:";

                nudSayMugshot = new NumericUpDown("nudSayMugshot");
                nudSayMugshot.Location = new Point(75, 25);
                nudSayMugshot.Size = new System.Drawing.Size(100, 14);
                nudSayMugshot.Maximum = Int32.MaxValue;
                nudSayMugshot.Minimum = -1;
                nudSayMugshot.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudSayMugshot_ValueChanged);

                pbxSayMugshot = new PictureBox("pbxSayMugshot");
                pbxSayMugshot.Location = new Point(nudSayMugshot.X + nudSayMugshot.Width + 5, 25);
                pbxSayMugshot.Size = new System.Drawing.Size(40, 40);

                lblSaySpeed = new Label("lblSaySpeed");
                lblSaySpeed.Location = new Point(5, 45);
                lblSaySpeed.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblSaySpeed.AutoSize = true;
                lblSaySpeed.Text = "Speed:";

                nudSaySpeed = new NumericUpDown("nudSaySpeed");
                nudSaySpeed.Location = new Point(75, 45);
                nudSaySpeed.Size = new System.Drawing.Size(100, 14);
                nudSaySpeed.Maximum = Int32.MaxValue;

                lblSayPause = new Label("lblSayPause");
                lblSayPause.Location = new Point(5, 65);
                lblSayPause.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                lblSayPause.AutoSize = true;
                lblSayPause.Text = "Pause:";

                nudSayPause = new NumericUpDown("nudSayPause");
                nudSayPause.Location = new Point(75, 65);
                nudSayPause.Size = new System.Drawing.Size(100, 14);
                nudSayPause.Maximum = Int32.MaxValue;

                pnlSayAction.AddWidget(lblSayText);
                pnlSayAction.AddWidget(txtSayText);
                pnlSayAction.AddWidget(lblSayMugshot);
                pnlSayAction.AddWidget(nudSayMugshot);
                pnlSayAction.AddWidget(pbxSayMugshot);
                pnlSayAction.AddWidget(lblSaySpeed);
                pnlSayAction.AddWidget(nudSaySpeed);
                pnlSayAction.AddWidget(lblSayPause);
                pnlSayAction.AddWidget(nudSayPause);

                pnlEditorSegments.AddWidget(pnlSayAction);
            }

            txtSayText.Text = "";
            HideAllOptionPanels();
            pnlSayAction.Show();
        }
开发者ID:blastboy,项目名称:Client,代码行数:75,代码来源:winStoryPanel.cs

示例15: SwitchToPlayMusicOptions

        public void SwitchToPlayMusicOptions()
        {
            if (pnlPlayMusicAction == null) {
                pnlPlayMusicAction = new Panel("pnlPlayMusicAction");
                pnlPlayMusicAction.Size = new Size(300, 180);
                pnlPlayMusicAction.Location = new Point(0, 30);
                pnlPlayMusicAction.BackColor = Color.Transparent;
                pnlPlayMusicAction.Hide();

                lbxPlayMusicPicker = new ListBox("lbxPlayMusicPicker");
                lbxPlayMusicPicker.Location = new Point(5, 5);
                lbxPlayMusicPicker.Size = new System.Drawing.Size(200, 100);
                SdlDotNet.Graphics.Font font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                string[] musicFiles = System.IO.Directory.GetFiles(IO.Paths.MusicPath);
                for (int i = 0; i < musicFiles.Length; i++) {
                    lbxPlayMusicPicker.Items.Add(new ListBoxTextItem(font, System.IO.Path.GetFileName(musicFiles[i])));
                }

                btnPlayMusicPlay = new Button("btnPlayMusicPlay");
                btnPlayMusicPlay.Location = new Point(210, 5);
                btnPlayMusicPlay.Size = new System.Drawing.Size(64, 15);
                btnPlayMusicPlay.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                btnPlayMusicPlay.Text = "Play";
                btnPlayMusicPlay.Click += new EventHandler<MouseButtonEventArgs>(btnPlayMusicPlay_Click);

                btnPlayMusicStop = new Button("btnPlayMusicStop");
                btnPlayMusicStop.Location = new Point(210, 25);
                btnPlayMusicStop.Size = new System.Drawing.Size(64, 15);
                btnPlayMusicStop.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                btnPlayMusicStop.Text = "Stop";
                btnPlayMusicStop.Click += new EventHandler<MouseButtonEventArgs>(btnPlayMusicStop_Click);

                chkPlayMusicHonorSettings = new CheckBox("chkPlayMusicHonorSettings");
                chkPlayMusicHonorSettings.Location = new Point(5, 105);
                chkPlayMusicHonorSettings.Size = new System.Drawing.Size(100, 14);
                chkPlayMusicHonorSettings.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                chkPlayMusicHonorSettings.BackColor = Color.Transparent;
                chkPlayMusicHonorSettings.Text = "Honor Settings";

                chkPlayMusicLoop = new CheckBox("chkPlayMusicLoop");
                chkPlayMusicLoop.Location = new Point(5, 125);
                chkPlayMusicLoop.Size = new System.Drawing.Size(100, 14);
                chkPlayMusicLoop.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10);
                chkPlayMusicLoop.BackColor = Color.Transparent;
                chkPlayMusicLoop.Text = "Loop";

                pnlPlayMusicAction.AddWidget(lbxPlayMusicPicker);
                pnlPlayMusicAction.AddWidget(btnPlayMusicPlay);
                pnlPlayMusicAction.AddWidget(btnPlayMusicStop);
                pnlPlayMusicAction.AddWidget(chkPlayMusicHonorSettings);
                pnlPlayMusicAction.AddWidget(chkPlayMusicLoop);

                pnlEditorSegments.AddWidget(pnlPlayMusicAction);
            }

            HideAllOptionPanels();
            pnlPlayMusicAction.Show();
        }
开发者ID:blastboy,项目名称:Client,代码行数:58,代码来源:winStoryPanel.cs


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