FIX: Pack info dialog sometimes disappearing immediately when shown after Enter pressed (GTK2).

This commit is contained in:
cobines 2012-03-14 20:21:52 +00:00
commit 4ba752fd69
2 changed files with 13 additions and 0 deletions

View file

@ -286,6 +286,7 @@ object frmPackInfoDlg: TfrmPackInfoDlg
Caption = 'Close'
Default = True
ModalResult = 2
OnKeyUp = btnCloseKeyUp
TabOrder = 0
end
object btnUnpackAndExec: TButton

View file

@ -63,6 +63,7 @@ type
pnlInfoFile: TPanel;
pnlInfo: TPanel;
pnlButtons: TPanel;
procedure btnCloseKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
private
{ private declarations }
public
@ -76,6 +77,7 @@ implementation
{$R *.lfm}
uses
LCLType,
uFileSourceOperationTypes;
function ShowPackInfoDlg(aFileSource: IArchiveFileSource; aFile: TFile): TFileSourceExecuteOperationResult;
@ -97,6 +99,16 @@ end;
{ TfrmPackInfoDlg }
procedure TfrmPackInfoDlg.btnCloseKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
{$IFDEF LCLGTK2}
if Key = VK_RETURN then
// Lazarus issue 0021483. ControlKeyUp not called after Enter pressed.
Application.ControlKeyUp(btnClose, Key, Shift);
{$ENDIF}
end;
constructor TfrmPackInfoDlg.Create(TheOwner: TComponent;
aFileSource: IArchiveFileSource; aFile: TFile);
var