public void DragPropertyGridCategoryRowsToCustomizationFormTest() { using (new VerticalGridTestInitializer("verticalGridFeaturesDemo")) { this.UIVerticalGridTreeListMap.SwitchToFixedRowsDemoModule(); this.UIVerticalGridTreeListMap.DragPropertyGridCategoryRowsToCustomizationForm(); this.UIVerticalGridTreeListMap.CheckPropertyGridCategoryRowsInCustomizationForm(); DXListBox uILbCategoriesList = UIVerticalGridTreeListMap.UIXtraVerticalGridFeatWindow5.UIPanelControl1Client.UIGcContainerClient.UIFixedRowsCustom.UIPropertyGridControl1PropertyGrid.UIPropertyGridControl1Window.UITabControl1TabList.UITpCategoriesClient.UILbCategoriesList; Assert.IsTrue(uILbCategoriesList.ItemsText.Length == 3); } }
private void InitializeComponent() { this.Size = new Size(500, 500); this.Font = SystemInformation.MenuFont; this.BackColor = SystemColors.Control; this.ForeColor = SystemColors.ActiveCaption; this.Text = "City Details"; lblCity = new DXLabel(this.ControlHost, this); lblCity.Text = city.Name; lblCity.Location = new Point(50, 50); this.Controls.Add(lblCity); lblNextProjectHDR = new DXLabel(this.ControlHost, this); lblNextProjectHDR.Text = "Producing:"; lblNextProjectHDR.Location = new Point(10, 75); this.Controls.Add(lblNextProjectHDR); lblNextProject = new DXLinkLabel(this.ControlHost, this); lblNextProject.Text = city.NextImprovement.Name; lblNextProject.Location = new Point(100, 75); this.Controls.Add(lblNextProject); lblProgressHDR = new DXLabel(this.ControlHost, this); lblProgressHDR.Text = "Progress:"; lblProgressHDR.Location = new Point(10, 110); this.Controls.Add(lblProgressHDR); lblProgress = new DXLabel(this.ControlHost, this); lblProgress.Text = city.Shields.ToString() + "/" + city.NextImprovement.Cost.ToString(); lblProgress.Location = new Point(100, 110); this.Controls.Add(lblProgress); lblImprovements = new DXLabel(this.ControlHost, this); lblImprovements.Text = "Improvements:"; lblImprovements.Location = new Point(10, 145); this.Controls.Add(lblImprovements); lstImprovements = new DXListBox(this.ControlHost, this); lstImprovements.Location = new Point(100, 145); lstImprovements.Size = new Size(200, 300); this.Controls.Add(lstImprovements); btnDone = new DXButton(this.ControlHost, this); btnDone.Text = "Done"; btnDone.Location = new Point(400, 450); btnDone.Size = new Size(75, 25); btnDone.Click += new EventHandler(this.DonePressed); this.Controls.Add(btnDone); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (ListBox != null) { if (!ListBox.IsDisposed) { ListBox.Dispose(); } ListBox = null; } } }
private void InitializeComponent() { this.Text = DirectXClientResources.LoadGameTitle; this.Location = new Point(0, 0); this.Size = new Size(800, 600); this.BackColor = Color.White; this.BackColor2 = Color.White; this.okButton = new DXButton(this.ControlHost, this); this.cancelButton = new DXButton(this.ControlHost, this); this.headerLabel = new DXLabel(this.ControlHost, this); //Header Label this.headerLabel.Text = DirectXClientResources.LoadGameLabel; this.headerLabel.Location = new Point(10, 130); this.headerLabel.ForeColor = Color.White; this.headerLabel.AutoSize = true; this.Controls.Add(this.headerLabel); //list box this.listBox = new DXListBox(this.ControlHost, this); this.listBox.Location = new Point(10, 150); this.listBox.Size = new Size(400, 200); this.listBox.BackColor = Color.Black; this.listBox.ForeColor = Color.DarkBlue; this.listBox.SelectedIndexChanged += new System.EventHandler(SelectedFileChanged); this.Controls.Add(this.listBox); //OK button this.okButton.Text = DirectXClientResources.OK; this.okButton.Size = new Size(75, 25); this.okButton.Location = new Point(315, 365); this.okButton.Click += new System.EventHandler(OKButtonPressed); this.Controls.Add(this.okButton); //Cancel Button this.cancelButton.Text = DirectXClientResources.Cancel; this.cancelButton.Size = new Size(75, 25); this.cancelButton.Location = new Point(400, 365); this.Controls.Add(this.cancelButton); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { if (ListBoxItems != null) { for (int i = 0; i < ListBoxItems.Count; i++) { if (ListBoxItems[i] != null) { if (!ListBoxItems[i].IsDisposed) { ListBoxItems[i].Dispose(); } ListBoxItems[i] = null; } } ListBoxItems.Clear(); ListBoxItems = null; } if (ListBox != null) { if (!ListBox.IsDisposed) { ListBox.Dispose(); } ListBox = null; } } }
public BlockDialog() { TitleLabel.Text = "Block List"; HasFooter = false; SetClientSize(new Size(200, 200)); ListBox = new DXListBox { Parent = this, Location = ClientArea.Location, Size = new Size(ClientArea.Width, ClientArea.Height - 25) }; DXButton addButton = new DXButton { Label = { Text = "Add" }, Parent = this, Location = new Point(ClientArea.X, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, }; addButton.MouseClick += (o, e) => { DXInputWindow window = new DXInputWindow("Please enter the name of the person you wish to Block.", "Block Player") { ConfirmButton = { Enabled = false }, Modal = true }; window.ValueTextBox.TextBox.TextChanged += (o1, e1) => { window.ConfirmButton.Enabled = Globals.CharacterReg.IsMatch(window.ValueTextBox.TextBox.Text); }; window.ConfirmButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockAdd { Name = window.Value }); }; }; DXButton removeButton = new DXButton { Label = { Text = "Remove" }, Parent = this, Location = new Point(ClientArea.Right - 80, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Enabled = false, }; removeButton.MouseClick += (o, e) => { if (ListBox.SelectedItem == null) { return; } DXMessageBox box = new DXMessageBox($"Are you sure you want to Un-Block {ListBox.SelectedItem.Label.Text}?", "Un-Block Player", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockRemove { Index = (int)ListBox.SelectedItem.Item }); }; }; ListBox.selectedItemChanged += (o, e) => { removeButton.Enabled = ListBox.SelectedItem != null; }; RefreshList(); }
public ChatOptionsDialog() { TitleLabel.Text = "Chat Options"; HasFooter = true; SetClientSize(new Size(350, 200)); ListBox = new DXListBox { Location = ClientArea.Location, Size = new Size(120, ClientArea.Height - SmallButtonHeight - 5), Parent = this, }; DXButton button = new DXButton { ButtonType = ButtonType.SmallButton, Label = { Text = "Add" }, Parent = this, Size = new Size(50, SmallButtonHeight), }; button.Location = new Point((ListBox.DisplayArea.Right - button.Size.Width), ListBox.DisplayArea.Bottom + 5); button.MouseClick += (o, e) => AddNewTab(null); button = new DXButton { ButtonType = ButtonType.Default, Label = { Text = "Reset All" }, Parent = this, Size = new Size(80, DefaultHeight), Location = new Point(ClientArea.Right - 80 - 10, Size.Height - 43), }; button.MouseClick += (o, e) => { DXMessageBox box = new DXMessageBox("Are you sure you want to reset ALL chat windows", "Chat Reset", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { for (int i = ChatTab.Tabs.Count - 1; i >= 0; i--) { ChatTab.Tabs[i].Panel.RemoveButton.InvokeMouseClick(); } CreateDefaultWindows(); }; }; button = new DXButton { ButtonType = ButtonType.Default, Label = { Text = "Save All" }, Parent = this, Size = new Size(80, DefaultHeight), Location = new Point(ClientArea.X, Size.Height - 43), }; button.MouseClick += (o, e) => { // DXMessageBox box = new DXMessageBox("Are you sure you want to reset ALL chat windows", "Chat Reset", DXMessageBoxButtons.YesNo); GameScene.Game.SaveChatTabs(); GameScene.Game.ReceiveChat("Chat Layout Saved", MessageType.Announcement); }; button = new DXButton { ButtonType = ButtonType.Default, Label = { Text = "Reload All" }, Parent = this, Size = new Size(80, DefaultHeight), Location = new Point(ClientArea.X + 85, Size.Height - 43), }; button.MouseClick += (o, e) => { DXMessageBox box = new DXMessageBox("Are you sure you want to reload ALL chat windows", "Chat reload", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { GameScene.Game.LoadChatTabs(); }; }; }
/// <summary> /// Initializes a new instance of the <see cref="Console"/> class. /// </summary> /// <param name="controlHost"></param> public Console(IDirectXControlHost controlHost) : base(controlHost) { this.listBox = new DXListBox(controlHost, this); }
public BlockDialog() { TitleLabel.Text = "黑名单"; HasFooter = false; SetClientSize(new Size(200, 200)); ListBox = new DXListBox { Parent = this, Location = ClientArea.Location, Size = new Size(ClientArea.Width, ClientArea.Height - 25) }; DXButton addButton = new DXButton { Label = { Text = "添加" }, Parent = this, Location = new Point(ClientArea.X, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, }; addButton.MouseClick += (o, e) => { DXInputWindow window = new DXInputWindow("请输入您要屏蔽的玩家角色名.", "屏蔽玩家") { ConfirmButton = { Enabled = false }, Modal = true }; window.ValueTextBox.TextBox.TextChanged += (o1, e1) => { window.ConfirmButton.Enabled = Globals.CharacterReg.IsMatch(window.ValueTextBox.TextBox.Text); }; window.ConfirmButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockAdd { Name = window.Value }); }; }; DXButton removeButton = new DXButton { Label = { Text = "移除" }, Parent = this, Location = new Point(ClientArea.Right - 80, ClientArea.Bottom - 20), Size = new Size(80, SmallButtonHeight), ButtonType = ButtonType.SmallButton, Enabled = false, }; removeButton.MouseClick += (o, e) => { if (ListBox.SelectedItem == null) { return; } DXMessageBox box = new DXMessageBox($"您确认对玩家 {ListBox.SelectedItem.Label.Text} 解除屏蔽?", "解除屏蔽", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { CEnvir.Enqueue(new C.BlockRemove { Index = (int)ListBox.SelectedItem.Item }); }; }; ListBox.selectedItemChanged += (o, e) => { removeButton.Enabled = ListBox.SelectedItem != null; }; RefreshList(); }