mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 12:59:39 +02:00
LCL-GTK2: Fix default button index in AskUser(). Issue #37224, patch from Anton Kavalenka.
git-svn-id: trunk@63430 -
This commit is contained in:
parent
6ec641510e
commit
edd19698a4
@ -896,6 +896,8 @@ var
|
|||||||
idButtonAll : Result := GTK_RESPONSE_LCL_ALL;
|
idButtonAll : Result := GTK_RESPONSE_LCL_ALL;
|
||||||
idButtonNoToAll : Result := GTK_RESPONSE_LCL_NOTOALL;
|
idButtonNoToAll : Result := GTK_RESPONSE_LCL_NOTOALL;
|
||||||
idButtonYesToAll : Result := GTK_RESPONSE_LCL_YESTOALL;
|
idButtonYesToAll : Result := GTK_RESPONSE_LCL_YESTOALL;
|
||||||
|
else
|
||||||
|
Result:=AnID;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1044,7 +1046,10 @@ begin
|
|||||||
BtnID := -1;
|
BtnID := -1;
|
||||||
BtnResult:=DlgBtn.ModalResult;
|
BtnResult:=DlgBtn.ModalResult;
|
||||||
if (BtnResult>=Low(ButtonResults)) and (BtnResult<=High(ButtonResults)) then
|
if (BtnResult>=Low(ButtonResults)) and (BtnResult<=High(ButtonResults)) then
|
||||||
BtnID := ButtonResults[DlgBtn.ModalResult];
|
BtnID := ButtonResults[DlgBtn.ModalResult]
|
||||||
|
else
|
||||||
|
BtnID := DlgBtn.ModalResult;
|
||||||
|
|
||||||
if (BtnIdx=CancelID) then
|
if (BtnIdx=CancelID) then
|
||||||
g_object_set_data(PGObject(Dialog), 'modal_result', {%H-}Pointer(PtrInt(DlgBtn.ModalResult)));
|
g_object_set_data(PGObject(Dialog), 'modal_result', {%H-}Pointer(PtrInt(DlgBtn.ModalResult)));
|
||||||
|
|
||||||
@ -1057,7 +1062,8 @@ begin
|
|||||||
|
|
||||||
if DefaultID = BtnIdx then
|
if DefaultID = BtnIdx then
|
||||||
begin
|
begin
|
||||||
gtk_dialog_set_default_response(PGtkDialog(Dialog), ResponseID(BtnID));
|
gtk_dialog_set_default_response(PGtkDialog(Dialog), BtnID);
|
||||||
|
gtk_widget_grab_focus(PgtkWidget(Btn));
|
||||||
X := DlgBtn.ModalResult;
|
X := DlgBtn.ModalResult;
|
||||||
if CancelID<0 then
|
if CancelID<0 then
|
||||||
g_object_set_data(PGObject(Dialog), 'modal_result',
|
g_object_set_data(PGObject(Dialog), 'modal_result',
|
||||||
|
Loading…
Reference in New Issue
Block a user