BUG-1653: Accessibility improvements, adding accept/cancel buttons to some of the forms. This way one can e.g. ESC out of a form.

This commit is contained in:
RKrom 2014-07-18 13:56:55 +02:00
commit 036aec55f5
25 changed files with 119 additions and 180 deletions

View file

@ -90,6 +90,7 @@ namespace GreenshotJiraPlugin {
// uploadButton
//
this.uploadButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.uploadButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.uploadButton.Enabled = false;
this.uploadButton.Location = new System.Drawing.Point(550, 281);
this.uploadButton.Name = "uploadButton";
@ -97,7 +98,6 @@ namespace GreenshotJiraPlugin {
this.uploadButton.TabIndex = 10;
this.uploadButton.Text = "Upload";
this.uploadButton.UseVisualStyleBackColor = true;
this.uploadButton.Click += new System.EventHandler(this.uploadButton_Click);
//
// jiraListView
//
@ -156,13 +156,13 @@ namespace GreenshotJiraPlugin {
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(631, 281);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 23);
this.cancelButton.TabIndex = 11;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// label1
//
@ -206,6 +206,7 @@ namespace GreenshotJiraPlugin {
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.TextBox jiraKey;
private System.Windows.Forms.Label label1;

View file

@ -37,6 +37,9 @@ namespace GreenshotJiraPlugin {
public JiraForm(JiraConnector jiraConnector) {
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
AcceptButton = uploadButton;
CancelButton = cancelButton;
initializeComponentText();
this.columnSorter = new GreenshotColumnSorter();
@ -169,14 +172,6 @@ namespace GreenshotJiraPlugin {
}
}
private void uploadButton_Click(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
private void cancelButton_Click(object sender, EventArgs e) {
this.DialogResult = DialogResult.Cancel;
}
private void jiraListView_ColumnClick(object sender, ColumnClickEventArgs e) {
// Determine if clicked column is already the column that is being sorted.
if (e.Column == columnSorter.SortColumn) {

View file

@ -57,17 +57,18 @@ namespace GreenshotJiraPlugin {
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(222, 84);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 23);
this.buttonOK.TabIndex = 10;
this.buttonOK.UseVisualStyleBackColor = true;
this.buttonOK.Click += new System.EventHandler(this.ButtonOKClick);
//
// buttonCancel
//
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.LanguageKey = "CANCEL";
this.buttonCancel.Location = new System.Drawing.Point(303, 84);
this.buttonCancel.Name = "buttonCancel";
@ -75,7 +76,6 @@ namespace GreenshotJiraPlugin {
this.buttonCancel.TabIndex = 11;
this.buttonCancel.Text = "Cancel";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// label_url
//
@ -134,6 +134,7 @@ namespace GreenshotJiraPlugin {
this.Name = "SettingsForm";
this.ResumeLayout(false);
this.PerformLayout();
}
private GreenshotPlugin.Controls.GreenshotComboBox combobox_uploadimageformat;
private GreenshotPlugin.Controls.GreenshotLabel label_upload_format;

View file

@ -32,15 +32,9 @@ namespace GreenshotJiraPlugin {
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
void ButtonOKClick(object sender, EventArgs e) {
this.DialogResult = DialogResult.OK;
}
void ButtonCancelClick(object sender, System.EventArgs e) {
this.DialogResult = DialogResult.Cancel;
AcceptButton = buttonOK;
CancelButton = buttonCancel;
Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
}
}
}