mirror of https://gitlab.com/basile.b/dexed.git
fix #314 - Tab switching only works once
This commit is contained in:
parent
67bcd6e8bd
commit
b92b6b18ee
|
@ -6,6 +6,7 @@ inherited CEEditorWidget: TCEEditorWidget
|
||||||
Caption = 'Source editor'
|
Caption = 'Source editor'
|
||||||
ClientHeight = 434
|
ClientHeight = 434
|
||||||
ClientWidth = 465
|
ClientWidth = 465
|
||||||
|
OnShortCut = FormShortCut
|
||||||
inherited Back: TPanel
|
inherited Back: TPanel
|
||||||
Height = 434
|
Height = 434
|
||||||
Width = 465
|
Width = 465
|
||||||
|
@ -13,13 +14,14 @@ inherited CEEditorWidget: TCEEditorWidget
|
||||||
ClientWidth = 465
|
ClientWidth = 465
|
||||||
inherited Content: TPanel
|
inherited Content: TPanel
|
||||||
Height = 398
|
Height = 398
|
||||||
|
Top = 36
|
||||||
Width = 465
|
Width = 465
|
||||||
ClientHeight = 398
|
ClientHeight = 398
|
||||||
ClientWidth = 465
|
ClientWidth = 465
|
||||||
object editorStatus: TStatusBar[0]
|
object editorStatus: TStatusBar[0]
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 21
|
Height = 19
|
||||||
Top = 375
|
Top = 377
|
||||||
Width = 465
|
Width = 465
|
||||||
BorderSpacing.Bottom = 2
|
BorderSpacing.Bottom = 2
|
||||||
Panels = <
|
Panels = <
|
||||||
|
|
|
@ -9,7 +9,7 @@ uses
|
||||||
ComCtrls, SynEditHighlighter, ExtCtrls, Menus, SynMacroRecorder, dialogs, LazFileUtils,
|
ComCtrls, SynEditHighlighter, ExtCtrls, Menus, SynMacroRecorder, dialogs, LazFileUtils,
|
||||||
SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, ce_dialogs,
|
SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, ce_dialogs,
|
||||||
ce_widget, ce_interfaces, ce_synmemo, ce_dlang, ce_common, ce_dcd, ce_observer,
|
ce_widget, ce_interfaces, ce_synmemo, ce_dlang, ce_common, ce_dcd, ce_observer,
|
||||||
ce_sharedres, ce_controls, ce_writableComponent, ce_dsgncontrols;
|
ce_sharedres, ce_controls, ce_writableComponent, ce_dsgncontrols, LMessages;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ type
|
||||||
macRecorder: TSynMacroRecorder;
|
macRecorder: TSynMacroRecorder;
|
||||||
editorStatus: TStatusBar;
|
editorStatus: TStatusBar;
|
||||||
mnuEditor: TPopupMenu;
|
mnuEditor: TPopupMenu;
|
||||||
|
procedure FormShortCut(var Msg: TLMKey; var Handled: Boolean);
|
||||||
procedure mnuedDdocTmpClick(Sender: TObject);
|
procedure mnuedDdocTmpClick(Sender: TObject);
|
||||||
procedure mnuedGotolineClick(Sender: TObject);
|
procedure mnuedGotolineClick(Sender: TObject);
|
||||||
procedure mnuedNextWarnClick(Sender: TObject);
|
procedure mnuedNextWarnClick(Sender: TObject);
|
||||||
|
@ -672,8 +673,6 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEEditorWidget.memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure TCEEditorWidget.memoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
var
|
|
||||||
sh: TShortCut;
|
|
||||||
begin
|
begin
|
||||||
case Key of
|
case Key of
|
||||||
VK_CLEAR,VK_RETURN,VK_BACK :
|
VK_CLEAR,VK_RETURN,VK_BACK :
|
||||||
|
@ -681,26 +680,6 @@ begin
|
||||||
VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT:
|
VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT:
|
||||||
if Shift = [] then
|
if Shift = [] then
|
||||||
updateImperative;
|
updateImperative;
|
||||||
else begin
|
|
||||||
// note: keys conflict can lead to a lose of focus, i.e shortcut
|
|
||||||
// to select next page cant be repeated.
|
|
||||||
sh := KeyToShortCut(Key, shift);
|
|
||||||
if sh = fOptions.fNextPage then
|
|
||||||
begin
|
|
||||||
pageControl.pageIndex:= (pageControl.pageIndex + 1) mod pageControl.pageCount;
|
|
||||||
end
|
|
||||||
else if sh = fOptions.fPrevPage then
|
|
||||||
begin
|
|
||||||
if pageControl.pageIndex - 1 < 0 then
|
|
||||||
pageControl.pageIndex:= pageControl.pageCount - 1
|
|
||||||
else
|
|
||||||
pageControl.pageIndex:= pageControl.pageIndex - 1;
|
|
||||||
end
|
|
||||||
else if sh = fOptions.fMoveLeft then
|
|
||||||
pageControl.movePageLeft
|
|
||||||
else if sh = fOptions.fMoveRight then
|
|
||||||
pageControl.movePageRight;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
if fKeyChanged then
|
if fKeyChanged then
|
||||||
beginDelayedUpdate;
|
beginDelayedUpdate;
|
||||||
|
@ -992,6 +971,37 @@ begin
|
||||||
fDoc.insertDdocTemplate;
|
fDoc.insertDdocTemplate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCEEditorWidget.FormShortCut(var Msg: TLMKey; var Handled: Boolean);
|
||||||
|
var
|
||||||
|
sh: TShortCut;
|
||||||
|
begin
|
||||||
|
Handled := false;
|
||||||
|
sh := KeyToShortCut(Msg.CharCode, KeyDataToShiftState(Msg.KeyData));
|
||||||
|
if sh = fOptions.fNextPage then
|
||||||
|
begin
|
||||||
|
pageControl.pageIndex:= (pageControl.pageIndex + 1) mod pageControl.pageCount;
|
||||||
|
Handled := true;
|
||||||
|
end
|
||||||
|
else if sh = fOptions.fPrevPage then
|
||||||
|
begin
|
||||||
|
if pageControl.pageIndex - 1 < 0 then
|
||||||
|
pageControl.pageIndex:= pageControl.pageCount - 1
|
||||||
|
else
|
||||||
|
pageControl.pageIndex:= pageControl.pageIndex - 1;
|
||||||
|
Handled := true;
|
||||||
|
end
|
||||||
|
else if sh = fOptions.fMoveLeft then
|
||||||
|
begin
|
||||||
|
pageControl.movePageLeft;
|
||||||
|
Handled := true;
|
||||||
|
end
|
||||||
|
else if sh = fOptions.fMoveRight then
|
||||||
|
begin
|
||||||
|
pageControl.movePageRight;
|
||||||
|
Handled := true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCEEditorWidget.mnuedGotolineClick(Sender: TObject);
|
procedure TCEEditorWidget.mnuedGotolineClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if fDoc.isNotNil then
|
if fDoc.isNotNil then
|
||||||
|
|
Loading…
Reference in New Issue