mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:06:14 +02:00
Microsoft copy/paste keys for Input Lines
This commit is contained in:
parent
fd353ee62c
commit
660836e027
@ -541,10 +541,6 @@ const menu_key_edit_cut:string[63]=menu_key_edit_cut_borland;
|
|||||||
menu_key_edit_paste:string[63]=menu_key_edit_paste_borland;
|
menu_key_edit_paste:string[63]=menu_key_edit_paste_borland;
|
||||||
menu_key_edit_all:string[63]=menu_key_edit_all_borland;
|
menu_key_edit_all:string[63]=menu_key_edit_all_borland;
|
||||||
menu_key_hlplocal_copy:string[63]=menu_key_hlplocal_copy_borland;
|
menu_key_hlplocal_copy:string[63]=menu_key_hlplocal_copy_borland;
|
||||||
cut_key:word=kbShiftDel;
|
|
||||||
copy_key:word=kbCtrlIns;
|
|
||||||
paste_key:word=kbShiftIns;
|
|
||||||
all_key:word=kbNoKey;
|
|
||||||
|
|
||||||
procedure RegisterFPViews;
|
procedure RegisterFPViews;
|
||||||
|
|
||||||
@ -3660,7 +3656,7 @@ begin
|
|||||||
if HeaderLen>Size.X-2 then HeaderLen:=Size.X-2;
|
if HeaderLen>Size.X-2 then HeaderLen:=Size.X-2;
|
||||||
|
|
||||||
{ --- 1. sor --- }
|
{ --- 1. sor --- }
|
||||||
ClearBuf; MoveChar(B[0],'³',C1,1); MoveChar(B[HeaderLen+1],'³',C1,1);
|
ClearBuf; MoveChar(B[0],'<EFBFBD>',C1,1); MoveChar(B[HeaderLen+1],'<EFBFBD>',C1,1);
|
||||||
X:=1;
|
X:=1;
|
||||||
for i:=0 to DefCount-1 do
|
for i:=0 to DefCount-1 do
|
||||||
begin
|
begin
|
||||||
@ -3673,47 +3669,47 @@ begin
|
|||||||
end
|
end
|
||||||
else C:=C2;
|
else C:=C2;
|
||||||
MoveCStr(B[X],' '+Name^+' ',C); X:=X+X2+3;
|
MoveCStr(B[X],' '+Name^+' ',C); X:=X+X2+3;
|
||||||
MoveChar(B[X-1],'³',C1,1);
|
MoveChar(B[X-1],'<EFBFBD>',C1,1);
|
||||||
end;
|
end;
|
||||||
SWriteBuf(0,1,Size.X,1,B);
|
SWriteBuf(0,1,Size.X,1,B);
|
||||||
|
|
||||||
{ --- 0. sor --- }
|
{ --- 0. sor --- }
|
||||||
ClearBuf; MoveChar(B[0],'Ú',C1,1);
|
ClearBuf; MoveChar(B[0],'<EFBFBD>',C1,1);
|
||||||
X:=1;
|
X:=1;
|
||||||
for i:=0 to DefCount-1 do
|
for i:=0 to DefCount-1 do
|
||||||
begin
|
begin
|
||||||
if I<ActiveDef then FC:='Ú'
|
if I<ActiveDef then FC:='<EFBFBD>'
|
||||||
else FC:='¿';
|
else FC:='<EFBFBD>';
|
||||||
X2:=CStrLen(AtTab(i)^.Name^)+2;
|
X2:=CStrLen(AtTab(i)^.Name^)+2;
|
||||||
MoveChar(B[X+X2],{'Â'}FC,C1,1);
|
MoveChar(B[X+X2],{'<EFBFBD>'}FC,C1,1);
|
||||||
if i=DefCount-1 then X2:=X2+1;
|
if i=DefCount-1 then X2:=X2+1;
|
||||||
if X2>0 then
|
if X2>0 then
|
||||||
MoveChar(B[X],'Ä',C1,X2);
|
MoveChar(B[X],'<EFBFBD>',C1,X2);
|
||||||
X:=X+X2+1;
|
X:=X+X2+1;
|
||||||
end;
|
end;
|
||||||
MoveChar(B[HeaderLen+1],'¿',C1,1);
|
MoveChar(B[HeaderLen+1],'<EFBFBD>',C1,1);
|
||||||
MoveChar(B[ActiveKPos],'Ú',C1,1); MoveChar(B[ActiveVPos],'¿',C1,1);
|
MoveChar(B[ActiveKPos],'<EFBFBD>',C1,1); MoveChar(B[ActiveVPos],'<EFBFBD>',C1,1);
|
||||||
SWriteBuf(0,0,Size.X,1,B);
|
SWriteBuf(0,0,Size.X,1,B);
|
||||||
|
|
||||||
{ --- 2. sor --- }
|
{ --- 2. sor --- }
|
||||||
MoveChar(B[1],'Ä',C1,Max(HeaderLen,0)); MoveChar(B[HeaderLen+2],'Ä',C1,Max(Size.X-HeaderLen-3,0));
|
MoveChar(B[1],'<EFBFBD>',C1,Max(HeaderLen,0)); MoveChar(B[HeaderLen+2],'<EFBFBD>',C1,Max(Size.X-HeaderLen-3,0));
|
||||||
MoveChar(B[Size.X-1],'¿',C1,1);
|
MoveChar(B[Size.X-1],'<EFBFBD>',C1,1);
|
||||||
MoveChar(B[ActiveKPos],'Ù',C1,1);
|
MoveChar(B[ActiveKPos],'<EFBFBD>',C1,1);
|
||||||
if ActiveDef=0 then MoveChar(B[0],'³',C1,1)
|
if ActiveDef=0 then MoveChar(B[0],'<EFBFBD>',C1,1)
|
||||||
else MoveChar(B[0],{'Ã'}'Ú',C1,1);
|
else MoveChar(B[0],{'<EFBFBD>'}'<27>',C1,1);
|
||||||
MoveChar(B[HeaderLen+1],'Ä'{'Á'},C1,1); MoveChar(B[ActiveVPos],'À',C1,1);
|
MoveChar(B[HeaderLen+1],'<EFBFBD>'{'<27>'},C1,1); MoveChar(B[ActiveVPos],'<EFBFBD>',C1,1);
|
||||||
MoveChar(B[ActiveKPos+1],' ',C1,Max(ActiveVPos-ActiveKPos-1,0));
|
MoveChar(B[ActiveKPos+1],' ',C1,Max(ActiveVPos-ActiveKPos-1,0));
|
||||||
SWriteBuf(0,2,Size.X,1,B);
|
SWriteBuf(0,2,Size.X,1,B);
|
||||||
|
|
||||||
{ --- marad‚k sor --- }
|
{ --- marad<EFBFBD>k sor --- }
|
||||||
ClearBuf; MoveChar(B[0],'³',C1,1); MoveChar(B[Size.X-1],'³',C1,1);
|
ClearBuf; MoveChar(B[0],'<EFBFBD>',C1,1); MoveChar(B[Size.X-1],'<EFBFBD>',C1,1);
|
||||||
for i:=3 to Size.Y-1 do
|
for i:=3 to Size.Y-1 do
|
||||||
SWriteBuf(0,i,Size.X,1,B);
|
SWriteBuf(0,i,Size.X,1,B);
|
||||||
{ SWriteBuf(0,3,Size.X,Size.Y-4,B); this was wrong
|
{ SWriteBuf(0,3,Size.X,Size.Y-4,B); this was wrong
|
||||||
because WriteBuf then expect a buffer of size size.x*(size.y-4)*2 PM }
|
because WriteBuf then expect a buffer of size size.x*(size.y-4)*2 PM }
|
||||||
|
|
||||||
{ --- Size.X . sor --- }
|
{ --- Size.X . sor --- }
|
||||||
MoveChar(B[0],'À',C1,1); MoveChar(B[1],'Ä',C1,Max(Size.X-2,0)); MoveChar(B[Size.X-1],'Ù',C1,1);
|
MoveChar(B[0],'<EFBFBD>',C1,1); MoveChar(B[1],'<EFBFBD>',C1,Max(Size.X-2,0)); MoveChar(B[Size.X-1],'<EFBFBD>',C1,1);
|
||||||
SWriteBuf(0,Size.Y-1,Size.X,1,B);
|
SWriteBuf(0,Size.Y-1,Size.X,1,B);
|
||||||
|
|
||||||
{ - End of TGroup.Draw - }
|
{ - End of TGroup.Draw - }
|
||||||
@ -4299,7 +4295,7 @@ begin
|
|||||||
R2.Move(0,2);
|
R2.Move(0,2);
|
||||||
Insert(New(PStaticText, Init(R2, ^C'Copyright (C) 1998-2020 by')));
|
Insert(New(PStaticText, Init(R2, ^C'Copyright (C) 1998-2020 by')));
|
||||||
R2.Move(0,2);
|
R2.Move(0,2);
|
||||||
Insert(New(PStaticText, Init(R2, ^C'B‚rczi G bor')));
|
Insert(New(PStaticText, Init(R2, ^C'B<EFBFBD>rczi G<>bor')));
|
||||||
R2.Move(0,1);
|
R2.Move(0,1);
|
||||||
Insert(New(PStaticText, Init(R2, ^C'Pierre Muller')));
|
Insert(New(PStaticText, Init(R2, ^C'Pierre Muller')));
|
||||||
R2.Move(0,1);
|
R2.Move(0,1);
|
||||||
@ -4315,14 +4311,14 @@ begin
|
|||||||
AddLine(^C'< Compiler development >');
|
AddLine(^C'< Compiler development >');
|
||||||
AddLine(^C'Carl-Eric Codere');
|
AddLine(^C'Carl-Eric Codere');
|
||||||
AddLine(^C'Daniel Mantione');
|
AddLine(^C'Daniel Mantione');
|
||||||
AddLine(^C'Florian Kl„mpfl');
|
AddLine(^C'Florian Kl<EFBFBD>mpfl');
|
||||||
AddLine(^C'Jonas Maebe');
|
AddLine(^C'Jonas Maebe');
|
||||||
AddLine(^C'Mich„el Van Canneyt');
|
AddLine(^C'Mich<EFBFBD>el Van Canneyt');
|
||||||
AddLine(^C'Peter Vreman');
|
AddLine(^C'Peter Vreman');
|
||||||
AddLine(^C'Pierre Muller');
|
AddLine(^C'Pierre Muller');
|
||||||
AddLine('');
|
AddLine('');
|
||||||
AddLine(^C'< IDE development >');
|
AddLine(^C'< IDE development >');
|
||||||
AddLine(^C'B‚rczi G bor');
|
AddLine(^C'B<EFBFBD>rczi G<>bor');
|
||||||
AddLine(^C'Peter Vreman');
|
AddLine(^C'Peter Vreman');
|
||||||
AddLine(^C'Pierre Muller');
|
AddLine(^C'Pierre Muller');
|
||||||
AddLine('');
|
AddLine('');
|
||||||
|
@ -735,6 +735,11 @@ const
|
|||||||
selection (PM) }
|
selection (PM) }
|
||||||
DontConsiderShiftState: boolean = false;
|
DontConsiderShiftState: boolean = false;
|
||||||
|
|
||||||
|
cut_key:word=kbShiftDel;
|
||||||
|
copy_key:word=kbCtrlIns;
|
||||||
|
paste_key:word=kbShiftIns;
|
||||||
|
all_key:word=kbNoKey;
|
||||||
|
|
||||||
CodeCompleteMinLen : byte = 4; { minimum length of text to try to complete }
|
CodeCompleteMinLen : byte = 4; { minimum length of text to try to complete }
|
||||||
|
|
||||||
ToClipCmds : TCommandSet = ([cmCut,cmCopy,cmCopyWin,
|
ToClipCmds : TCommandSet = ([cmCut,cmCopy,cmCopyWin,
|
||||||
@ -6983,7 +6988,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
ClearEvent(Event);
|
ClearEvent(Event);
|
||||||
End
|
End
|
||||||
else if (Event.KeyCode=kbShiftIns) and
|
else if ((Event.KeyCode=kbShiftIns) or (Event.KeyCode=paste_key)) and
|
||||||
Assigned(Clipboard) and (Clipboard^.ValidBlock) then
|
Assigned(Clipboard) and (Clipboard^.ValidBlock) then
|
||||||
{ paste from clipboard }
|
{ paste from clipboard }
|
||||||
begin
|
begin
|
||||||
@ -7011,7 +7016,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
ClearEvent(Event);
|
ClearEvent(Event);
|
||||||
end
|
end
|
||||||
else if (Event.KeyCode=kbCtrlIns) and
|
else if ((Event.KeyCode=kbCtrlIns) or (Event.KeyCode=copy_key)) and
|
||||||
Assigned(Clipboard) then
|
Assigned(Clipboard) then
|
||||||
{ Copy to clipboard }
|
{ Copy to clipboard }
|
||||||
begin
|
begin
|
||||||
@ -7022,7 +7027,7 @@ begin
|
|||||||
Clipboard^.SelEnd:=Clipboard^.CurPos;
|
Clipboard^.SelEnd:=Clipboard^.CurPos;
|
||||||
ClearEvent(Event);
|
ClearEvent(Event);
|
||||||
end
|
end
|
||||||
else if (Event.KeyCode=kbShiftDel) and
|
else if ((Event.KeyCode=kbShiftDel) or (Event.KeyCode=cut_key)) and
|
||||||
Assigned(Clipboard) then
|
Assigned(Clipboard) then
|
||||||
{ Cut to clipboard }
|
{ Cut to clipboard }
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user