Skip to content

Commit

Permalink
Improving keyboard-based working
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankBijnen committed Jan 28, 2025
1 parent 06bd5d9 commit 5831817
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 32 deletions.
15 changes: 4 additions & 11 deletions Source/ExifToolsGui_ValEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ TValueListEditor = class;

TETGuiInplaceEdit = class(Vcl.Grids.TInplaceEdit)
private
procedure OwnerPoint(var X, Y: integer);
procedure ConvertToGridPoint(var X, Y: integer);
function ValueListEditor: TValueListEditor;
protected
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: integer); override;
Expand Down Expand Up @@ -43,14 +43,15 @@ TValueListEditor = class(Vcl.ValEdit.TValueListEditor)
property OnCtrlKeyDown: TkeyEvent read FOnCtrlKeyDown write FOnCtrlKeyDown;
property ProportionalVScroll: boolean read FProportionalVScroll write SetProportionalVScroll default false;
property FixedRows;
property InplaceEdit: TETGuiInplaceEdit read FInplaceEdit;
end;

implementation

uses
System.Types, System.UITypes, Winapi.Windows;

procedure TETGuiInplaceEdit.OwnerPoint(var X, Y: integer);
procedure TETGuiInplaceEdit.ConvertToGridPoint(var X, Y: integer);
var
Pt: TPoint;
begin
Expand All @@ -67,14 +68,6 @@ function TETGuiInplaceEdit.ValueListEditor: TValueListEditor;

procedure TETGuiInplaceEdit.KeyDown(var Key: Word; Shift: TShiftState);
begin
if (Key = VK_RIGHT) and
(SelStart = 0) and
(SelLength >= Length(Text)) then
begin
Deselect;
SelStart := Length(Text);
Key := 0;
end;
if (Shift = [ssCtrl]) then
ValueListEditor.KeyDown(Key, Shift);

Expand All @@ -85,7 +78,7 @@ procedure TETGuiInplaceEdit.MouseDown(Button: TMouseButton; Shift: TShiftState;
begin
if (Button = TMouseButton.mbRight) then
begin
OwnerPoint(X, Y);
ConvertToGridPoint(X, Y);
ValueListEditor.MouseDown(Button, Shift, X, Y);
end;

Expand Down
3 changes: 1 addition & 2 deletions Source/Main.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,6 @@ object FMain: TFMain
Top = 0
Width = 940
Height = 25
UseSystemFont = False
ActionManager = MainActionManager
Caption = 'ActionMainMenuBar'
Color = clMenuBar
Expand All @@ -995,7 +994,7 @@ object FMain: TFMain
ColorMap.BtnSelectedFont = clBlack
ColorMap.UnusedColor = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []
Expand Down
53 changes: 34 additions & 19 deletions Source/Main.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1187,29 +1187,44 @@ procedure TFMain.MetadataListExit(Sender: TObject);

procedure TFMain.MetadataListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var
I: integer;
CurrentLine: integer;
InplaceEdit: TETGuiInplaceEdit;
begin
I := MetadataList.Row +1;
if (Key = VK_Return) and
(SpeedBtnQuick.Down) then
begin
if (EditLineActive) then
begin
AutoIncLine(I);
MetadataList.EditorMode := true;
end
else
begin
if (QuickTags[I -1].NoEdit) then
AutoIncLine(I)
else
if (SpeedBtnQuick.Down = false) then
exit;

case Key of
VK_RIGHT:
begin
InplaceEdit := MetadataList.InplaceEdit;
if (InplaceEdit.SelStart = 0) and
(InplaceEdit.SelLength >= Length(InplaceEdit.Text)) then
begin
InplaceEdit.SelStart := Length(InplaceEdit.Text);
Key := 0;
end;
end;
VK_RETURN:
begin
if SpeedBtnLarge.Down then
MemoQuick.SetFocus
CurrentLine := MetadataList.Row +1;
if (EditLineActive) then
begin
AutoIncLine(CurrentLine);
MetadataList.EditorMode := true;
end
else
EditQuick.SetFocus;
begin
if (QuickTags[CurrentLine -1].NoEdit) then
AutoIncLine(CurrentLine)
else
begin
if SpeedBtnLarge.Down then
MemoQuick.SetFocus
else
EditQuick.SetFocus;
end;
end;
end;
end;
end;
end;

Expand Down
Binary file modified Translation/ExifToolGUI.CHS
Binary file not shown.
Binary file modified Translation/ExifToolGUI.DEU
Binary file not shown.
Binary file modified Translation/ExifToolGUI.ENU
Binary file not shown.
Binary file modified Translation/ExifToolGUI.ESP
Binary file not shown.
Binary file modified Translation/ExifToolGUI.FRA
Binary file not shown.
Binary file modified Translation/ExifToolGUI.ITA
Binary file not shown.
Binary file modified Translation/ExifToolGUI.NLD
Binary file not shown.
Binary file modified Translation/ExifToolGUI.PTB
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.CHS
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.DEU
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.ENU
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.ESP
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.FRA
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.ITA
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.NLD
Binary file not shown.
Binary file modified Translation/ExifToolGUI_X64.PTB
Binary file not shown.

0 comments on commit 5831817

Please sign in to comment.