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

@ -100,6 +100,7 @@ namespace GreenshotOCR
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonOK.LanguageKey = "OK";
this.buttonOK.Location = new System.Drawing.Point(12, 98);
this.buttonOK.Name = "buttonOK";
@ -111,13 +112,13 @@ namespace GreenshotOCR
// 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(128, 98);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(104, 23);
this.buttonCancel.TabIndex = 5;
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.ButtonCancelClick);
//
// SettingsForm
//
@ -133,6 +134,7 @@ namespace GreenshotOCR
this.LanguageKey = "settings_title";
this.Name = "SettingsForm";
this.ResumeLayout(false);
}
private GreenshotPlugin.Controls.GreenshotLabel label_language;
private GreenshotPlugin.Controls.GreenshotButton buttonCancel;

View file

@ -35,6 +35,8 @@ namespace GreenshotOCR {
//
this.config = config;
InitializeComponent();
AcceptButton = buttonOK;
CancelButton = buttonCancel;
this.Icon = GreenshotResources.getGreenshotIcon();
comboBox_languages.Items.Clear();
@ -54,18 +56,12 @@ namespace GreenshotOCR {
index++;
}
}
void ButtonCancelClick(object sender, EventArgs e) {
DialogResult = DialogResult.Cancel;
}
void ButtonOKClick(object sender, EventArgs e) {
string selectedString = (string) comboBox_languages.SelectedItem;
if (selectedString != null) {
config.Language = selectedString.ToUpper();
}
DialogResult = DialogResult.OK;
}
}
}