private void InitializeComponent() { this.Location = new Point(50, 50); this.Size = new Size(500, 200); this.BackColor = SystemColors.Control; this.ForeColor = SystemColors.ActiveCaption; this.Text = "Name your new city..."; _lblCityName = new DXLabel(this.ControlHost, this); _lblCityName.Text = "City Name"; _lblCityName.Font = new System.Drawing.Font("Arial", 10.25F, FontStyle.Bold); _lblCityName.Location = new Point(20, 60); this.Controls.Add(_lblCityName); _txtCityName = new DXTextBox(this.ControlHost, this); _txtCityName.Location = new Point(80, 60); _txtCityName.Size = new Size(200, 20); this.Controls.Add(_txtCityName); _btnOK = new DXButton(this.ControlHost, this); _btnOK.Text = "OK"; _btnOK.Location = new Point(285, 160); _btnOK.Size = new Size(75, 25); _btnOK.Click += new EventHandler(this.OnOK); this.Controls.Add(_btnOK); _btnCancel = new DXButton(this.ControlHost, this); _btnCancel.Text = "Cancel"; _btnCancel.Location = new Point(375, 160); _btnCancel.Size = new Size(75, 25); _btnCancel.Click += new EventHandler(OnCancel); this.Controls.Add(_btnCancel); }
public ChatTextBox() { Size = new Size(400, 25); Opacity = 0.6F; HasTitle = false; HasFooter = false; HasTopBorder = false; CloseButton.Visible = false; AllowResize = true; CanResizeHeight = false; ChatModeButton = new DXButton { ButtonType = ButtonType.SmallButton, Size = new Size(60, SmallButtonHeight), Label = { Text = "本地" }, Parent = this, }; ChatModeButton.MouseClick += (o, e) => Mode = (ChatMode)(((int)(Mode) + 1) % 7); OptionsButton = new DXButton { ButtonType = ButtonType.SmallButton, Size = new Size(50, SmallButtonHeight), Label = { Text = "聊天设置" }, Parent = this, }; OptionsButton.MouseClick += (o, e) => { GameScene.Game.ChatOptionsBox.Visible = !GameScene.Game.ChatOptionsBox.Visible; }; TextBox = new DXTextBox { Size = new Size(350, 20), Parent = this, MaxLength = Globals.MaxChatLength, Opacity = 0.35f, }; TextBox.TextBox.KeyPress += TextBox_KeyPress; // TextBox.TextBox.KeyDown += TextBox_KeyDown; // TextBox.TextBox.KeyUp += TextBox_KeyUp; SetClientSize(new Size(TextBox.Size.Width + ChatModeButton.Size.Width + 15 + OptionsButton.Size.Width, TextBox.Size.Height)); ChatModeButton.Location = new Point(ClientArea.Location.X, ClientArea.Y - 1); TextBox.Location = new Point(ClientArea.Location.X + ChatModeButton.Size.Width + 5, ClientArea.Y); OptionsButton.Location = new Point(ClientArea.Location.X + TextBox.Size.Width + ChatModeButton.Size.Width + 10, ClientArea.Y - 1); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _Mode = 0; ModeChanged = null; LastPM = null; if (TextBox != null) { if (!TextBox.IsDisposed) { TextBox.Dispose(); } TextBox = null; } if (OptionsButton != null) { if (!OptionsButton.IsDisposed) { OptionsButton.Dispose(); } OptionsButton = null; } if (ChatModeButton != null) { if (!ChatModeButton.IsDisposed) { ChatModeButton.Dispose(); } ChatModeButton = null; } } }
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; } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (NameTextBox != null) { if (!NameTextBox.IsDisposed) { NameTextBox.Dispose(); } NameTextBox = null; } if (RemoveButton != null) { if (!RemoveButton.IsDisposed) { RemoveButton.Dispose(); } RemoveButton = null; } if (TransparentCheckBox != null) { if (!TransparentCheckBox.IsDisposed) { TransparentCheckBox.Dispose(); } TransparentCheckBox = null; } if (AlertCheckBox != null) { if (!AlertCheckBox.IsDisposed) { AlertCheckBox.Dispose(); } AlertCheckBox = null; } if (LocalCheckBox != null) { if (!LocalCheckBox.IsDisposed) { LocalCheckBox.Dispose(); } LocalCheckBox = null; } if (WhisperCheckBox != null) { if (!WhisperCheckBox.IsDisposed) { WhisperCheckBox.Dispose(); } WhisperCheckBox = null; } if (GroupCheckBox != null) { if (!GroupCheckBox.IsDisposed) { GroupCheckBox.Dispose(); } GroupCheckBox = null; } if (GuildCheckBox != null) { if (!GuildCheckBox.IsDisposed) { GuildCheckBox.Dispose(); } GuildCheckBox = null; } if (ShoutCheckBox != null) { if (!ShoutCheckBox.IsDisposed) { ShoutCheckBox.Dispose(); } ShoutCheckBox = null; } if (GlobalCheckBox != null) { if (!GlobalCheckBox.IsDisposed) { GlobalCheckBox.Dispose(); } GlobalCheckBox = null; } if (ObserverCheckBox != null) { if (!ObserverCheckBox.IsDisposed) { ObserverCheckBox.Dispose(); } ObserverCheckBox = null; } if (SystemCheckBox != null) { if (!SystemCheckBox.IsDisposed) { SystemCheckBox.Dispose(); } SystemCheckBox = null; } if (GainsCheckBox != null) { if (!GainsCheckBox.IsDisposed) { GainsCheckBox.Dispose(); } GainsCheckBox = null; } if (HintCheckBox != null) { if (!HintCheckBox.IsDisposed) { HintCheckBox.Dispose(); } HintCheckBox = null; } } }
public ChatOptionsPanel() { DXLabel label = new DXLabel { Text = "Chat Name:", Outline = true, Parent = this, }; label.Location = new Point(74 - label.Size.Width, 1); NameTextBox = new DXTextBox { Location = new Point(74, 1), Size = new Size(80, 20), Parent = this, }; NameTextBox.TextBox.TextChanged += (o, e) => Text = NameTextBox.TextBox.Text; TransparentCheckBox = new DXCheckBox { Label = { Text = "Transparent:" }, Parent = this, Checked = false, }; TransparentCheckBox.Location = new Point(100 - TransparentCheckBox.Size.Width, 40); AlertCheckBox = new DXCheckBox { Label = { Text = "Show Alert:" }, Parent = this, Checked = false, }; AlertCheckBox.Location = new Point(216 - AlertCheckBox.Size.Width, 40); LocalCheckBox = new DXCheckBox { Label = { Text = "Local Chat:" }, Parent = this, Checked = false, }; LocalCheckBox.Location = new Point(100 - LocalCheckBox.Size.Width, 80); WhisperCheckBox = new DXCheckBox { Label = { Text = "Whisper Chat:" }, Parent = this, Checked = false, }; WhisperCheckBox.Location = new Point(216 - WhisperCheckBox.Size.Width, 80); GroupCheckBox = new DXCheckBox { Label = { Text = "Group Chat:" }, Parent = this, Checked = false, }; GroupCheckBox.Location = new Point(100 - GroupCheckBox.Size.Width, 105); GuildCheckBox = new DXCheckBox { Label = { Text = "Guild Chat:" }, Parent = this, Checked = false, }; GuildCheckBox.Location = new Point(216 - GuildCheckBox.Size.Width, 105); ShoutCheckBox = new DXCheckBox { Label = { Text = "Shout Chat:" }, Parent = this, Checked = false, }; ShoutCheckBox.Location = new Point(100 - ShoutCheckBox.Size.Width, 130); GlobalCheckBox = new DXCheckBox { Label = { Text = "Global Chat:" }, Parent = this, Checked = false, }; GlobalCheckBox.Location = new Point(216 - GlobalCheckBox.Size.Width, 130); ObserverCheckBox = new DXCheckBox { Label = { Text = "Observer Chat:" }, Parent = this, Checked = false, }; ObserverCheckBox.Location = new Point(100 - ObserverCheckBox.Size.Width, 155); HintCheckBox = new DXCheckBox { Label = { Text = "Hint Text:" }, Parent = this, Checked = false, }; HintCheckBox.Location = new Point(216 - HintCheckBox.Size.Width, 155); SystemCheckBox = new DXCheckBox { Label = { Text = "System Text:" }, Parent = this, Checked = false, }; SystemCheckBox.Location = new Point(100 - SystemCheckBox.Size.Width, 180); GainsCheckBox = new DXCheckBox { Label = { Text = "Gains Text:" }, Parent = this, Checked = false, }; GainsCheckBox.Location = new Point(216 - GainsCheckBox.Size.Width, 180); RemoveButton = new DXButton { ButtonType = ButtonType.SmallButton, Label = { Text = "Remove" }, Parent = this, Size = new Size(50, SmallButtonHeight), Location = new Point(NameTextBox.DisplayArea.Right + 10, 0), }; }
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 }
public ChatOptionsPanel() { DXLabel label = new DXLabel { Text = "窗口名称:", Outline = true, Parent = this, }; label.Location = new Point(74 - label.Size.Width, 1); NameTextBox = new DXTextBox { Location = new Point(74, 1), Size = new Size(80, 20), Parent = this, }; NameTextBox.TextBox.TextChanged += (o, e) => Text = NameTextBox.TextBox.Text; TransparentCheckBox = new DXCheckBox { Label = { Text = "透明:" }, Parent = this, Checked = false, }; TransparentCheckBox.Location = new Point(100 - TransparentCheckBox.Size.Width, 40); AlertCheckBox = new DXCheckBox { Label = { Text = "显示告警:" }, Parent = this, Checked = false, }; AlertCheckBox.Location = new Point(216 - AlertCheckBox.Size.Width, 40); LocalCheckBox = new DXCheckBox { Label = { Text = "本地:" }, Parent = this, Checked = false, }; LocalCheckBox.Location = new Point(100 - LocalCheckBox.Size.Width, 80); WhisperCheckBox = new DXCheckBox { Label = { Text = "私聊:" }, Parent = this, Checked = false, }; WhisperCheckBox.Location = new Point(216 - WhisperCheckBox.Size.Width, 80); GroupCheckBox = new DXCheckBox { Label = { Text = "组队:" }, Parent = this, Checked = false, }; GroupCheckBox.Location = new Point(100 - GroupCheckBox.Size.Width, 105); GuildCheckBox = new DXCheckBox { Label = { Text = "公会:" }, Parent = this, Checked = false, }; GuildCheckBox.Location = new Point(216 - GuildCheckBox.Size.Width, 105); ShoutCheckBox = new DXCheckBox { Label = { Text = "大喊:" }, Parent = this, Checked = false, }; ShoutCheckBox.Location = new Point(100 - ShoutCheckBox.Size.Width, 130); GlobalCheckBox = new DXCheckBox { Label = { Text = "全服:" }, Parent = this, Checked = false, }; GlobalCheckBox.Location = new Point(216 - GlobalCheckBox.Size.Width, 130); ObserverCheckBox = new DXCheckBox { Label = { Text = "观察者:" }, Parent = this, Checked = false, }; ObserverCheckBox.Location = new Point(100 - ObserverCheckBox.Size.Width, 155); HintCheckBox = new DXCheckBox { Label = { Text = "提示信息:" }, Parent = this, Checked = false, }; HintCheckBox.Location = new Point(216 - HintCheckBox.Size.Width, 155); SystemCheckBox = new DXCheckBox { Label = { Text = "系统信息:" }, Parent = this, Checked = false, }; SystemCheckBox.Location = new Point(100 - SystemCheckBox.Size.Width, 180); GainsCheckBox = new DXCheckBox { Label = { Text = "拾取信息:" }, Parent = this, Checked = false, }; GainsCheckBox.Location = new Point(216 - GainsCheckBox.Size.Width, 180); RemoveButton = new DXButton { ButtonType = ButtonType.SmallButton, Label = { Text = "移除" }, Parent = this, Size = new Size(50, SmallButtonHeight), Location = new Point(NameTextBox.DisplayArea.Right + 10, 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.OptionsTitle; this.BackColor = Color.Green; this.BackColor2 = Color.Green; //lblRuleset lblRuleset = new DXLabel(this.ControlHost, this); lblRuleset.Text = DirectXClientResources.RulesetLabel; lblRuleset.AutoSize = true; lblRuleset.Location = new Point(20, 100); this.Controls.Add(lblRuleset); //txtRuleset txtRuleset = new DXTextBox(this.ControlHost, this); txtRuleset.Size = new Size(200, 20); txtRuleset.Location = new Point(150, 100); this.Controls.Add(txtRuleset); //lblTileset lblTileset = new DXLabel(this.ControlHost, this); lblTileset.Text = DirectXClientResources.TilesetLabel; lblTileset.AutoSize = true; lblTileset.Location = new Point(20, 130); this.Controls.Add(lblTileset); //txtTileset txtTileset = new DXTextBox(this.ControlHost, this); txtTileset.Size = new Size(200, 20); txtTileset.Location = new Point(150, 130); this.Controls.Add(txtTileset); //chkShowKilledMessage chkShowKilledMessage = new DXCheckBox(this.ControlHost, this); chkShowKilledMessage.Text = "Show Killed Message"; chkShowKilledMessage.Size = new Size(300, 25); chkShowKilledMessage.Location = new Point(20, 160); this.Controls.Add(chkShowKilledMessage); //chkWaitAfterTurn chkWaitAfterTurn = new DXCheckBox(this.ControlHost, this); chkWaitAfterTurn.Text = "Wait After Turn"; chkWaitAfterTurn.Size = new Size(300, 25); chkWaitAfterTurn.Location = new Point(20, 190); this.Controls.Add(chkWaitAfterTurn); //btnOK btnOK = new DXButton(this.ControlHost, this); btnOK.Text = DirectXClientResources.OK; btnOK.Size = new Size(100, 25); btnOK.Location = new Point(100, 500); btnOK.Click += new EventHandler(OkButtonPressed); this.Controls.Add(btnOK); //btnCancel btnCancel = new DXButton(this.ControlHost, this); btnCancel.Text = DirectXClientResources.Cancel; btnCancel.Size = new Size(100, 25); btnCancel.Location = new Point(220, 500); btnCancel.Click += new EventHandler(CancelButtonPressed); this.Controls.Add(btnCancel); }
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); }