private void LayoutRoot_Loaded(object sender, RoutedEventArgs e) { DXTabControl tabControl = new DXTabControl(); tabControl.Height = 75; tabControl.Width = 200; DXTabItem tabItem1 = new DXTabItem(); tabItem1.Header = "Button"; tabItem1.Content = new Button() { Content = "Button" }; tabControl.Items.Add(tabItem1); DXTabItem tabItem2 = new DXTabItem(); tabItem2.Header = "Check box"; tabItem2.Content = new CheckBox() { Content = "Check box" }; tabControl.Items.Add(tabItem2); LayoutRoot.Children.Add(tabControl); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (TabControl != null) { if (!TabControl.IsDisposed) { TabControl.Dispose(); } TabControl = null; } if (SchoolTabs != null) { foreach (KeyValuePair <MagicSchool, MagicTab> pair in SchoolTabs) { if (pair.Value == null) { continue; } if (pair.Value.IsDisposed) { continue; } pair.Value.Dispose(); } SchoolTabs.Clear(); SchoolTabs = null; } if (Magics != null) { foreach (KeyValuePair <MagicInfo, MagicCell> pair in Magics) { if (pair.Value == null) { continue; } if (pair.Value.IsDisposed) { continue; } pair.Value.Dispose(); } Magics.Clear(); Magics = null; } } }
public MagicDialog() { TitleLabel.Text = "技能"; HasFooter = false; SetClientSize(new Size(311, 395)); TabControl = new DXTabControl { Parent = this, Size = ClientArea.Size, Location = ClientArea.Location, }; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (TabControl != null) { if (!TabControl.IsDisposed) { TabControl.Dispose(); } TabControl = null; } if (AvailableTab != null) { if (!AvailableTab.IsDisposed) { AvailableTab.Dispose(); } AvailableTab = null; } if (CurrentTab != null) { if (!CurrentTab.IsDisposed) { CurrentTab.Dispose(); } CurrentTab = null; } if (CompletedTab != null) { if (!CompletedTab.IsDisposed) { CompletedTab.Dispose(); } CompletedTab = null; } } }
/// <summary> /// 检测DXTabControl中是否看见,若不可见在添加DXTabControl是可见 /// </summary> /// <param name="tabControl">当前DXTabControl</param> /// <returns>可见标识</returns> public static bool CheckDXTabControlVisible(DXTabControl tabControl) { bool Visible = false; try { int count = tabControl.Items.Count; if (count > 0) { Visible = true; } return(Visible); } catch (Exception ex) { throw ex; } }
public void ShowPrintPreviewInNewTab(GridControl grid, DXTabControl tabControl, string tabName) { PrintableControlLink link = new PrintableControlLink((IPrintableControl)grid.View); DocumentPreviewControl preview = new DocumentPreviewControl() { DocumentSource = link }; DXTabItem tabItem = new DXTabItem() { AllowHide = DefaultBoolean.True, Content = preview, Header = tabName }; tabItem.Tag = link; tabControl.Items.Add(tabItem); tabControl.SelectedItem = tabItem; link.CreateDocument(true); }
public QuestDialog() { TitleLabel.Text = "任务日志"; SetClientSize(new Size(558, 380)); TabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; CurrentTab = new QuestTab { TabButton = { Label = { Text = "当前任务" } }, Parent = TabControl, Border = true, ChoiceGrid = { ReadOnly = true } }; AvailableTab = new QuestTab { TabButton = { Label = { Text = "可接任务" } }, Parent = TabControl, Border = true, ShowTrackerBox = { Visible = false } }; CompletedTab = new QuestTab { TabButton = { Label = { Text = "已完成" } }, Parent = TabControl, Border = true, ShowTrackerBox = { Visible = false } }; }
/// <summary> /// 检测DXTabControl中是否存在重复的DXTabItem /// </summary> /// <param name="Header">TabItem的Header字符串</param> /// <param name="tabControl">当前DXTabControl</param> /// <returns>存在标识</returns> public static bool CheckDXTabControlRepeatItem(string Header, DXTabControl tabControl, out DXTabItem CurrentTabItem) { bool HasItem = false; CurrentTabItem = null; try { foreach (DXTabItem tabItem in tabControl.Items) { if (Header.Equals(tabItem.Header.ToString())) { HasItem = true; CurrentTabItem = tabItem; break; } } return(HasItem); } catch (Exception ex) { throw ex; } }
public ChatTab AddNewTab(ChatTabPageSetting settings) { ChatOptionsPanel panel; DXListBoxItem item = new DXListBoxItem { Parent = ListBox, Item = panel = new ChatOptionsPanel { Parent = this, Visible = false, Location = new Point(ListBox.Location.X + ListBox.Size.Width + 5, ListBox.Location.Y), LocalCheckBox = { Checked = true }, WhisperCheckBox = { Checked = true }, GroupCheckBox = { Checked = true }, GuildCheckBox = { Checked = true }, ShoutCheckBox = { Checked = true }, GlobalCheckBox = { Checked = true }, ObserverCheckBox = { Checked = true }, HintCheckBox = { Checked = true }, SystemCheckBox = { Checked = true }, GainsCheckBox = { Checked = true }, AlertCheckBox = { Checked = true }, }, }; item.SelectedChanged += (o, e) => panel.Visible = item.Selected; DXTabControl tabControl = new DXTabControl { // PassThrough = false, Size = new Size(200, 200), Parent = GameScene.Game, Movable = true, }; ChatTab tab = new ChatTab { Parent = tabControl, Panel = panel, Opacity = 0.5F, AllowResize = true, TabButton = { Movable = true, AllowDragOut = true, Label = { Text = $"Window {ListBox.Controls.Count - 1}" } } }; tab.Settings = settings; tabControl.MouseWheel += (o, e1) => (tabControl.SelectedTab as ChatTab)?.ScrollBar.DoMouseWheel(o, e1); panel.TransparentCheckBox.CheckedChanged += (o, e1) => tab.TransparencyChanged(); panel.AlertCheckBox.CheckedChanged += (o, e1) => tab.AlertIcon.Visible = false; panel.Size = new Size(ClientArea.Width - panel.Location.X, ClientArea.Height); panel.TextChanged += (o1, e1) => { item.Label.Text = panel.Text; tab.TabButton.Label.Text = panel.Text; }; panel.Text = $"Window {ListBox.Controls.Count - 1}"; panel.RemoveButton.MouseClick += (o1, e1) => { DXListBoxItem nextItem = null; bool found = false; foreach (DXControl control in ListBox.Controls) { if (!(control is DXListBoxItem)) { continue; } if (control == item) { found = true; continue; } nextItem = control as DXListBoxItem; if (found) { break; } } ListBox.SelectedItem = nextItem; item.Dispose(); panel.Dispose(); ListBox.UpdateItems(); tabControl = tab.Parent as DXTabControl; tab.Dispose(); if (tabControl?.Controls.Count == 0) { tabControl.Dispose(); } }; ListBox.SelectedItem = item; return(tab); }
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); }
public StorageDialog() { TitleLabel.Text = "仓库"; SetClientSize(new Size(483, 411)); 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) }; TabControl = new DXTabControl { Parent = this, Location = new Point(filterPanel.Location.X, filterPanel.Location.Y + filterPanel.Size.Height), Size = new Size(ClientArea.Width, 390), }; 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 = "物品:", }; 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 = $"全部" }, 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; }; StorageTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "仓库" } }, Visible = true, }; PartsTab = new DXTab { Parent = TabControl, Border = true, TabButton = { Label = { Text = "Parts" } }, Visible = false, }; Grid = new DXItemGrid { Parent = StorageTab, GridSize = new Size(1, 1), Location = new Point(5, 10), GridType = GridType.Storage, ItemGrid = CEnvir.Storage, VisibleHeight = 10, }; Grid.GridSizeChanged += StorageGrid_GridSizeChanged; PartGrid = new DXItemGrid { Parent = PartsTab, GridSize = new Size(13, 76), Location = new Point(5, 10), GridType = GridType.PartsStorage, ItemGrid = CEnvir.PartsStorage, VisibleHeight = 10, }; StorageScrollBar = new DXVScrollBar { Parent = StorageTab, Location = new Point(Grid.Location.X + PartGrid.Size.Width, Grid.Location.Y), Size = new Size(14, 349), VisibleSize = 10, Change = 1, }; StorageScrollBar.ValueChanged += StorageScrollBar_ValueChanged; PartsScrollBar = new DXVScrollBar { Parent = PartsTab, Location = new Point(PartGrid.Location.X + PartGrid.Size.Width, PartGrid.Location.Y), Size = new Size(14, 349), VisibleSize = 10, Change = 1, }; PartsScrollBar.ValueChanged += PartsScrollBar_ValueChanged; PartsScrollBar.MaxValue = PartGrid.GridSize.Height; foreach (DXItemCell cell in Grid.Grid) { cell.MouseWheel += StorageScrollBar.DoMouseWheel; } foreach (DXItemCell cell in PartGrid.Grid) { cell.MouseWheel += PartsScrollBar.DoMouseWheel; } }
public AutoPotionDialog() { TitleLabel.Text = "辅助功能"; HasFooter = true; SetClientSize(new Size(280, 418)); // feature: 设置tag,用作自动喝药,辅助功能,挂机的分页 HasTitle = true; SupportTabControl = new DXTabControl { Parent = this, Location = ClientArea.Location, Size = ClientArea.Size, }; AutoPotionTab = new DXTab { Parent = SupportTabControl, Border = true, TabButton = { Label = { Text = "自动喝药设置" } }, }; AutoSkillTab = new DXTab { Parent = SupportTabControl, Border = true, TabButton = { Label = { Text = "技能设置" } }, }; AutoBattleTab = new DXTab { Parent = SupportTabControl, Border = true, TabButton = { Label = { Text = "挂机设置" } }, }; SupportTabControl.SelectedTab = AutoPotionTab; WarriorSkillPanel = new DXControl { Parent = AutoSkillTab, Border = true, BorderSize = 3, BorderColour = Color.FromArgb(198, 166, 99), Size = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度 Location = new Point(3, 10), }; WarriorSkillPanelTitle = new DXLabel { Parent = WarriorSkillPanel, ForeColour = Color.FromArgb(198, 166, 99), Location = new Point(5, 5), Text = "战士技能" }; AutoBladeStormSkillCheckBox = new DXCheckBox { Parent = WarriorSkillPanel, Label = { Text = "自动莲月" }, Checked = false, Location = new Point(5, WarriorSkillPanelTitle.Size.Height + 5) }; AutoFlamingSwordSkillCheckBox = new DXCheckBox { Parent = WarriorSkillPanel, Label = { Text = "自动烈火" }, Checked = false, Location = new Point(WarriorSkillPanel.Size.Width / 2 + 5, WarriorSkillPanelTitle.Size.Height + 5) }; AutoMightSkillCheckBox = new DXCheckBox { Parent = WarriorSkillPanel, Label = { Text = "自动破血狂杀" }, Checked = false, Location = new Point(5, WarriorSkillPanelTitle.Size.Height + 23) }; WizardSkillPanel = new DXControl { Parent = AutoSkillTab, Border = true, BorderSize = 3, BorderColour = Color.FromArgb(198, 166, 99), Size = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度 Location = new Point(3, 90), }; WizardSkillPanelTitle = new DXLabel { Parent = WizardSkillPanel, ForeColour = Color.FromArgb(198, 166, 99), Location = new Point(5, 5), Text = "法师技能" }; AutoMagicShieldSkillCheckBox = new DXCheckBox { Parent = WizardSkillPanel, Label = { Text = "自动魔法盾" }, Checked = false, Location = new Point(5, WizardSkillPanelTitle.Size.Height + 5) }; AutoRenounceSkillCheckBox = new DXCheckBox { Parent = WizardSkillPanel, Label = { Text = "自动凝血离魄" }, Checked = false, Location = new Point(WizardSkillPanel.Size.Width / 2 + 5, WizardSkillPanelTitle.Size.Height + 5) }; TaoistSkillPanel = new DXControl { Parent = AutoSkillTab, Border = true, BorderSize = 3, BorderColour = Color.FromArgb(198, 166, 99), Size = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度 Location = new Point(3, 170), }; TaoistSkillPanelTitle = new DXLabel { Parent = TaoistSkillPanel, ForeColour = Color.FromArgb(198, 166, 99), Location = new Point(5, 5), Text = "道士技能" }; AutoCelestialLightSkillCheckBox = new DXCheckBox { Parent = TaoistSkillPanel, Label = { Text = "自动阴阳法环" }, Checked = false, Location = new Point(5, TaoistSkillPanelTitle.Size.Height + 5) }; AssassinSkillPanel = new DXControl { Parent = AutoSkillTab, Border = true, BorderSize = 3, BorderColour = Color.FromArgb(198, 166, 99), Size = new Size(AutoSkillTab.Size.Width - 6, 80), // 固定高度 Location = new Point(3, 250), }; AssassinSkillPanelTitle = new DXLabel { Parent = AssassinSkillPanel, ForeColour = Color.FromArgb(198, 166, 99), Location = new Point(5, 5), Text = "刺客技能" }; AutoFourFlowerSkillCheckBox = new DXCheckBox { Parent = AssassinSkillPanel, Label = { Text = "自动四花" }, Checked = false, Location = new Point(5, AssassinSkillPanelTitle.Size.Height + 5) }; AutoRagingWindSkillCheckBox = new DXCheckBox { Parent = AssassinSkillPanel, Label = { Text = "自动风之守护" }, Checked = false, Location = new Point(AssassinSkillPanel.Size.Width / 2 + 5, AssassinSkillPanelTitle.Size.Height + 5) }; AutoEvasionSkillCheckBox = new DXCheckBox { Parent = AssassinSkillPanel, Label = { Text = "自动风之闪避" }, Checked = false, Location = new Point(5, AssassinSkillPanelTitle.Size.Height + 23) }; // feature end Links = new ClientAutoPotionLink[Globals.MaxAutoPotionCount]; Rows = new AutoPotionRow[Globals.MaxAutoPotionCount]; ScrollBar = new DXVScrollBar { Parent = AutoPotionTab, Size = new Size(14, AutoPotionTab.Size.Height - 2), Location = new Point(AutoPotionTab.Size.Width - 14, ClientArea.Top + 1), VisibleSize = AutoPotionTab.Size.Height, MaxValue = Rows.Length * 50 - 2 }; DXControl panel = new DXControl { Parent = AutoPotionTab, Size = new Size(AutoPotionTab.Size.Width - 16, AutoPotionTab.Size.Height), Location = AutoPotionTab.Location, }; panel.MouseWheel += ScrollBar.DoMouseWheel; for (int i = 0; i < Links.Length; i++) { AutoPotionRow row; Rows[i] = row = new AutoPotionRow { Parent = panel, Location = new Point(1, 1 + 50 * i), Index = i, }; row.MouseWheel += ScrollBar.DoMouseWheel; } ScrollBar.ValueChanged += (o, e) => UpdateLocations(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (SupportTabControl != null) { if (!SupportTabControl.IsDisposed) { SupportTabControl.Dispose(); } SupportTabControl = null; } if (AutoPotionTab != null) { if (!AutoPotionTab.IsDisposed) { AutoPotionTab.Dispose(); } AutoPotionTab = null; } if (AutoSkillTab != null) { if (!AutoSkillTab.IsDisposed) { AutoSkillTab.Dispose(); } AutoSkillTab = null; } if (AutoBattleTab != null) { if (!AutoBattleTab.IsDisposed) { AutoBattleTab.Dispose(); } AutoBattleTab = null; } if (WarriorSkillPanel != null) { if (!WarriorSkillPanel.IsDisposed) { WarriorSkillPanel.Dispose(); } WarriorSkillPanel = null; } if (WarriorSkillPanelTitle != null) { if (!WarriorSkillPanelTitle.IsDisposed) { WarriorSkillPanelTitle.Dispose(); } WarriorSkillPanelTitle = null; } if (Links != null) { for (int i = 0; i < Links.Length; i++) { Links[i] = null; } Links = null; } for (int i = 0; i < Rows.Length; i++) { if (Rows[i] == null) { continue; } if (!Rows[i].IsDisposed) { Rows[i].Dispose(); } Rows[i] = null; } Rows = null; if (ScrollBar != null) { if (!ScrollBar.IsDisposed) { ScrollBar.Dispose(); } ScrollBar = null; } } }
public TabHelper(DXTabControl tab) { TabControl = tab; }