private void CivilizationChanged(object sender, System.EventArgs e) { DXComboBox cbo = (DXComboBox)sender; Civilization civ = (Civilization)cbo.SelectedItem; this.txtLeaderName.Text = civ.LeaderName; }
public StorageDialog() { TitleLabel.Text = "Storage"; SetClientSize(new Size(473, 380)); DXControl filterPanel = new DXControl { Parent = this, Size = new Size(ClientArea.Width, 26), Location = new Point(ClientArea.Location.X, ClientArea.Location.Y), Border = true, BorderColour = Color.FromArgb(198, 166, 99) }; DXLabel label = new DXLabel { Parent = filterPanel, Location = new Point(5, 5), Text = "Name:", }; ItemNameTextBox = new DXTextBox { Parent = filterPanel, Size = new Size(180, 20), Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y), }; ItemNameTextBox.TextBox.TextChanged += (o, e) => ApplyStorageFilter(); label = new DXLabel { Parent = filterPanel, Location = new Point(ItemNameTextBox.Location.X + ItemNameTextBox.Size.Width + 10, 5), Text = "Item:", }; ItemTypeComboBox = new DXComboBox { Parent = filterPanel, Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y), Size = new Size(95, DXComboBox.DefaultNormalHeight), DropDownHeight = 198 }; ItemTypeComboBox.SelectedItemChanged += (o, e) => ApplyStorageFilter(); new DXListBoxItem { Parent = ItemTypeComboBox.ListBox, Label = { Text = $"All" }, Item = null }; Type itemType = typeof(ItemType); for (ItemType i = ItemType.Nothing; i <= ItemType.ItemPart; i++) { MemberInfo[] infos = itemType.GetMember(i.ToString()); DescriptionAttribute description = infos[0].GetCustomAttribute <DescriptionAttribute>(); new DXListBoxItem { Parent = ItemTypeComboBox.ListBox, Label = { Text = description?.Description ?? i.ToString() }, Item = i }; } ItemTypeComboBox.ListBox.SelectItem(null); ClearButton = new DXButton { Size = new Size(80, SmallButtonHeight), Location = new Point(ItemTypeComboBox.Location.X + ItemTypeComboBox.Size.Width + 17, label.Location.Y - 1), Parent = filterPanel, ButtonType = ButtonType.SmallButton, Label = { Text = "Clear" } }; ClearButton.MouseClick += (o, e) => { ItemTypeComboBox.ListBox.SelectItem(null); ItemNameTextBox.TextBox.Text = string.Empty; }; Grid = new DXItemGrid { Parent = this, GridSize = new Size(1, 1), Location = new Point(ClientArea.Location.X, ClientArea.Location.Y + 30), GridType = GridType.Storage, ItemGrid = CEnvir.Storage, VisibleHeight = 10, }; Grid.GridSizeChanged += StorageGrid_GridSizeChanged; StorageScrollBar = new DXVScrollBar { Parent = this, Location = new Point(ClientArea.Right - 14, ClientArea.Location.Y + 31), Size = new Size(14, 349), VisibleSize = 10, Change = 1, }; StorageScrollBar.ValueChanged += StorageScrollBar_ValueChanged; foreach (DXItemCell cell in Grid.Grid) { cell.MouseWheel += StorageScrollBar.DoMouseWheel; } }
public FortuneCheckerDialog() { //HasFooter = true; TitleLabel.Text = "财富检查器"; SetClientSize(new Size(485, 551)); #region Search DXControl filterPanel = new DXControl { Parent = this, Size = new Size(ClientArea.Width, 26), Location = new Point(ClientArea.Left, ClientArea.Top), Border = true, BorderColour = Color.FromArgb(198, 166, 99) }; DXLabel label = new DXLabel { Parent = filterPanel, Location = new Point(5, 5), Text = "名字:", }; ItemNameBox = new DXTextBox { Parent = filterPanel, Size = new Size(180, 20), Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y), }; ItemNameBox.TextBox.KeyPress += TextBox_KeyPress; label = new DXLabel { Parent = filterPanel, Location = new Point(ItemNameBox.Location.X + ItemNameBox.Size.Width + 10, 5), Text = "物品:", }; ItemTypeBox = new DXComboBox { Parent = filterPanel, Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y), Size = new Size(95, DXComboBox.DefaultNormalHeight), DropDownHeight = 198 }; new DXListBoxItem { Parent = ItemTypeBox.ListBox, Label = { Text = "所有" }, Item = null }; Type itemType = typeof(ItemType); for (ItemType i = ItemType.Nothing; i <= ItemType.ItemPart; i++) { MemberInfo[] infos = itemType.GetMember(i.ToString()); DescriptionAttribute description = infos[0].GetCustomAttribute <DescriptionAttribute>(); new DXListBoxItem { Parent = ItemTypeBox.ListBox, Label = { Text = description?.Description ?? i.ToString() }, Item = i }; } ItemTypeBox.ListBox.SelectItem(null); SearchButton = new DXButton { Size = new Size(80, SmallButtonHeight), Location = new Point(ItemTypeBox.Location.X + ItemTypeBox.Size.Width + 15, label.Location.Y - 1), Parent = filterPanel, ButtonType = ButtonType.SmallButton, Label = { Text = "搜索" } }; SearchButton.MouseClick += (o, e) => Search(); SearchRows = new FortuneCheckerRow[9]; SearchScrollBar = new DXVScrollBar { Parent = this, Location = new Point(ClientArea.Size.Width - 14 + ClientArea.Left, ClientArea.Y + filterPanel.Size.Height + 5), Size = new Size(14, ClientArea.Height - 5 - filterPanel.Size.Height), VisibleSize = SearchRows.Length, Change = 3, }; SearchScrollBar.ValueChanged += SearchScrollBar_ValueChanged; for (int i = 0; i < SearchRows.Length; i++) { int index = i; SearchRows[index] = new FortuneCheckerRow { Parent = this, Location = new Point(ClientArea.X, ClientArea.Y + filterPanel.Size.Height + 5 + i * 58), }; // SearchRows[index].MouseClick += (o, e) => { SelectedRow = SearchRows[index]; }; SearchRows[index].MouseWheel += SearchScrollBar.DoMouseWheel; } #endregion }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { CompanionDisplay = null; CompanionDisplayPoint = Point.Empty; if (CompanionTabControl != null) { if (!CompanionTabControl.IsDisposed) { CompanionTabControl.Dispose(); } CompanionTabControl = null; } if (CompanionBagTab != null) { if (!CompanionBagTab.IsDisposed) { CompanionBagTab.Dispose(); } CompanionBagTab = null; } if (PickUpFilterTab != null) { if (!PickUpFilterTab.IsDisposed) { PickUpFilterTab.Dispose(); } PickUpFilterTab = null; } if (ItemNameFilterTab != null) { if (!ItemNameFilterTab.IsDisposed) { ItemNameFilterTab.Dispose(); } ItemNameFilterTab = null; } if (EquipmentGrid != null) { for (int i = 0; i < EquipmentGrid.Length; i++) { if (EquipmentGrid[i] != null) { if (!EquipmentGrid[i].IsDisposed) { EquipmentGrid[i].Dispose(); } EquipmentGrid[i] = null; } } EquipmentGrid = null; } if (InventoryGrid != null) { if (!InventoryGrid.IsDisposed) { InventoryGrid.Dispose(); } InventoryGrid = null; } if (WeightLabel != null) { if (!WeightLabel.IsDisposed) { WeightLabel.Dispose(); } WeightLabel = null; } if (HungerLabel != null) { if (!HungerLabel.IsDisposed) { HungerLabel.Dispose(); } HungerLabel = null; } if (NameLabel != null) { if (!NameLabel.IsDisposed) { NameLabel.Dispose(); } NameLabel = null; } if (LevelLabel != null) { if (!LevelLabel.IsDisposed) { LevelLabel.Dispose(); } LevelLabel = null; } if (ExperienceLabel != null) { if (!ExperienceLabel.IsDisposed) { ExperienceLabel.Dispose(); } ExperienceLabel = null; } if (Level3Label != null) { if (!Level3Label.IsDisposed) { Level3Label.Dispose(); } Level3Label = null; } if (Level5Label != null) { if (!Level5Label.IsDisposed) { Level5Label.Dispose(); } Level5Label = null; } if (Level7Label != null) { if (!Level7Label.IsDisposed) { Level7Label.Dispose(); } Level7Label = null; } if (Level10Label != null) { if (!Level10Label.IsDisposed) { Level10Label.Dispose(); } Level10Label = null; } if (ModeComboBox != null) { if (!ModeComboBox.IsDisposed) { ModeComboBox.Dispose(); } ModeComboBox = null; } BagWeight = 0; MaxBagWeight = 0; InventorySize = 0; } }
public CompanionDialog() { TitleLabel.Text = "宠物"; SetClientSize(new Size(355, 590)); // feature 拾取过滤 物品显示过滤 HasTitle = true; CompanionTabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; CompanionBagTab = new DXTab { Parent = CompanionTabControl, Border = true, TabButton = { Label = { Text = "宠物背包" } }, }; PickUpFilterTab = new DXTab { Parent = CompanionTabControl, Border = true, TabButton = { Label = { Text = "拾取过滤" } }, }; ItemNameFilterTab = new DXTab { Parent = CompanionTabControl, Border = true, TabButton = { Label = { Text = "显示过滤" } }, }; CompanionTabControl.SelectedTab = CompanionBagTab; DXControl filterPanel = new DXControl { Parent = PickUpFilterTab, Size = new Size(PickUpFilterTab.Size.Width, 26), Location = new Point(0, 0), Border = true, BorderColour = Color.FromArgb(198, 166, 99) }; DXLabel PickUpFilterItemNameLabel = new DXLabel { Parent = filterPanel, Location = new Point(5, 5), Text = "名字:", }; PickUpFilterItemNameBox = new DXTextBox { Parent = filterPanel, Size = new Size(90, 20), Location = new Point(PickUpFilterItemNameLabel.Location.X + PickUpFilterItemNameLabel.Size.Width + 5, PickUpFilterItemNameLabel.Location.Y), }; PickUpFilterItemNameBox.TextBox.KeyPress += TextBox_KeyPress; PickUpFilterItemTypelabel = new DXLabel { Parent = filterPanel, Location = new Point(PickUpFilterItemNameBox.Location.X + PickUpFilterItemNameBox.Size.Width + 10, 5), Text = "物品:", }; PickUpFilterItemTypeBox = new DXComboBox { Parent = filterPanel, Location = new Point(PickUpFilterItemTypelabel.Location.X + PickUpFilterItemTypelabel.Size.Width + 5, PickUpFilterItemTypelabel.Location.Y), Size = new Size(72, DXComboBox.DefaultNormalHeight), DropDownHeight = 198 }; new DXListBoxItem { Parent = PickUpFilterItemTypeBox.ListBox, Label = { Text = "所有" }, Item = null }; Type itemType = typeof(ItemType); for (ItemType i = ItemType.Nothing; i <= ItemType.ItemPart; i++) { MemberInfo[] infos = itemType.GetMember(i.ToString()); DescriptionAttribute description = infos[0].GetCustomAttribute <DescriptionAttribute>(); new DXListBoxItem { Parent = PickUpFilterItemTypeBox.ListBox, Label = { Text = description?.Description ?? i.ToString() }, Item = i }; } PickUpFilterItemTypeBox.ListBox.SelectItem(null); PickUpFilterSearchButton = new DXButton { Size = new Size(80, SmallButtonHeight), Location = new Point(PickUpFilterItemTypeBox.Location.X + PickUpFilterItemTypeBox.Size.Width + 15, PickUpFilterItemTypelabel.Location.Y - 1), Parent = filterPanel, ButtonType = ButtonType.SmallButton, Label = { Text = "搜索" } }; PickUpFilterSearchButton.MouseClick += (o, e) => Search(); PickUpFilterRow = new PickUpFilterRow[9]; PickupFilterSearchScrollBar = new DXVScrollBar { Parent = PickUpFilterTab, Location = new Point(PickUpFilterTab.Size.Width - 14, filterPanel.Size.Height + 5), Size = new Size(14, PickUpFilterTab.Size.Height - 5 - filterPanel.Size.Height), VisibleSize = PickUpFilterRow.Length, Change = 3, }; PickupFilterSearchScrollBar.ValueChanged += SearchScrollBar_ValueChanged; for (int i = 0; i < PickUpFilterRow.Length; i++) { int index = i; PickUpFilterRow[index] = new PickUpFilterRow { Parent = PickUpFilterTab, Location = new Point(0, filterPanel.Size.Height + 5 + i * 58), }; // SearchRows[index].MouseClick += (o, e) => { SelectedRow = SearchRows[index]; }; PickUpFilterRow[index].MouseWheel += PickupFilterSearchScrollBar.DoMouseWheel; } // feature end //CompanionDisplayPoint = new Point(ClientArea.X + 60, ClientArea.Y + 50); CompanionDisplayPoint = new Point(60, 120); InventoryGrid = new DXItemGrid { GridSize = new Size(10, 10), Parent = CompanionBagTab, GridType = GridType.CompanionInventory, Location = new Point(0, 200), }; EquipmentGrid = new DXItemCell[Globals.CompanionEquipmentSize]; DXItemCell cell; EquipmentGrid[(int)CompanionSlot.Bag] = cell = new DXItemCell { Location = new Point(196, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Bag, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 99); EquipmentGrid[(int)CompanionSlot.Head] = cell = new DXItemCell { Location = new Point(236, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Head, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 100); EquipmentGrid[(int)CompanionSlot.Back] = cell = new DXItemCell { Location = new Point(276, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Back, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 101); EquipmentGrid[(int)CompanionSlot.Food] = cell = new DXItemCell { Location = new Point(316, 5), Parent = CompanionBagTab, FixedBorder = true, Border = true, Slot = (int)CompanionSlot.Food, GridType = GridType.CompanionEquipment, }; cell.BeforeDraw += (o, e) => Draw((DXItemCell)o, 102); DXCheckBox PickUpCheckBox = new DXCheckBox { Parent = CompanionBagTab, Label = { Text = "拾取物品:" }, Visible = false }; //PickUpCheckBox.Location = new Point(ClientArea.Right - PickUpCheckBox.Size.Width +3, ClientArea.Y + 45); PickUpCheckBox.Location = new Point(60, 90); /* * new DXLabel * { * AutoSize = false, * Parent = this, * Outline = true, * Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), * ForeColour = Color.FromArgb(198, 166, 99), * OutlineColour = Color.Black, * IsControl = false, * Text = "Abilities", * Location = new Point(ClientArea.X + 196, CompanionDisplayPoint.Y - 20), * Size = new Size(156, 20), * DrawFormat = TextFormatFlags.HorizontalCenter | TextFormatFlags.VerticalCenter, * }; */ DXLabel label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 3", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 70); Level3Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 67), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 5", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 50); Level5Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 47), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 7", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 30); Level7Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 27), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 10", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y - 10); Level10Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y - 7), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 11", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 10); Level11Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 13), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 13", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 30); Level13Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 33), Text = "不可用" }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "Level 15", }; label.Location = new Point(235 - label.Size.Width, CompanionDisplayPoint.Y + 50); Level15Label = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(235, CompanionDisplayPoint.Y + 53), Text = "不可用" }; NameLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y - 27) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "名字", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y - 30); LevelLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y - 7) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "等级", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y - 10); ExperienceLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 13) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "经验", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 10); HungerLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 33) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "饥饿度", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 30); WeightLabel = new DXLabel { Parent = CompanionBagTab, ForeColour = Color.White, Outline = true, OutlineColour = Color.Black, IsControl = false, Location = new Point(CompanionDisplayPoint.X + 25, CompanionDisplayPoint.Y + 53) }; label = new DXLabel { Parent = CompanionBagTab, Outline = true, Font = new Font(Config.FontName, CEnvir.FontSize(10F), FontStyle.Bold), ForeColour = Color.FromArgb(198, 166, 99), OutlineColour = Color.Black, IsControl = false, Text = "重量", }; label.Location = new Point(CompanionDisplayPoint.X + 30 - label.Size.Width, CompanionDisplayPoint.Y + 50); }
private void InitializeComponent() { this.Text = DirectXClientResources.WorldSetupTitle; this.Location = new Point(0, 0); this.BackColor = Color.DarkGoldenrod; this.BackColor2 = Color.LightGoldenrodYellow; //this.transitionSound = new SoundEffect(@"Sound\select.wav", GraphicsMain.Instance.Owner); this.lblClimate = new DXLabel(this.ControlHost, this); this.lblTemperature = new DXLabel(this.ControlHost, this); this.lblAge = new DXLabel(this.ControlHost, this); this.lblLandMass = new DXLabel(this.ControlHost, this); this.cboBarbarians = new DXComboBox(this.ControlHost, this); this.cboWorldSize = new DXComboBox(this.ControlHost, this); this.cboClimate = new DXComboBox(this.ControlHost, this); this.cboTemperature = new DXComboBox(this.ControlHost, this); this.cboAge = new DXComboBox(this.ControlHost, this); this.lblBarbarians = new DXLabel(this.ControlHost, this); this.lblWorldSize = new DXLabel(this.ControlHost, this); this.lblWaterCoverage = new DXLabel(this.ControlHost, this); this.cboWaterCoverage = new DXComboBox(this.ControlHost, this); this.cboLandMass = new DXComboBox(this.ControlHost, this); //lblWorldSize this.lblWorldSize.Text = DirectXClientResources.WorldSizeLabel; this.lblWorldSize.Location = new Point(10, 140); this.lblWorldSize.Font = LabelFont; this.lblWorldSize.ForeColor = LabelColor; this.lblWorldSize.AutoSize = true; this.Controls.Add(this.lblWorldSize); //cboWorldSize this.cboWorldSize.Location = new Point(180, 140); this.cboWorldSize.Size = new Size(160, 20); this.cboWorldSize.DataSource = CreateWorldSizeStringList(); this.Controls.Add(this.cboWorldSize); //lblLandMass this.lblLandMass.Location = new Point(10, 320); this.lblLandMass.Text = DirectXClientResources.LandMassLabel; this.lblLandMass.Font = LabelFont; this.lblLandMass.ForeColor = LabelColor; this.lblLandMass.AutoSize = true; this.Controls.Add(this.lblLandMass); //cboLandMass this.cboLandMass.Location = new Point(180, 320); this.cboLandMass.Size = new Size(160, 20); this.cboLandMass.DataSource = CreateLandMassList(); this.Controls.Add(this.cboLandMass); //lblBarbarians this.lblBarbarians.Text = DirectXClientResources.BarbarianLabel; this.lblBarbarians.Location = new Point(10, 170); this.lblBarbarians.Font = LabelFont; this.lblBarbarians.ForeColor = LabelColor; this.lblBarbarians.AutoSize = true; this.Controls.Add(this.lblBarbarians); //cboBarbarians this.cboBarbarians.Location = new Point(180, 170); this.cboBarbarians.Size = new Size(160, 20); this.cboBarbarians.DataSource = CreateBarbarianList(); this.Controls.Add(this.cboBarbarians); //lblClimate this.lblClimate.Text = DirectXClientResources.ClimateLabel; this.lblClimate.Location = new Point(10, 200); this.lblClimate.Font = LabelFont; this.lblClimate.ForeColor = LabelColor; this.lblClimate.AutoSize = true; this.Controls.Add(this.lblClimate); //cboClimate this.cboClimate.Location = new Point(180, 200); this.cboClimate.DataSource = CreateClimateList(); this.cboClimate.Size = new Size(160, 20); this.Controls.Add(this.cboClimate); //lblTemperature this.lblTemperature.Text = DirectXClientResources.TemperatureLabel; this.lblTemperature.Location = new Point(10, 230); this.lblTemperature.Font = LabelFont; this.lblTemperature.ForeColor = LabelColor; this.lblTemperature.AutoSize = true; this.Controls.Add(this.lblTemperature); //cboTemperature this.cboTemperature.Location = new Point(180, 230); this.cboTemperature.Size = new Size(160, 20); this.cboTemperature.DataSource = CreateTemperatureList(); this.Controls.Add(this.cboTemperature); //lblAge this.lblAge.Text = DirectXClientResources.AgeLabel; this.lblAge.Location = new Point(10, 260); this.lblAge.Font = LabelFont; this.lblAge.ForeColor = LabelColor; this.lblAge.AutoSize = true; this.Controls.Add(this.lblAge); //cboAge this.cboAge.Location = new Point(180, 260); this.cboAge.Size = new Size(160, 20); this.cboAge.DataSource = CreateAgeList(); this.Controls.Add(this.cboAge); //lblWaterCoverage this.lblWaterCoverage.Text = DirectXClientResources.WaterCoverageLabel; this.lblWaterCoverage.Location = new Point(10, 290); this.lblWaterCoverage.Font = LabelFont; this.lblWaterCoverage.ForeColor = LabelColor; this.lblWaterCoverage.AutoSize = true; this.Controls.Add(this.lblWaterCoverage); //cboWaterCoverage this.cboWaterCoverage.Location = new Point(180, 290); this.cboWaterCoverage.Size = new Size(160, 20); this.cboWaterCoverage.DataSource = CreateWaterCoverageList(); this.Controls.Add(this.cboWaterCoverage); }
private void InitializeComponent() { //this this.BackColor = Color.DarkGoldenrod; this.BackColor2 = Color.LightGoldenrodYellow; this.Text = DirectXClientResources.PlayerSetupTitle; //lblLeaderName this.lblLeaderName = new DXLabel(this.ControlHost, this); this.lblLeaderName.Text = DirectXClientResources.LeaderNameLabel; this.lblLeaderName.Location = new Point(10, 80); this.lblLeaderName.Font = LabelFont; this.lblLeaderName.ForeColor = LabelColor; this.lblLeaderName.AutoSize = true; this.Controls.Add(this.lblLeaderName); //txtLeaderName this.txtLeaderName = new DXTextBox(this.ControlHost, this); this.txtLeaderName.Font = LabelFont; this.txtLeaderName.Location = new Point(100, 80); this.txtLeaderName.Size = new Size(150, 20); this.Controls.Add(this.txtLeaderName); //lblCiv this.lblCiv = new DXLabel(this.ControlHost, this); this.lblCiv.Text = DirectXClientResources.CivilizationLabel; this.lblCiv.Location = new Point(10, 110); this.lblCiv.Font = LabelFont; this.lblCiv.ForeColor = LabelColor; this.lblCiv.AutoSize = true; this.Controls.Add(this.lblCiv); //cboCivilization this.cboCivilization = new DXComboBox(this.ControlHost, this); this.cboCivilization.SelectedIndexChanged += new EventHandler(CivilizationChanged); this.cboCivilization.Location = new Point(100, 110); this.cboCivilization.Size = new Size(150, 20); this.cboCivilization.DataSource = ClientApplication.Instance.ServerInstance.Ruleset.Civilizations; this.cboCivilization.DisplayMember = "Name"; this.Controls.Add(this.cboCivilization); //lblDifficulty this.lblDifficulty = new DXLabel(this.ControlHost, this); this.lblDifficulty.Text = DirectXClientResources.DifficultyLabel; this.lblDifficulty.Location = new Point(10, 140); this.lblDifficulty.Font = LabelFont; this.lblDifficulty.ForeColor = LabelColor; this.lblDifficulty.AutoSize = true; this.Controls.Add(this.lblDifficulty); //cboDifficulty this.cboDifficulty = new DXComboBox(this.ControlHost, this); this.cboDifficulty.Location = new Point(100, 140); this.cboDifficulty.Size = new Size(150, 20); this.cboDifficulty.DataSource = CreateDifficultyList(); this.Controls.Add(this.cboDifficulty); //lblRules this.lblRules = new DXLabel(this.ControlHost, this); this.lblRules.Text = DirectXClientResources.RulesLabel; this.lblRules.Location = new Point(10, 170); this.lblRules.Font = LabelFont; this.lblRules.ForeColor = LabelColor; this.lblRules.AutoSize = true; this.Controls.Add(this.lblRules); //chkAllowDomination this.chkAllowDomination = new DXCheckBox(this.ControlHost, this); this.chkAllowDomination.Location = new Point(10, 200); this.chkAllowDomination.Text = DirectXClientResources.RuleDominationVictory; this.chkAllowDomination.BackColor = Color.White; this.chkAllowDomination.Font = LabelFont; this.chkAllowDomination.ForeColor = LabelColor; this.chkAllowDomination.Size = new Size(200, 20); this.Controls.Add(this.chkAllowDomination); //chkAllowDiplomaticVictory this.chkAllowDiplomaticVictory = new DXCheckBox(this.ControlHost, this); this.chkAllowDiplomaticVictory.Location = new Point(10, 220); this.chkAllowDiplomaticVictory.Text = DirectXClientResources.RuleDiplomaticVictory; this.chkAllowDiplomaticVictory.Font = LabelFont; this.chkAllowDiplomaticVictory.BackColor = Color.White; this.chkAllowDiplomaticVictory.ForeColor = LabelColor; this.chkAllowDiplomaticVictory.Size = new Size(200, 20); this.Controls.Add(this.chkAllowDiplomaticVictory); //chkAllowCulturalVictory this.chkAllowCulturalVictory = new DXCheckBox(this.ControlHost, this); this.chkAllowCulturalVictory.Location = new Point(10, 240); this.chkAllowCulturalVictory.Text = DirectXClientResources.RuleCulturalVictory; this.chkAllowCulturalVictory.BackColor = Color.White; this.chkAllowCulturalVictory.Font = LabelFont; this.chkAllowCulturalVictory.ForeColor = LabelColor; this.chkAllowCulturalVictory.Size = new Size(200, 20); this.Controls.Add(this.chkAllowCulturalVictory); //chkAllowSpaceVictory this.chkAllowSpaceVictory = new DXCheckBox(this.ControlHost, this); this.chkAllowSpaceVictory.Location = new Point(10, 260); this.chkAllowSpaceVictory.Text = DirectXClientResources.RuleSpaceVictory; this.chkAllowSpaceVictory.BackColor = Color.White; this.chkAllowSpaceVictory.Font = LabelFont; this.chkAllowSpaceVictory.ForeColor = LabelColor; this.chkAllowSpaceVictory.Size = new Size(200, 20); this.Controls.Add(this.chkAllowSpaceVictory); //chkAllowMilitaryVictory this.chkAllowMilitaryVictory = new DXCheckBox(this.ControlHost, this); this.chkAllowMilitaryVictory.Location = new Point(10, 280); this.chkAllowMilitaryVictory.Text = DirectXClientResources.RuleMilitaryVictory; this.chkAllowMilitaryVictory.BackColor = Color.White; this.chkAllowMilitaryVictory.Font = LabelFont; this.chkAllowMilitaryVictory.ForeColor = LabelColor; this.chkAllowMilitaryVictory.Size = new Size(200, 20); this.Controls.Add(this.chkAllowMilitaryVictory); //chkAllowSpecificAbilities this.chkAllowSpecificAbilities = new DXCheckBox(this.ControlHost, this); this.chkAllowSpecificAbilities.Location = new Point(10, 300); this.chkAllowSpecificAbilities.Text = DirectXClientResources.RuleCivilizationAbilities; this.chkAllowSpecificAbilities.Font = LabelFont; this.chkAllowSpecificAbilities.ForeColor = LabelColor; this.chkAllowSpecificAbilities.BackColor = Color.White; this.chkAllowSpecificAbilities.Size = new Size(200, 20); this.Controls.Add(this.chkAllowSpecificAbilities); //chkStandardRules this.chkStandardRules = new DXCheckBox(this.ControlHost, this); this.chkStandardRules.Location = new Point(10, 320); this.chkStandardRules.Text = DirectXClientResources.RuleStandard; this.chkStandardRules.Font = LabelFont; this.chkStandardRules.BackColor = Color.White; this.chkStandardRules.ForeColor = LabelColor; this.chkStandardRules.Size = new Size(200, 20); this.Controls.Add(this.chkStandardRules); //lblOpponents this.lblOpponents = new DXLabel(this.ControlHost, this); this.lblOpponents.Location = new Point(300, 140); this.lblOpponents.Text = DirectXClientResources.OpponentsLabel; this.lblOpponents.Font = LabelFont; this.lblOpponents.ForeColor = LabelColor; this.lblOpponents.AutoSize = true; this.Controls.Add(this.lblOpponents); }