Skip to content

Commit b8b38ef

Browse files
ADD: Start with review feature
1 parent 5f58cad commit b8b38ef

File tree

16 files changed

+1227
-335
lines changed

16 files changed

+1227
-335
lines changed

src/FPC_Understand.lpi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
<FormatVersion Value="2"/>
2828
</RunParams>
2929
<RequiredPackages>
30+
<Item>
31+
<PackageName Value="SynEditDsgn"/>
32+
</Item>
33+
<Item>
34+
<PackageName Value="SynEdit"/>
35+
</Item>
3036
<Item>
3137
<PackageName Value="TAChartLazarusPkg"/>
3238
</Item>
@@ -179,6 +185,14 @@
179185
<ResourceBaseClass Value="Form"/>
180186
<UnitName Value="Unit12"/>
181187
</Unit>
188+
<Unit>
189+
<Filename Value="unit13.pas"/>
190+
<IsPartOfProject Value="True"/>
191+
<ComponentName Value="Form13"/>
192+
<HasResources Value="True"/>
193+
<ResourceBaseClass Value="Form"/>
194+
<UnitName Value="Unit13"/>
195+
</Unit>
182196
</Units>
183197
</ProjectOptions>
184198
<CompilerOptions>

src/FPC_Understand.lpr

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{$ENDIF}
2626
Interfaces, // this includes the LCL widgetset
2727
Forms, tachartlazaruspkg, Unit1, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7,
28-
Unit8, Unit9, Unit10, Unit11, Unit12;
28+
Unit8, Unit9, Unit10, Unit11, Unit12, unit13;
2929

3030
{$R *.res}
3131

@@ -45,6 +45,7 @@
4545
Application.CreateForm(TForm10, Form10);
4646
Application.CreateForm(TForm11, Form11);
4747
Application.CreateForm(TForm12, Form12);
48+
Application.CreateForm(TForm13, Form13);
4849
Application.Run;
4950
End.
5051

src/unit1.lfm

Lines changed: 52 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
object Form1: TForm1
22
Left = 324
3-
Height = 497
3+
Height = 994
44
Top = 107
5-
Width = 760
5+
Width = 1520
66
AllowDropFiles = True
77
Caption = 'Form1'
8-
ClientHeight = 497
9-
ClientWidth = 760
8+
ClientHeight = 994
9+
ClientWidth = 1520
10+
DesignTimePPI = 192
1011
Menu = MainMenu1
1112
Position = poScreenCenter
1213
LCLVersion = '3.99.0.0'
@@ -17,61 +18,61 @@ object Form1: TForm1
1718
OnMouseWheelUp = FormMouseWheelUp
1819
OnResize = FormResize
1920
object ScrollBar1: TScrollBar
20-
Left = 8
21-
Height = 14
22-
Top = 480
23-
Width = 728
21+
Left = 16
22+
Height = 28
23+
Top = 960
24+
Width = 1456
2425
Anchors = [akLeft, akRight, akBottom]
2526
PageSize = 0
2627
TabOrder = 0
2728
OnChange = ScrollBar1Change
2829
end
2930
object ScrollBar2: TScrollBar
30-
Left = 744
31-
Height = 464
32-
Top = 8
33-
Width = 14
31+
Left = 1488
32+
Height = 928
33+
Top = 16
34+
Width = 28
3435
Anchors = [akTop, akRight, akBottom]
3536
Kind = sbVertical
3637
PageSize = 0
3738
TabOrder = 1
3839
OnChange = ScrollBar2Change
3940
end
4041
object Label1: TLabel
41-
Left = 304
42-
Height = 15
43-
Top = 160
44-
Width = 122
42+
Left = 608
43+
Height = 32
44+
Top = 320
45+
Width = 248
4546
Caption = 'Nothing loaded, please'
4647
end
4748
object Button1: TButton
48-
Left = 312
49-
Height = 25
50-
Top = 224
51-
Width = 137
49+
Left = 624
50+
Height = 50
51+
Top = 448
52+
Width = 274
5253
Caption = 'click to import *.lpi'
5354
TabOrder = 2
5455
OnClick = Button1Click
5556
end
5657
object Button2: TButton
57-
Left = 312
58-
Height = 25
59-
Top = 184
60-
Width = 137
58+
Left = 624
59+
Height = 50
60+
Top = 368
61+
Width = 274
6162
Caption = 'load a FPU project'
6263
TabOrder = 3
6364
OnClick = Button2Click
6465
end
6566
object Label2: TLabel
66-
Left = 368
67-
Height = 15
68-
Top = 208
69-
Width = 11
67+
Left = 736
68+
Height = 32
69+
Top = 416
70+
Width = 22
7071
Caption = 'or'
7172
end
7273
object MainMenu1: TMainMenu
73-
Left = 40
74-
Top = 16
74+
Left = 80
75+
Top = 32
7576
object MenuItem1: TMenuItem
7677
Caption = 'File'
7778
object MenuItem2: TMenuItem
@@ -189,24 +190,24 @@ object Form1: TForm1
189190
end
190191
object IniPropStorage1: TIniPropStorage
191192
StoredValues = <>
192-
Left = 144
193-
Top = 16
193+
Left = 288
194+
Top = 32
194195
end
195196
object OpenDialog1: TOpenDialog
196197
DefaultExt = '.fpu'
197198
Filter = 'FPC-Understand file|*.fpu|All|*.*'
198-
Left = 240
199-
Top = 16
199+
Left = 480
200+
Top = 32
200201
end
201202
object SaveDialog1: TSaveDialog
202203
DefaultExt = '.fpu'
203204
Filter = 'FPC-Understand file|*.fpu|All|*.*'
204-
Left = 312
205-
Top = 16
205+
Left = 624
206+
Top = 32
206207
end
207208
object PopupMenu1: TPopupMenu
208-
Left = 40
209-
Top = 88
209+
Left = 80
210+
Top = 176
210211
object MenuItem9: TMenuItem
211212
Caption = 'Center out of range nodes'
212213
OnClick = MenuItem9Click
@@ -295,8 +296,15 @@ object Form1: TForm1
295296
end
296297
end
297298
object PopupMenu2: TPopupMenu
298-
Left = 40
299-
Top = 160
299+
Left = 80
300+
Top = 320
301+
object MenuItem52: TMenuItem
302+
Caption = 'Open Code'
303+
OnClick = MenuItem52Click
304+
end
305+
object Separator2: TMenuItem
306+
Caption = '-'
307+
end
300308
object MenuItem26: TMenuItem
301309
Caption = 'Show statistic'
302310
OnClick = MenuItem13Click
@@ -324,13 +332,13 @@ object Form1: TForm1
324332
object OpenDialog2: TOpenDialog
325333
DefaultExt = '.pas;.pp;.lpr'
326334
Filter = 'Pascal File|*.pas; *.pp; *.lpr|All|*.*'
327-
Left = 240
328-
Top = 88
335+
Left = 480
336+
Top = 176
329337
end
330338
object SaveDialog2: TSaveDialog
331339
DefaultExt = '.png'
332340
Filter = 'Portable network graphic|*.png|All|*.*'
333-
Left = 40
334-
Top = 224
341+
Left = 80
342+
Top = 448
335343
end
336344
end

src/unit1.pas

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(******************************************************************************)
22
(* FPC Understand 30.03.2023 *)
33
(* *)
4-
(* Version : 0.24 *)
4+
(* Version : 0.25 *)
55
(* *)
66
(* Author : Uwe Schächterle (Corpsman) *)
77
(* *)
@@ -63,9 +63,13 @@
6363
(* 0.23 - Reorder MainMenu *)
6464
(* 0.24 - FIX: graphical glitches in chart statistics *)
6565
(* ADD: more infos to chart statistics *)
66+
(* 0.25 - ADD: Code preview *)
6667
(* *)
6768
(* Known Bugs : - if a project holds 2 units with the same name *)
6869
(* the dependency graph will merge them to one *)
70+
(* - if a file contains a .inc file that is included, all "Line"*)
71+
(* informations, after that .inc file are offsetted by the *)
72+
(* length of the .inc files content *)
6973
(* *)
7074
(* Missing : - Callgraphen (über Klassen, über Echte Methoden, *)
7175
(* über Units ..) *)
@@ -81,7 +85,7 @@
8185
StdCtrls, ugraphs, ufpc_understand, ufpcparser, LvlGraphCtrl, Types;
8286

8387
Const
84-
Version = '0.24';
88+
Version = '0.25';
8589
ScrollDelta = 25;
8690

8791
Type
@@ -143,6 +147,7 @@
143147
MenuItem5: TMenuItem;
144148
MenuItem50: TMenuItem;
145149
MenuItem51: TMenuItem;
150+
MenuItem52: TMenuItem;
146151
MenuItem6: TMenuItem;
147152
MenuItem7: TMenuItem;
148153
MenuItem8: TMenuItem;
@@ -156,6 +161,7 @@
156161
ScrollBar1: TScrollBar;
157162
ScrollBar2: TScrollBar;
158163
Separator1: TMenuItem;
164+
Separator2: TMenuItem;
159165
Separator3: TMenuItem;
160166
Separator4: TMenuItem;
161167
Separator5: TMenuItem;
@@ -202,6 +208,7 @@
202208
Procedure MenuItem48Click(Sender: TObject);
203209
Procedure MenuItem4Click(Sender: TObject);
204210
Procedure MenuItem51Click(Sender: TObject);
211+
Procedure MenuItem52Click(Sender: TObject);
205212
Procedure MenuItem5Click(Sender: TObject);
206213
Procedure MenuItem6Click(Sender: TObject);
207214
Procedure MenuItem8Click(Sender: TObject);
@@ -253,6 +260,7 @@
253260
// , unit10 // Select Node form
254261
, Unit11 // Chart Statistics
255262
// , Unit12 // AddSearchpath
263+
, unit13 // Code Window
256264
;
257265

258266
Const
@@ -424,7 +432,7 @@
424432
Procedure TForm1.MenuItem13Click(Sender: TObject);
425433
Begin
426434
// Show Statistiks
427-
If form4.CountFiles(GetSelectedFileList(), fProject.CCColors) Then Begin
435+
If form4.CountFiles(GetSelectedFileList(), fProject.CCColors, fProject.RootFolder) Then Begin
428436
form4.ShowModal;
429437
End
430438
Else Begin
@@ -435,7 +443,7 @@
435443
Procedure TForm1.MenuItem14Click(Sender: TObject);
436444
Begin
437445
// Show Classes
438-
If form3.LoadClasses(GetSelectedFileList()) Then Begin
446+
If form3.LoadClasses(GetSelectedFileList(), fProject.RootFolder) Then Begin
439447
form3.ShowModal;
440448
End
441449
Else Begin
@@ -585,7 +593,7 @@
585593
Procedure TForm1.MenuItem25Click(Sender: TObject);
586594
Begin
587595
// Show CC
588-
If form5.LoadFunctions(GetSelectedFileList(), fProject.CCColors) Then Begin
596+
If form5.LoadFunctions(GetSelectedFileList(), fProject.CCColors, fProject.RootFolder) Then Begin
589597
form5.ShowModal;
590598
End
591599
Else Begin
@@ -938,6 +946,17 @@
938946
Button1Click(Nil);
939947
End;
940948

949+
Procedure TForm1.MenuItem52Click(Sender: TObject);
950+
Var
951+
list: TProjectFilesInfo;
952+
Begin
953+
// Open Code
954+
list := GetSelectedFileList();
955+
If length(list) > 0 Then Begin
956+
form13.OpenFile(fProject.RootFolder, list[0].Filename);
957+
End;
958+
End;
959+
941960
Procedure TForm1.MenuItem5Click(Sender: TObject);
942961
Begin
943962
// Save Project As

0 commit comments

Comments
 (0)