Skip to content

Commit 974b82b

Browse files
FIX: UI under Linux not OK
1 parent 2bd11e2 commit 974b82b

File tree

5 files changed

+56
-114
lines changed

5 files changed

+56
-114
lines changed

src/CopyCommander2.lpi

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -16,81 +16,8 @@
1616
<DpiAware Value="True"/>
1717
</XPManifest>
1818
</General>
19-
<BuildModes Count="3">
19+
<BuildModes Count="1">
2020
<Item1 Name="Default" Default="True"/>
21-
<Item2 Name="Debug">
22-
<CompilerOptions>
23-
<Version Value="11"/>
24-
<PathDelim Value="\"/>
25-
<Target>
26-
<Filename Value="CopyCommander2"/>
27-
</Target>
28-
<SearchPaths>
29-
<IncludeFiles Value="$(ProjOutDir)"/>
30-
<OtherUnitFiles Value="..\Sample\DatenSteuerung"/>
31-
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
32-
</SearchPaths>
33-
<Parsing>
34-
<SyntaxOptions>
35-
<IncludeAssertionCode Value="True"/>
36-
</SyntaxOptions>
37-
</Parsing>
38-
<CodeGeneration>
39-
<Checks>
40-
<IOChecks Value="True"/>
41-
<RangeChecks Value="True"/>
42-
<OverflowChecks Value="True"/>
43-
<StackChecks Value="True"/>
44-
</Checks>
45-
<VerifyObjMethodCallValidity Value="True"/>
46-
</CodeGeneration>
47-
<Linking>
48-
<Debugging>
49-
<DebugInfoType Value="dsDwarf3"/>
50-
<UseHeaptrc Value="True"/>
51-
<TrashVariables Value="True"/>
52-
<UseExternalDbgSyms Value="True"/>
53-
</Debugging>
54-
<Options>
55-
<Win32>
56-
<GraphicApplication Value="True"/>
57-
</Win32>
58-
</Options>
59-
</Linking>
60-
</CompilerOptions>
61-
</Item2>
62-
<Item3 Name="Release">
63-
<CompilerOptions>
64-
<Version Value="11"/>
65-
<PathDelim Value="\"/>
66-
<Target>
67-
<Filename Value="CopyCommander2"/>
68-
</Target>
69-
<SearchPaths>
70-
<IncludeFiles Value="$(ProjOutDir)"/>
71-
<OtherUnitFiles Value="..\Sample\DatenSteuerung"/>
72-
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
73-
</SearchPaths>
74-
<CodeGeneration>
75-
<SmartLinkUnit Value="True"/>
76-
<Optimizations>
77-
<OptimizationLevel Value="3"/>
78-
</Optimizations>
79-
</CodeGeneration>
80-
<Linking>
81-
<Debugging>
82-
<GenerateDebugInfo Value="False"/>
83-
<RunWithoutDebug Value="True"/>
84-
</Debugging>
85-
<LinkSmart Value="True"/>
86-
<Options>
87-
<Win32>
88-
<GraphicApplication Value="True"/>
89-
</Win32>
90-
</Options>
91-
</Linking>
92-
</CompilerOptions>
93-
</Item3>
9421
</BuildModes>
9522
<PublishOptions>
9623
<Version Value="2"/>

src/CopyCommander2.lpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
Begin
3333
RequireDerivedFormResource := True;
34-
Application.Scaled:=True;
34+
Application.Scaled := True;
3535
Application.Initialize;
3636
Application.CreateForm(TForm1, Form1);
3737
Application.CreateForm(TForm2, Form2);

src/ufifo.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
(*
4444
* TQueue
4545
*
46-
* Eine via Pointer realisierte FIFO, Thread Save
46+
* Eine via Pointer realisierte FIFO, Thread Safe
4747
*)
4848

4949
{ TFifo }
@@ -86,7 +86,7 @@
8686
*
8787
* Eine via Array realisierte FIFO, welche sich intern bei Bedarf erweitert
8888
* Vorteil : weniger Speicherallokationen
89-
* Nachteil : nicht Thread Save (höchstwahrscheinlich)
89+
* Nachteil : nicht Thread Safe (höchstwahrscheinlich)
9090
*)
9191

9292
{ TBufferedFifo }

src/unit1.lfm

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ object Form1: TForm1
99
ClientWidth = 777
1010
Constraints.MinHeight = 200
1111
Constraints.MinWidth = 400
12+
Position = poScreenCenter
13+
LCLVersion = '4.99.0.0'
1214
OnActivate = FormActivate
1315
OnClose = FormClose
1416
OnCloseQuery = FormCloseQuery
1517
OnCreate = FormCreate
1618
OnDropFiles = FormDropFiles
17-
Position = poScreenCenter
18-
LCLVersion = '2.3.0.0'
1919
object PairSplitter1: TPairSplitter
2020
Left = 50
2121
Height = 400
2222
Top = 50
2323
Width = 400
24-
OnResize = PairSplitter1Resize
2524
Position = 200
25+
OnResize = PairSplitter1Resize
2626
object PairSplitterSide1: TPairSplitterSide
2727
Cursor = crArrow
2828
Left = 0
@@ -45,18 +45,18 @@ object Form1: TForm1
4545
OnResize = Panel1Resize
4646
object cbDirLeft: TComboBox
4747
Left = 12
48-
Height = 23
49-
Top = 44
48+
Height = 28
49+
Top = 39
5050
Width = 148
5151
Anchors = [akLeft, akRight, akBottom]
52-
ItemHeight = 15
52+
ItemHeight = 0
53+
PopupMenu = PopupMenu3
54+
TabOrder = 0
55+
TextHint = 'Directory left'
5356
OnDblClick = cbDirLeftDblClick
5457
OnKeyDown = cbDirLeftKeyDown
5558
OnKeyPress = cbDirLeftKeyPress
5659
OnSelect = cbDirLeftSelect
57-
PopupMenu = PopupMenu3
58-
TabOrder = 0
59-
TextHint = 'Directory left'
6060
end
6161
object btnDirLeft: TSpeedButton
6262
Left = 164
@@ -71,7 +71,7 @@ object Form1: TForm1
7171
end
7272
object ListView1: TListView
7373
Left = 0
74-
Height = 302
74+
Height = 301
7575
Top = 75
7676
Width = 200
7777
Align = alClient
@@ -89,7 +89,6 @@ object Form1: TForm1
8989
AutoSize = True
9090
Caption = 'Size'
9191
MinWidth = 50
92-
Width = 35
9392
end>
9493
HideSelection = False
9594
MultiSelect = True
@@ -107,8 +106,8 @@ object Form1: TForm1
107106
end
108107
object StatusBar1: TStatusBar
109108
Left = 0
110-
Height = 23
111-
Top = 377
109+
Height = 24
110+
Top = 376
112111
Width = 200
113112
Panels = <
114113
item
@@ -139,18 +138,18 @@ object Form1: TForm1
139138
OnResize = Panel2Resize
140139
object cbDirRight: TComboBox
141140
Left = 8
142-
Height = 23
143-
Top = 44
141+
Height = 28
142+
Top = 39
144143
Width = 148
145144
Anchors = [akLeft, akRight, akBottom]
146-
ItemHeight = 15
145+
ItemHeight = 0
146+
PopupMenu = PopupMenu4
147+
TabOrder = 0
148+
TextHint = 'Directory right'
147149
OnDblClick = cbDirRightDblClick
148150
OnKeyDown = cbDirRightKeyDown
149151
OnKeyPress = cbDirRightKeyPress
150152
OnSelect = cbDirRightSelect
151-
PopupMenu = PopupMenu4
152-
TabOrder = 0
153-
TextHint = 'Directory right'
154153
end
155154
object btnDirRight: TSpeedButton
156155
Left = 160
@@ -165,8 +164,8 @@ object Form1: TForm1
165164
end
166165
object StatusBar2: TStatusBar
167166
Left = 0
168-
Height = 23
169-
Top = 377
167+
Height = 24
168+
Top = 376
170169
Width = 195
171170
Panels = <
172171
item
@@ -176,7 +175,7 @@ object Form1: TForm1
176175
end
177176
object ListView2: TListView
178177
Left = 0
179-
Height = 302
178+
Height = 301
180179
Top = 75
181180
Width = 195
182181
Align = alClient
@@ -194,7 +193,6 @@ object Form1: TForm1
194193
AutoSize = True
195194
Caption = 'Size'
196195
MinWidth = 50
197-
Width = 35
198196
end>
199197
HideSelection = False
200198
MultiSelect = True

src/unit1.pas

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(******************************************************************************)
22
(* CopyCommander2 15.02.2022 *)
33
(* *)
4-
(* Version : 0.11 *)
4+
(* Version : 0.12 *)
55
(* *)
66
(* Author : Uwe Schächterle (Corpsman) *)
77
(* *)
@@ -80,6 +80,7 @@
8080
(* CTRL + R = Reload directory *)
8181
(* CTRL + Tab = switch left / right view *)
8282
(* Diff dialog can export diff as .csv *)
83+
(* 0.12 = FIX: comming up the directory structure was broken *)
8384
(* *)
8485
(******************************************************************************)
8586
(* Silk icon set 1.3 used *)
@@ -512,18 +513,34 @@
512513
Idx: Integer;
513514
Begin
514515
If aindex >= Listview.Items.Count Then exit;
515-
If Not assigned(Listview.TopItem) Then exit;
516-
Listview.Items[aIndex].MakeVisible(False);
516+
Listview.BeginUpdate;
517517
Listview.ClearSelection;
518-
Idx := Listview.TopItem.Index + (Listview.VisibleRowCount Div 2);
519-
If aIndex <> Idx Then
520-
Idx := aIndex + (aIndex - Idx);
521-
If (Idx < 0) Then
522-
Idx := 0;
523-
If (Idx >= Listview.Items.Count) Then
524-
Idx := Listview.Items.Count - 1;
525-
Listview.Items[Idx].MakeVisible(False);
526-
Listview.Items[aIndex].Selected := true;
518+
519+
// So hinscrollen, dass man das man den aIndex uberhaupt sehen kann
520+
Listview.Items[aIndex].MakeVisible(False);
521+
522+
// Der Versuch den ausgewählten Eintrag ungefähr "mittig" in der Listview an zu zeigen
523+
If assigned(Listview.TopItem) Then Begin
524+
Idx := Listview.TopItem.Index + (Listview.VisibleRowCount Div 2);
525+
If aIndex <> Idx Then
526+
Idx := aIndex + (aIndex - Idx);
527+
If (Idx < 0) Then
528+
Idx := 0;
529+
If (Idx >= Listview.Items.Count) Then
530+
Idx := Listview.Items.Count - 1;
531+
Listview.Items[Idx].MakeVisible(False);
532+
End;
533+
534+
// Der Versuch den Eintrag auch so zu selektiern dass dieser
535+
// 1. Blau hinterlegt ist
536+
// 2. Wenn der User die Pfeiltasten verwendet von diesem auch weiter "navigiert" wird
537+
Listview.Items[aIndex].Selected := true; // Das macht den Eintrag "blau"
538+
// Den Eintrag tatsächlich auch Anwählen
539+
Listview.ItemIndex := aIndex;
540+
Listview.Selected := Listview.Items[aIndex];
541+
Listview.ItemFocused := Listview.Items[aIndex];
542+
543+
Listview.EndUpdate;
527544
End;
528545

529546
Procedure Nop();
@@ -538,7 +555,7 @@
538555
(*
539556
* Historie : Siehe ganz oben
540557
*)
541-
Caption := 'Copycommander2 ver. 0.11';
558+
Caption := 'Copycommander2 ver. 0.12';
542559
(*
543560
* Mindest Anforderungen:
544561
* - Alle "Todo's" erledigt
@@ -1093,7 +1110,7 @@
10931110
Else Begin
10941111
// Ein Ordner Tiefer
10951112
LoadDir(IncludeTrailingBackslash(aView^.aDirectory) + aListview.Selected.caption, aView^);
1096-
ListViewSelectItemIndex(aListview, 0);
1113+
// ListViewSelectItemIndex(aListview, 0); -- Wird schon durch Load dir gemacht
10971114
aListview.SetFocus;
10981115
End;
10991116
End

0 commit comments

Comments
 (0)