📄 optionsdialog.cs
字号:
//
this._anchorsGroup.Controls.AddRange(new System.Windows.Forms.Control[] {
this._anchorColorHidden,
this._buttonPanel,
this._anchorStyleLabel,
this._anchorColorLabel,
this._showAnchorsCheck});
this._anchorsGroup.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this._anchorsGroup.ForeColor = System.Drawing.SystemColors.WindowText;
this._anchorsGroup.Location = new System.Drawing.Point(8, 120);
this._anchorsGroup.Name = "_anchorsGroup";
this._anchorsGroup.Size = new System.Drawing.Size(185, 100);
this._anchorsGroup.TabIndex = 6;
this._anchorsGroup.TabStop = false;
this._anchorsGroup.Text = "Anchors";
//
// _anchorColorHidden
//
this._anchorColorHidden.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this._anchorColorHidden.Location = new System.Drawing.Point(96, 42);
this._anchorColorHidden.Name = "_anchorColorHidden";
this._anchorColorHidden.Size = new System.Drawing.Size(72, 22);
this._anchorColorHidden.TabIndex = 7;
this._anchorColorHidden.Visible = false;
//
// _buttonPanel
//
this._buttonPanel.Controls.AddRange(new System.Windows.Forms.Control[] {
this._anchorStyleToolbar});
this._buttonPanel.Location = new System.Drawing.Point(96, 65);
this._buttonPanel.Name = "_buttonPanel";
this._buttonPanel.Size = new System.Drawing.Size(72, 27);
this._buttonPanel.TabIndex = 6;
//
// _anchorStyleToolbar
//
this._anchorStyleToolbar.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
this._anchorStyleToolbar.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this._circleBtn,
this._rectBtn,
this._xBtn});
this._anchorStyleToolbar.ButtonSize = new System.Drawing.Size(16, 16);
this._anchorStyleToolbar.DropDownArrows = true;
this._anchorStyleToolbar.ImageList = this._anchorStyleImageList;
this._anchorStyleToolbar.Name = "_anchorStyleToolbar";
this._anchorStyleToolbar.ShowToolTips = true;
this._anchorStyleToolbar.Size = new System.Drawing.Size(72, 25);
this._anchorStyleToolbar.TabIndex = 0;
this._anchorStyleToolbar.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.AnchorStyleToolbar_OnButtonClicked);
//
// _circleBtn
//
this._circleBtn.ImageIndex = 0;
this._circleBtn.Pushed = true;
this._circleBtn.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
this._circleBtn.ToolTipText = "Circle";
//
// _rectBtn
//
this._rectBtn.ImageIndex = 1;
this._rectBtn.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
this._rectBtn.ToolTipText = "Rectangle";
//
// _xBtn
//
this._xBtn.ImageIndex = 2;
this._xBtn.Style = System.Windows.Forms.ToolBarButtonStyle.ToggleButton;
this._xBtn.ToolTipText = "\"x\"";
//
// _anchorStyleImageList
//
this._anchorStyleImageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
this._anchorStyleImageList.ImageSize = new System.Drawing.Size(16, 16);
this._anchorStyleImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("_anchorStyleImageList.ImageStream")));
this._anchorStyleImageList.TransparentColor = System.Drawing.Color.Transparent;
//
// _cancelBtn
//
this._cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this._cancelBtn.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this._cancelBtn.Location = new System.Drawing.Point(104, 240);
this._cancelBtn.Name = "_cancelBtn";
this._cancelBtn.TabIndex = 0;
this._cancelBtn.Text = "Cancel";
//
// _lowerPane
//
this._lowerPane.BackColor = System.Drawing.SystemColors.ControlDark;
this._lowerPane.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this._lowerPane.Location = new System.Drawing.Point(8, 232);
this._lowerPane.Name = "_lowerPane";
this._lowerPane.Size = new System.Drawing.Size(184, 40);
this._lowerPane.TabIndex = 7;
this._lowerPane.TabStop = false;
//
// _okBtn
//
this._okBtn.DialogResult = System.Windows.Forms.DialogResult.OK;
this._okBtn.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this._okBtn.Location = new System.Drawing.Point(24, 240);
this._okBtn.Name = "_okBtn";
this._okBtn.TabIndex = 0;
this._okBtn.Text = "Ok";
this._okBtn.Click += new System.EventHandler(this.OnOK);
//
// _backColorHidden
//
this._backColorHidden.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this._backColorHidden.Location = new System.Drawing.Point(120, 39);
this._backColorHidden.Name = "_backColorHidden";
this._backColorHidden.Size = new System.Drawing.Size(72, 22);
this._backColorHidden.TabIndex = 7;
this._backColorHidden.Visible = false;
//
// _nodeColorHidden
//
this._nodeColorHidden.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this._nodeColorHidden.Location = new System.Drawing.Point(120, 63);
this._nodeColorHidden.Name = "_nodeColorHidden";
this._nodeColorHidden.Size = new System.Drawing.Size(72, 22);
this._nodeColorHidden.TabIndex = 7;
this._nodeColorHidden.Visible = false;
//
// _connectorColorHidden
//
this._connectorColorHidden.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this._connectorColorHidden.Location = new System.Drawing.Point(120, 87);
this._connectorColorHidden.Name = "_connectorColorHidden";
this._connectorColorHidden.Size = new System.Drawing.Size(72, 22);
this._connectorColorHidden.TabIndex = 7;
this._connectorColorHidden.Visible = false;
//
// _colorDialog
//
this._colorDialog.SolidColorOnly = true;
//
// _showGridCheck
//
this._showGridCheck.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this._showGridCheck.Location = new System.Drawing.Point(8, 16);
this._showGridCheck.Name = "_showGridCheck";
this._showGridCheck.Size = new System.Drawing.Size(104, 16);
this._showGridCheck.TabIndex = 4;
this._showGridCheck.Text = "Show grid";
//
// OptionsDialog
//
this.AcceptButton = this._okBtn;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this._cancelBtn;
this.ClientSize = new System.Drawing.Size(202, 279);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this._anchorsGroup,
this._connectorColorLabel,
this._nodeColorLabel,
this._backColorLabel,
this._cancelBtn,
this._okBtn,
this._lowerPane,
this._backColorHidden,
this._nodeColorHidden,
this._connectorColorHidden,
this._showGridCheck});
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "OptionsDialog";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Options";
this.Load += new System.EventHandler(this.OnLoad);
this._anchorsGroup.ResumeLayout(false);
this._buttonPanel.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void AnchorStyleToolbar_OnButtonClicked(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
_circleBtn.Pushed = false;
_rectBtn.Pushed = false;
_xBtn.Pushed = false;
e.Button.Pushed = true;
}
private void OnOK(object sender, System.EventArgs e)
{
ShowGrid = _showGridCheck.Checked;
ShowAnchors = _showAnchorsCheck.Checked;
if(_circleBtn.Pushed) AnchorStyle = 0;
if(_rectBtn.Pushed) AnchorStyle = 1;
if(_xBtn.Pushed) AnchorStyle = 2;
BackgroundColor = _backColorPicker.Color;
NodeColor = _nodeColorPicker.Color;
ConnectorColor = _connectorColorPicker.Color;
AnchorColor = _anchorColorPicker.Color;
this.Close();
}
private void AnchorColorPicker_OnClick(object sender, System.EventArgs e)
{
_colorDialog.Color = _anchorColorPicker.Color;
if(_colorDialog.ShowDialog(this) == DialogResult.OK)
_anchorColorPicker.Color = _colorDialog.Color;
}
private void BackColorPicker_OnClick(object sender, System.EventArgs e)
{
_colorDialog.Color = _backColorPicker.Color;
if(_colorDialog.ShowDialog(this) == DialogResult.OK)
_backColorPicker.Color = _colorDialog.Color;
}
private void NodeColorPicker_OnClick(object sender, System.EventArgs e)
{
_colorDialog.Color = _nodeColorPicker.Color;
if(_colorDialog.ShowDialog(this) == DialogResult.OK)
_nodeColorPicker.Color = _colorDialog.Color;
}
private void ConnectorColorPicker_OnClick(object sender, System.EventArgs e)
{
_colorDialog.Color = _connectorColorPicker.Color;
if(_colorDialog.ShowDialog(this) == DialogResult.OK)
_connectorColorPicker.Color = _colorDialog.Color;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -