Adds new Mac OS X scheme for compatibility with other ports of Lazarus

git-svn-id: trunk@16514 -
This commit is contained in:
sekelsenmat 2008-09-10 00:09:16 +00:00
parent 50c74bdb72
commit 18acb578da
5 changed files with 75 additions and 34 deletions

View File

@ -42,7 +42,8 @@ type
TKeyMapScheme = ( TKeyMapScheme = (
kmsLazarus, kmsLazarus,
kmsClassic, kmsClassic,
kmsMacOSX, kmsMacOSXApple,
kmsMacOSXLaz,
kmsCustom kmsCustom
); );
@ -152,6 +153,8 @@ procedure GetDefaultKeyForClassicScheme(Command: word;
var TheKeyA, TheKeyB: TIDEShortCut); var TheKeyA, TheKeyB: TIDEShortCut);
procedure GetDefaultKeyForMacOSXScheme(Command: word; procedure GetDefaultKeyForMacOSXScheme(Command: word;
var TheKeyA, TheKeyB: TIDEShortCut); var TheKeyA, TheKeyB: TIDEShortCut);
procedure GetDefaultKeyForMacOSXLazScheme(Command: word;
var TheKeyA, TheKeyB: TIDEShortCut);
function KeySchemeNameToSchemeType(const SchemeName: string): TKeyMapScheme; function KeySchemeNameToSchemeType(const SchemeName: string): TKeyMapScheme;
function ShiftStateToStr(Shift: TShiftState): string; function ShiftStateToStr(Shift: TShiftState): string;
@ -1338,14 +1341,49 @@ begin
end; end;
end; end;
procedure GetDefaultKeyForMacOSXLazScheme(Command: word; var TheKeyA, TheKeyB: TIDEShortCut);
procedure SetResult(NewKeyA: word; NewShiftA: TShiftState;
NewKeyB: word; NewShiftB: TShiftState);
begin
TheKeyA:=IDEShortCut(NewKeyA, NewShiftA, VK_UNKNOWN, []);
TheKeyB:=IDEShortCut(NewKeyB, NewShiftB, VK_UNKNOWN, []);
end;
procedure SetResult2(
NewKey1A: word; NewShift1A: TShiftState;
NewKey1B: word; NewShift1B: TShiftState;
NewKey2A: word; NewShift2A: TShiftState;
NewKey2B: word; NewShift2B: TShiftState);
begin
TheKeyA:=IDEShortCut(NewKey1A,NewShift1A,NewKey1B,NewShift1B);
TheKeyB:=IDEShortCut(NewKey2A,NewShift2A,NewKey2B,NewShift2B);
end;
begin
{ First default to standard Mac OS X scheme }
GetDefaultKeyForMacOSXScheme(Command, TheKeyA, TheKeyB);
{ Now override some entries }
case Command of
// moving
ecLineStart: SetResult(VK_HOME, [],VK_UNKNOWN,[]);
ecLineEnd: SetResult(VK_END, [],VK_UNKNOWN,[]);
ecEditorTop: SetResult(VK_UP,[ssMeta],VK_UNKNOWN,[]);
ecEditorBottom: SetResult(VK_DOWN,[ssMeta],VK_UNKNOWN,[]);
end;
end;
function KeySchemeNameToSchemeType(const SchemeName: string): TKeyMapScheme; function KeySchemeNameToSchemeType(const SchemeName: string): TKeyMapScheme;
begin begin
if (SchemeName='') or (CompareText(SchemeName,'Default')=0) then if (SchemeName='') or (CompareText(SchemeName,'Default')=0) then
Result:=kmsLazarus Result:=kmsLazarus
else if (CompareText(SchemeName,'Classic')=0) then else if (CompareText(SchemeName,'Classic')=0) then
Result:=kmsClassic Result:=kmsClassic
else if (CompareText(SchemeName,'Mac OS X')=0) then else if (CompareText(SchemeName,'Mac OS X (Apple style)')=0) then
Result:=kmsMacOSX Result:=kmsMacOSXApple
else if (CompareText(SchemeName,'Mac OS X (Lazarus style)')=0) then
Result:=kmsMacOSXLaz
else else
Result:=kmsCustom; Result:=kmsCustom;
end; end;
@ -2620,7 +2658,8 @@ begin
kmsLazarus: GetDefaultKeyForCommand(CurRelation.Command,TheKeyA,TheKeyB); kmsLazarus: GetDefaultKeyForCommand(CurRelation.Command,TheKeyA,TheKeyB);
kmsClassic: GetDefaultKeyForClassicScheme(CurRelation.Command, kmsClassic: GetDefaultKeyForClassicScheme(CurRelation.Command,
TheKeyA,TheKeyB); TheKeyA,TheKeyB);
kmsMacOSX: GetDefaultKeyForMacOSXScheme(CurRelation.Command,TheKeyA,TheKeyB); kmsMacOSXApple: GetDefaultKeyForMacOSXScheme(CurRelation.Command,TheKeyA,TheKeyB);
kmsMacOSXLaz: GetDefaultKeyForMacOSXLazScheme(CurRelation.Command,TheKeyA,TheKeyB);
kmsCustom: ; kmsCustom: ;
end; end;
CurRelation.ShortcutA:=TheKeyA; CurRelation.ShortcutA:=TheKeyA;

View File

@ -3,14 +3,13 @@ object ChooseKeySchemeDlg: TChooseKeySchemeDlg
Height = 219 Height = 219
Top = 307 Top = 307
Width = 400 Width = 400
HorzScrollBar.Page = 399
VertScrollBar.Page = 218
ActiveControl = OkButton ActiveControl = OkButton
Caption = 'ChooseKeySchemeDlg' Caption = 'ChooseKeySchemeDlg'
ClientHeight = 219 ClientHeight = 219
ClientWidth = 400 ClientWidth = 400
OnCreate = ChooseKeySchemeDlgCREATE OnCreate = ChooseKeySchemeDlgCREATE
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.25'
object NoteLabel: TLabel object NoteLabel: TLabel
Left = 8 Left = 8
Height = 44 Height = 44
@ -58,13 +57,14 @@ object ChooseKeySchemeDlg: TChooseKeySchemeDlg
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 98 ClientHeight = 94
ClientWidth = 380 ClientWidth = 376
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'Default (Lazarus)' 'Default (Lazarus)'
'Classic (TP)' 'Classic (TP)'
'Mac OS X' 'Mac OS X (Apple style)'
'Mac OS X (Lazarus style)'
) )
TabOrder = 1 TabOrder = 1
end end

View File

@ -2,26 +2,26 @@
LazarusResources.Add('TChooseKeySchemeDlg','FORMDATA',[ LazarusResources.Add('TChooseKeySchemeDlg','FORMDATA',[
'TPF0'#19'TChooseKeySchemeDlg'#18'ChooseKeySchemeDlg'#4'Left'#3#150#1#6'Heigh' 'TPF0'#19'TChooseKeySchemeDlg'#18'ChooseKeySchemeDlg'#4'Left'#3#150#1#6'Heigh'
+'t'#3#219#0#3'Top'#3'3'#1#5'Width'#3#144#1#18'HorzScrollBar.Page'#3#143#1#18 +'t'#3#219#0#3'Top'#3'3'#1#5'Width'#3#144#1#13'ActiveControl'#7#8'OkButton'#7
+'VertScrollBar.Page'#3#218#0#13'ActiveControl'#7#8'OkButton'#7'Caption'#6#18 +'Caption'#6#18'ChooseKeySchemeDlg'#12'ClientHeight'#3#219#0#11'ClientWidth'#3
+'ChooseKeySchemeDlg'#12'ClientHeight'#3#219#0#11'ClientWidth'#3#144#1#8'OnCr' +#144#1#8'OnCreate'#7#24'ChooseKeySchemeDlgCREATE'#8'Position'#7#14'poScreenC'
+'eate'#7#24'ChooseKeySchemeDlgCREATE'#8'Position'#7#14'poScreenCenter'#0#6'T' +'enter'#10'LCLVersion'#6#6'0.9.25'#0#6'TLabel'#9'NoteLabel'#4'Left'#2#8#6'He'
+'Label'#9'NoteLabel'#4'Left'#2#8#6'Height'#2','#3'Top'#2#10#5'Width'#3'~'#1#7 +'ight'#2','#3'Top'#2#10#5'Width'#3'~'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'a'
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoSize'#8#7'Caption'#6#9'No' +'kRight'#0#8'AutoSize'#8#7'Caption'#6#9'NoteLabel'#11'ParentColor'#8#8'WordW'
+'teLabel'#11'ParentColor'#8#8'WordWrap'#9#0#0#7'TButton'#8'OkButton'#4'Left' +'rap'#9#0#0#7'TButton'#8'OkButton'#4'Left'#2'l'#6'Height'#2#25#3'Top'#3#186#0
+#2'l'#6'Height'#2#25#3'Top'#3#186#0#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8 +#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#2'Ok'#11'M'
+'akBottom'#0#7'Caption'#6#2'Ok'#11'ModalResult'#2#1#8'TabOrder'#2#0#0#0#7'TB' +'odalResult'#2#1#8'TabOrder'#2#0#0#0#7'TButton'#12'CancelButton'#4'Left'#3
+'utton'#12'CancelButton'#4'Left'#3#216#0#6'Height'#2#25#3'Top'#3#186#0#5'Wid' +#216#0#6'Height'#2#25#3'Top'#3#186#0#5'Width'#2'K'#7'Anchors'#11#6'akLeft'#8
+'th'#2'K'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#6'Cancel'#11'Mo' +'akBottom'#0#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#2#0#0
+'dalResult'#2#2#8'TabOrder'#2#2#0#0#11'TRadioGroup'#16'SchemeRadiogroup'#4'L' +#11'TRadioGroup'#16'SchemeRadiogroup'#4'Left'#2#8#6'Height'#2't'#3'Top'#2'8'
+'eft'#2#8#6'Height'#2't'#3'Top'#2'8'#5'Width'#3#128#1#7'Anchors'#11#5'akTop' +#5'Width'#3#128#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8
+#6'akLeft'#7'akRight'#8'akBottom'#0#8'AutoFill'#9#7'Caption'#6#6'Scheme'#28 +'AutoFill'#9#7'Caption'#6#6'Scheme'#28'ChildSizing.LeftRightSpacing'#2#6#28
+'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'C' +'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizontal'#7#24'cr'
+'hildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing' +'sHomogenousChildResize'#27'ChildSizing.EnlargeVertical'#7#24'crsHomogenousC'
+'.EnlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHoriz' +'hildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildS'
+'ontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChi' +'izing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclL'
+'lds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSiz' +'eftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1#12'ClientHei'
+'ing.ControlsPerLine'#2#1#12'ClientHeight'#2'b'#11'ClientWidth'#3'|'#1#9'Ite' +'ght'#2'^'#11'ClientWidth'#3'x'#1#9'ItemIndex'#2#0#13'Items.Strings'#1#6#17
+'mIndex'#2#0#13'Items.Strings'#1#6#17'Default (Lazarus)'#6#12'Classic (TP)'#6 +'Default (Lazarus)'#6#12'Classic (TP)'#6#22'Mac OS X (Apple style)'#6#24'Mac'
+#8'Mac OS X'#0#8'TabOrder'#2#1#0#0#0 +' OS X (Lazarus style)'#0#8'TabOrder'#2#1#0#0#0
]); ]);

View File

@ -79,7 +79,8 @@ function TChooseKeySchemeDlg.GetKeymapScheme: string;
begin begin
case SchemeRadiogroup.ItemIndex of case SchemeRadiogroup.ItemIndex of
1: Result:=lisKMClassic; 1: Result:=lisKMClassic;
2: Result:=lisKMMacOSX; 2: Result:=lisKMMacOSXApple;
3: Result:=lisKMMacOSXLaz;
else Result:=''; else Result:='';
end; end;
end; end;

View File

@ -889,7 +889,8 @@ resourcestring
dlgCancel = 'Cancel'; dlgCancel = 'Cancel';
lisSAMSelectNone = 'Select none'; lisSAMSelectNone = 'Select none';
lisKMClassic = 'Classic'; lisKMClassic = 'Classic';
lisKMMacOSX = 'Mac OS X'; lisKMMacOSXApple = 'Mac OS X (Apple style)';
lisKMMacOSXLaz = 'Mac OS X (Lazarus style)';
lisPEFilename = 'Filename:'; lisPEFilename = 'Filename:';
lisPEUnitname = 'Unitname:'; lisPEUnitname = 'Unitname:';
lisPVUTheUnitnameIsUsedWhenTheIDEExtendsUsesClauses = 'The unitname is used ' lisPVUTheUnitnameIsUsedWhenTheIDEExtendsUsesClauses = 'The unitname is used '