mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Use radio buttons for combine orientation
This commit is contained in:
parent
596510f2e5
commit
297204f327
3 changed files with 150 additions and 44 deletions
45
ShareX.MediaLib/Forms/ImageCombinerForm.Designer.cs
generated
45
ShareX.MediaLib/Forms/ImageCombinerForm.Designer.cs
generated
|
@ -39,11 +39,14 @@ private void InitializeComponent()
|
|||
this.lblSpace = new System.Windows.Forms.Label();
|
||||
this.nudSpace = new System.Windows.Forms.NumericUpDown();
|
||||
this.lblOrientation = new System.Windows.Forms.Label();
|
||||
this.cbOrientation = new System.Windows.Forms.ComboBox();
|
||||
this.lblSpacePixel = new System.Windows.Forms.Label();
|
||||
this.lblImageAlignment = new System.Windows.Forms.Label();
|
||||
this.cbAlignment = new System.Windows.Forms.ComboBox();
|
||||
this.flpOrientation = new System.Windows.Forms.FlowLayoutPanel();
|
||||
this.rbOrientationHorizontal = new System.Windows.Forms.RadioButton();
|
||||
this.rbOrientationVertical = new System.Windows.Forms.RadioButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudSpace)).BeginInit();
|
||||
this.flpOrientation.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// btnAdd
|
||||
|
@ -123,14 +126,6 @@ private void InitializeComponent()
|
|||
resources.ApplyResources(this.lblOrientation, "lblOrientation");
|
||||
this.lblOrientation.Name = "lblOrientation";
|
||||
//
|
||||
// cbOrientation
|
||||
//
|
||||
resources.ApplyResources(this.cbOrientation, "cbOrientation");
|
||||
this.cbOrientation.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbOrientation.FormattingEnabled = true;
|
||||
this.cbOrientation.Name = "cbOrientation";
|
||||
this.cbOrientation.SelectedIndexChanged += new System.EventHandler(this.cbOrientation_SelectedIndexChanged);
|
||||
//
|
||||
// lblSpacePixel
|
||||
//
|
||||
resources.ApplyResources(this.lblSpacePixel, "lblSpacePixel");
|
||||
|
@ -149,18 +144,40 @@ private void InitializeComponent()
|
|||
this.cbAlignment.Name = "cbAlignment";
|
||||
this.cbAlignment.SelectedIndexChanged += new System.EventHandler(this.cbAlignment_SelectedIndexChanged);
|
||||
//
|
||||
// flpOrientation
|
||||
//
|
||||
resources.ApplyResources(this.flpOrientation, "flpOrientation");
|
||||
this.flpOrientation.Controls.Add(this.rbOrientationHorizontal);
|
||||
this.flpOrientation.Controls.Add(this.rbOrientationVertical);
|
||||
this.flpOrientation.Name = "flpOrientation";
|
||||
//
|
||||
// rbOrientationHorizontal
|
||||
//
|
||||
resources.ApplyResources(this.rbOrientationHorizontal, "rbOrientationHorizontal");
|
||||
this.rbOrientationHorizontal.Name = "rbOrientationHorizontal";
|
||||
this.rbOrientationHorizontal.TabStop = true;
|
||||
this.rbOrientationHorizontal.UseVisualStyleBackColor = true;
|
||||
this.rbOrientationHorizontal.CheckedChanged += new System.EventHandler(this.rbOrientationHorizontal_CheckedChanged);
|
||||
//
|
||||
// rbOrientationVertical
|
||||
//
|
||||
resources.ApplyResources(this.rbOrientationVertical, "rbOrientationVertical");
|
||||
this.rbOrientationVertical.Name = "rbOrientationVertical";
|
||||
this.rbOrientationVertical.TabStop = true;
|
||||
this.rbOrientationVertical.UseVisualStyleBackColor = true;
|
||||
this.rbOrientationVertical.CheckedChanged += new System.EventHandler(this.rbOrientationVertical_CheckedChanged);
|
||||
//
|
||||
// ImageCombinerForm
|
||||
//
|
||||
this.AcceptButton = this.btnCombine;
|
||||
this.AllowDrop = true;
|
||||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
|
||||
this.BackColor = System.Drawing.SystemColors.Window;
|
||||
this.Controls.Add(this.flpOrientation);
|
||||
this.Controls.Add(this.cbAlignment);
|
||||
this.Controls.Add(this.lblImageAlignment);
|
||||
this.Controls.Add(this.lblSpacePixel);
|
||||
this.Controls.Add(this.cbOrientation);
|
||||
this.Controls.Add(this.lblOrientation);
|
||||
this.Controls.Add(this.nudSpace);
|
||||
this.Controls.Add(this.lblSpace);
|
||||
|
@ -174,6 +191,8 @@ private void InitializeComponent()
|
|||
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.ImageCombinerForm_DragDrop);
|
||||
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.ImageCombinerForm_DragEnter);
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudSpace)).EndInit();
|
||||
this.flpOrientation.ResumeLayout(false);
|
||||
this.flpOrientation.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
|
@ -190,10 +209,12 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.Label lblSpace;
|
||||
private System.Windows.Forms.NumericUpDown nudSpace;
|
||||
private System.Windows.Forms.Label lblOrientation;
|
||||
private System.Windows.Forms.ComboBox cbOrientation;
|
||||
private System.Windows.Forms.ColumnHeader chFilepath;
|
||||
private System.Windows.Forms.Label lblSpacePixel;
|
||||
private System.Windows.Forms.Label lblImageAlignment;
|
||||
private System.Windows.Forms.ComboBox cbAlignment;
|
||||
private System.Windows.Forms.FlowLayoutPanel flpOrientation;
|
||||
private System.Windows.Forms.RadioButton rbOrientationHorizontal;
|
||||
private System.Windows.Forms.RadioButton rbOrientationVertical;
|
||||
}
|
||||
}
|
|
@ -46,12 +46,31 @@ public ImageCombinerForm(ImageCombinerOptions options)
|
|||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
|
||||
cbOrientation.Items.AddRange(Enum.GetNames(typeof(Orientation)));
|
||||
cbOrientation.SelectedIndex = (int)Options.Orientation;
|
||||
if (Options.Orientation == Orientation.Horizontal)
|
||||
{
|
||||
rbOrientationHorizontal.Checked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rbOrientationVertical.Checked = true;
|
||||
}
|
||||
|
||||
UpdateAlignmentComboBox();
|
||||
nudSpace.SetValue(Options.Space);
|
||||
}
|
||||
|
||||
private void UpdateOrientation()
|
||||
{
|
||||
if (rbOrientationHorizontal.Checked)
|
||||
{
|
||||
Options.Orientation = Orientation.Horizontal;
|
||||
}
|
||||
else
|
||||
{
|
||||
Options.Orientation = Orientation.Vertical;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateAlignmentComboBox()
|
||||
{
|
||||
cbAlignment.Items.Clear();
|
||||
|
@ -123,9 +142,15 @@ private void btnMoveDown_Click(object sender, EventArgs e)
|
|||
}
|
||||
}
|
||||
|
||||
private void cbOrientation_SelectedIndexChanged(object sender, EventArgs e)
|
||||
private void rbOrientationHorizontal_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
Options.Orientation = (Orientation)cbOrientation.SelectedIndex;
|
||||
UpdateOrientation();
|
||||
UpdateAlignmentComboBox();
|
||||
}
|
||||
|
||||
private void rbOrientationVertical_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateOrientation();
|
||||
UpdateAlignmentComboBox();
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@
|
|||
<value>lvImages</value>
|
||||
</data>
|
||||
<data name=">>lvImages.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.1.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.3.1.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>lvImages.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
@ -360,30 +360,6 @@
|
|||
<data name=">>lblOrientation.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="cbOrientation.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Left</value>
|
||||
</data>
|
||||
<data name="cbOrientation.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>200, 420</value>
|
||||
</data>
|
||||
<data name="cbOrientation.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>121, 21</value>
|
||||
</data>
|
||||
<data name="cbOrientation.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name=">>cbOrientation.Name" xml:space="preserve">
|
||||
<value>cbOrientation</value>
|
||||
</data>
|
||||
<data name=">>cbOrientation.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cbOrientation.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbOrientation.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="lblSpacePixel.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Left</value>
|
||||
</data>
|
||||
|
@ -412,7 +388,7 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblSpacePixel.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="lblImageAlignment.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Left</value>
|
||||
|
@ -442,7 +418,7 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblImageAlignment.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="cbAlignment.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Left</value>
|
||||
|
@ -466,13 +442,97 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbAlignment.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="flpOrientation.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Left</value>
|
||||
</data>
|
||||
<data name="flpOrientation.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="rbOrientationHorizontal.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="rbOrientationHorizontal.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 3</value>
|
||||
</data>
|
||||
<data name="rbOrientationHorizontal.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>0, 3, 3, 3</value>
|
||||
</data>
|
||||
<data name="rbOrientationHorizontal.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>72, 17</value>
|
||||
</data>
|
||||
<data name="rbOrientationHorizontal.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="rbOrientationHorizontal.Text" xml:space="preserve">
|
||||
<value>Horizontal</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationHorizontal.Name" xml:space="preserve">
|
||||
<value>rbOrientationHorizontal</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationHorizontal.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationHorizontal.Parent" xml:space="preserve">
|
||||
<value>flpOrientation</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationHorizontal.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="rbOrientationVertical.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="rbOrientationVertical.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>78, 3</value>
|
||||
</data>
|
||||
<data name="rbOrientationVertical.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>60, 17</value>
|
||||
</data>
|
||||
<data name="rbOrientationVertical.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="rbOrientationVertical.Text" xml:space="preserve">
|
||||
<value>Vertical</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationVertical.Name" xml:space="preserve">
|
||||
<value>rbOrientationVertical</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationVertical.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationVertical.Parent" xml:space="preserve">
|
||||
<value>flpOrientation</value>
|
||||
</data>
|
||||
<data name=">>rbOrientationVertical.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="flpOrientation.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>200, 419</value>
|
||||
</data>
|
||||
<data name="flpOrientation.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>141, 23</value>
|
||||
</data>
|
||||
<data name="flpOrientation.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>13</value>
|
||||
</data>
|
||||
<data name=">>flpOrientation.Name" xml:space="preserve">
|
||||
<value>flpOrientation</value>
|
||||
</data>
|
||||
<data name=">>flpOrientation.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>flpOrientation.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>flpOrientation.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 13</value>
|
||||
<value>96, 96</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>521, 536</value>
|
||||
|
|
Loading…
Reference in a new issue