MG: fixed keygrabbing key translation

git-svn-id: trunk@1849 -
This commit is contained in:
lazarus 2002-08-17 11:38:01 +00:00
parent ce83336615
commit 0280402696
3 changed files with 25 additions and 2 deletions

View File

@ -81,6 +81,8 @@ type
OkButton: TButton;
CancelButton: TButton;
procedure BuildAllButtonClick(Sender: TObject);
procedure ConfigureBuildLazarusDlgKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure ConfigureBuildLazarusDlgResize(Sender: TObject);
procedure OkButtonClick(Sender: TObject);
procedure CancelButtonClick(Sender: TObject);
@ -102,6 +104,9 @@ function BuildLazarus(Options: TBuildLazarusOptions;
implementation
uses
LCLType;
const
MakeModeNames: array[TMakeMode] of string = (
'None', 'Build', 'Clean & Build'
@ -240,6 +245,7 @@ begin
Position:=poScreenCenter;
Caption:='Configure "Build Lazarus"';
OnResize:=@ConfigureBuildLazarusDlgResize;
OnKeyDown:=@ConfigureBuildLazarusDlgKeyDown;
CleanAllCheckBox:=TCheckBox.Create(Self);
with CleanAllCheckBox do begin
@ -400,6 +406,13 @@ begin
OptionsEdit.Text:='';
end;
procedure TConfigureBuildLazarusDlg.ConfigureBuildLazarusDlgKeyDown(
Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key=VK_Escape then
ModalResult:=mrCancel;
end;
procedure TConfigureBuildLazarusDlg.ConfigureBuildLazarusDlgResize(
Sender: TObject);
begin

View File

@ -283,11 +283,15 @@ begin
Result:=StrToIntDef(copy(s,7,length(s)-8),VK_UNKNOWN)
else if s<>'none' then begin
for i:=1 to 300 do
if KeyAndShiftStateToStr(i,[])=s then
if KeyAndShiftStateToStr(i,[])=s then begin
Result:=i;
exit;
end;
for i:=VK_IRREGULAR+33 to VK_IRREGULAR+255 do
if KeyAndShiftStateToStr(i,[])=s then
if KeyAndShiftStateToStr(i,[])=s then begin
Result:=i;
exit;
end;
end;
end;

View File

@ -1603,6 +1603,9 @@ begin
ecBuildLazarus:
DoBuildLazarus;
ecConfigBuildLazarus:
mnuToolConfigBuildLazClicked(Self);
else
Handled:=false;
@ -6591,6 +6594,9 @@ end.
{ =============================================================================
$Log$
Revision 1.343 2002/08/17 11:38:01 lazarus
MG: fixed keygrabbing key translation
Revision 1.342 2002/08/16 20:13:07 lazarus
MG: custom external tools are now shown in the menu