From d437236479bcd911e9f2215670299f6abc49206b Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 4 Oct 2009 12:44:21 +0200 Subject: Focus default choice button in the "do-not-show-again" dialog --- UGnome.pas | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/UGnome.pas b/UGnome.pas index 709da4a..71b8a37 100644 --- a/UGnome.pas +++ b/UGnome.pas @@ -1198,6 +1198,7 @@ const TMessageStyleID : array[0..3] of TGtkMessageType = (GTK_MESSAGE_ERROR, GTK var Dialog: PGtkWidget; CheckBox: PGtkCheckButton; i: integer; + w: PGtkWidget; begin if Application.Terminated then begin @@ -1210,8 +1211,10 @@ begin gtk_widget_show(PGtkWidget(CheckBox)); gtk_box_pack_end(GTK_BOX(GTK_DIALOG(Dialog).vbox), PGtkWidget(CheckBox), False, False, 12); for i := 1 to NumMessageButtons do - if TMessageButton(i - 1) in Buttons - then gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], i); + if TMessageButton(i - 1) in Buttons then begin + w := gtk_dialog_add_button(PGtkDialog(Dialog), MessageButtonID[i], i); + if TMessageButton(i - 1) = Default then gtk_widget_grab_focus(w); + end; if Escape <> mbNone then g_signal_connect(PGtkObject(Dialog), 'key-press-event', G_CALLBACK(@Gnome_MessageBox_key_press_event), Pointer(Ord(Escape) + 1{MessageButtonID[Ord(Escape)]})); if Default <> mbNone then gtk_dialog_set_default_response(PGtkDialog(Dialog), Ord(Default)); -- cgit v1.2.3