diff --git a/lcl/dialogs.pp b/lcl/dialogs.pp index 36ddcc329b..f71399a736 100644 --- a/lcl/dialogs.pp +++ b/lcl/dialogs.pp @@ -248,7 +248,7 @@ implementation uses - Buttons, StdCtrls, LCLlinux, SysUtils, FileCtrl, LCLStrConsts; + Buttons, StdCtrls, LCLlinux, SysUtils, FileCtrl, LCLStrConsts, LCLType; const cMtCaption : array [TMsgDlgType] of string = @@ -313,6 +313,9 @@ end. { ============================================================================= $Log$ + Revision 1.16 2002/07/29 13:39:06 lazarus + MG: removed ambigious TBitmap from LCLType and added Escape key to MessageDlgs + Revision 1.15 2002/07/04 11:46:00 lazarus MG: moved resourcestring to lclstrconsts.pas diff --git a/lcl/include/messagedialogs.inc b/lcl/include/messagedialogs.inc index 980e96c087..00408e4f8c 100644 --- a/lcl/include/messagedialogs.inc +++ b/lcl/include/messagedialogs.inc @@ -39,6 +39,8 @@ type Internal class used to build a MessageBox. } TMessageBox = class (TForm) + procedure MessageBoxKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); private FBitmap : TBitmap; FDlgType : TMsgDlgType; @@ -99,6 +101,7 @@ begin FButtons := [mbOk]; FRelayoutNeeded := false; FUpdateCounter := 0; + OnKeyDown:=@MessageBoxKeyDown; OnActivate:=@FormActivate; end; @@ -173,6 +176,23 @@ begin Result:=Canvas.TextHeight('ABCDEFGHIJKLMNOPQRSTUVWXYZgp09')+8; end; +{------------------------------------------------------------------------------ + Method: TMessageBox.MessageBoxKeyDown + + OnKeyDown Event handler for messages dialogs. + The 'Escape' key has the same meaning as a Cancel or Abort click. + ------------------------------------------------------------------------------} +procedure TMessageBox.MessageBoxKeyDown(Sender: TObject; var Key: Word; + Shift: TShiftState); +begin + if (Key=VK_Escape) then begin + if mbCancel in FButtons then + ModalResult:=mrCancel + else if mbAbort in FButtons then + ModalResult:=mrAbort; + end; +end; + {------------------------------------------------------------------------------ Method: TMessageBox.SetMessage Params: value - text to be displayed in the message box @@ -475,6 +495,9 @@ end; { $Log$ + Revision 1.11 2002/07/29 13:39:07 lazarus + MG: removed ambigious TBitmap from LCLType and added Escape key to MessageDlgs + Revision 1.10 2002/06/06 07:23:24 lazarus MG: small fixes to reduce form repositioing diff --git a/lcl/lcltype.pp b/lcl/lcltype.pp index 15155bad6c..752611207e 100644 --- a/lcl/lcltype.pp +++ b/lcl/lcltype.pp @@ -685,7 +685,7 @@ type { Bitmap Header Definition } - PBitmap = ^TBitmap; + PBitmap = ^TagBitmap; tagBITMAP = packed record bmType: Longint; bmWidth: Longint; @@ -695,7 +695,6 @@ type bmBitsPixel: Word; bmBits: Pointer; end; - TBitmap = tagBITMAP; BITMAP = tagBITMAP; { ********************************** } @@ -716,7 +715,7 @@ type PDIBSection = ^TDIBSection; tagDIBSECTION = packed record - dsBm: TBitmap; + dsBm: TagBitmap; dsBmih: pointer;//TBitmapInfoHeader; dsBitfields: array[0..2] of DWORD; dshSection: THandle; @@ -1406,6 +1405,9 @@ end. { $Log$ + Revision 1.8 2002/07/29 13:39:07 lazarus + MG: removed ambigious TBitmap from LCLType and added Escape key to MessageDlgs + Revision 1.7 2002/06/04 15:17:22 lazarus MG: improved TFont for XLFD font names