mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 01:37:31 +13:00
Pressing Ctrl + Enter will accept text in text drawing input box
This commit is contained in:
parent
d74892f883
commit
94d1ee5c41
3 changed files with 28 additions and 19 deletions
|
@ -42,7 +42,7 @@ private void InitializeComponent()
|
|||
this.cbUnderline = new System.Windows.Forms.CheckBox();
|
||||
this.btnAlignmentHorizontal = new System.Windows.Forms.Button();
|
||||
this.btnAlignmentVertical = new System.Windows.Forms.Button();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.cmsAlignmentHorizontal = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.tsmiAlignmentLeft = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.tsmiAlignmentCenter = new System.Windows.Forms.ToolStripMenuItem();
|
||||
|
@ -63,6 +63,7 @@ private void InitializeComponent()
|
|||
this.txtInput.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtInput.Name = "txtInput";
|
||||
this.txtInput.TextChanged += new System.EventHandler(this.txtInput_TextChanged);
|
||||
this.txtInput.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtInput_KeyDown);
|
||||
//
|
||||
// btnTextColor
|
||||
//
|
||||
|
@ -161,12 +162,12 @@ private void InitializeComponent()
|
|||
this.btnAlignmentVertical.UseVisualStyleBackColor = true;
|
||||
this.btnAlignmentVertical.Click += new System.EventHandler(this.btnAlignmentVertical_Click);
|
||||
//
|
||||
// btnClose
|
||||
// btnOK
|
||||
//
|
||||
resources.ApplyResources(this.btnClose, "btnClose");
|
||||
this.btnClose.Name = "btnClose";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
|
||||
resources.ApplyResources(this.btnOK, "btnOK");
|
||||
this.btnOK.Name = "btnOK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
this.btnOK.Click += new System.EventHandler(this.btnClose_Click);
|
||||
//
|
||||
// cmsAlignmentHorizontal
|
||||
//
|
||||
|
@ -232,7 +233,7 @@ private void InitializeComponent()
|
|||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.btnClose);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.flpProperties);
|
||||
this.Controls.Add(this.txtInput);
|
||||
this.MaximizeBox = false;
|
||||
|
@ -258,7 +259,7 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.FlowLayoutPanel flpProperties;
|
||||
private System.Windows.Forms.Label lblTextSize;
|
||||
private System.Windows.Forms.NumericUpDown nudTextSize;
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.CheckBox cbBold;
|
||||
private System.Windows.Forms.CheckBox cbItalic;
|
||||
private System.Windows.Forms.CheckBox cbUnderline;
|
||||
|
|
|
@ -163,6 +163,14 @@ private void tsmiAlignmentBottom_Click(object sender, EventArgs e)
|
|||
UpdateVerticalAlignmentImage();
|
||||
}
|
||||
|
||||
private void txtInput_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyData == (Keys.Control | Keys.Enter))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void txtInput_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
InputText = txtInput.Text;
|
||||
|
|
|
@ -450,31 +450,31 @@
|
|||
<data name=">>flpProperties.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="btnClose.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<data name="btnOK.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Right</value>
|
||||
</data>
|
||||
<data name="btnClose.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="btnOK.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>422, 327</value>
|
||||
</data>
|
||||
<data name="btnClose.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<data name="btnOK.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>104, 26</value>
|
||||
</data>
|
||||
<data name="btnClose.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="btnOK.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="btnClose.Text" xml:space="preserve">
|
||||
<value>Close</value>
|
||||
<data name="btnOK.Text" xml:space="preserve">
|
||||
<value>OK</value>
|
||||
</data>
|
||||
<data name=">>btnClose.Name" xml:space="preserve">
|
||||
<value>btnClose</value>
|
||||
<data name=">>btnOK.Name" xml:space="preserve">
|
||||
<value>btnOK</value>
|
||||
</data>
|
||||
<data name=">>btnClose.Type" xml:space="preserve">
|
||||
<data name=">>btnOK.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>btnClose.Parent" xml:space="preserve">
|
||||
<data name=">>btnOK.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>btnClose.ZOrder" xml:space="preserve">
|
||||
<data name=">>btnOK.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<metadata name="cmsAlignmentHorizontal.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
|
Loading…
Reference in a new issue