public DXKeyBindWindow() { HasFooter = true; TitleLabel.Text = "Key Binds"; Modal = true; CloseButton.Visible = false; SetClientSize(new Size(430, 330)); DXLabel label = new DXLabel { Parent = this, Text = "[Escape] to undo changes to current Key Bind", }; label.Location = new Point(ClientArea.Right - label.Size.Width, ClientArea.Y); BindTree = new KeyBindTree { Parent = this, Location = new Point(ClientArea.X, ClientArea.Y + 20), Size = new Size(ClientArea.Width, ClientArea.Height - 20) }; SaveButton = new DXButton { Location = new Point(Size.Width - 190, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "Apply" } }; SaveButton.MouseClick += SaveButton_MouseClick; CancelButton = new DXButton { Location = new Point(Size.Width - 100, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "Close" } }; CancelButton.MouseClick += (o, e) => Visible = false; DefaultButton = new DXButton { Location = new Point(ClientArea.X, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "Defaults" } }; DefaultButton.MouseClick += (o, e) => { DXMessageBox box = new DXMessageBox("Are you sure you want to reset ALL keybinds back to the default settings?", "Reset Key Binds", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { CEnvir.ResetKeyBinds(); LoadList(); }; }; }
public DXKeyBindWindow() { HasFooter = true; TitleLabel.Text = "按键绑定"; Modal = true; CloseButton.Visible = false; SetClientSize(new Size(430, 330)); DXLabel label = new DXLabel { Parent = this, Text = "按[Esc]键盘来撤销当前的按键绑定", }; label.Location = new Point(ClientArea.Right - label.Size.Width, ClientArea.Y); BindTree = new KeyBindTree { Parent = this, Location = new Point(ClientArea.X, ClientArea.Y + 20), Size = new Size(ClientArea.Width, ClientArea.Height - 20) }; SaveButton = new DXButton { Location = new Point(Size.Width - 190, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "应用" } }; SaveButton.MouseClick += SaveButton_MouseClick; CancelButton = new DXButton { Location = new Point(Size.Width - 100, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "关闭" } }; CancelButton.MouseClick += (o, e) => Visible = false; DefaultButton = new DXButton { Location = new Point(ClientArea.X, Size.Height - 43), Size = new Size(80, DefaultHeight), Parent = this, Label = { Text = "默认" } }; DefaultButton.MouseClick += (o, e) => { DXMessageBox box = new DXMessageBox("确认重置所有按键绑定?", "重置", DXMessageBoxButtons.YesNo); box.YesButton.MouseClick += (o1, e1) => { CEnvir.ResetKeyBinds(); LoadList(); }; }; }