IDE: todolist: moved implem uses section to intf uses section to avoid circles, replaced AnsiCompareText with CompareFilenames

git-svn-id: trunk@13012 -
This commit is contained in:
mattias 2007-11-24 21:35:20 +00:00
parent dd735a4378
commit dadd700bea
4 changed files with 44 additions and 49 deletions

View File

@ -9,37 +9,37 @@ object TodoDialog: TTodoDialog
Caption = 'Insert Todo'
ClientHeight = 248
ClientWidth = 483
OnShow = FormShow
OnCreate = FormCreate
object TodoLabel: TLabel
Left = 8
Height = 14
Height = 20
Top = 8
Width = 27
Width = 30
Caption = 'Text:'
FocusControl = TodoMemo
ParentColor = False
end
object PriorityLabel: TLabel
Left = 10
Height = 14
Height = 20
Top = 167
Width = 35
Width = 45
Caption = 'Priority'
ParentColor = False
end
object OwnerLabel: TLabel
Left = 56
Height = 14
Height = 20
Top = 168
Width = 33
Width = 41
Caption = 'Owner'
ParentColor = False
end
object CategoryLabel: TLabel
Left = 248
Height = 14
Height = 20
Top = 168
Width = 46
Width = 59
Caption = 'Category'
ParentColor = False
end

View File

@ -4,23 +4,23 @@ LazarusResources.Add('TTodoDialog','FORMDATA',[
'TPF0'#11'TTodoDialog'#10'TodoDialog'#4'Left'#3'V'#1#6'Height'#3#248#0#3'Top'
+#3#202#0#5'Width'#3#227#1#18'HorzScrollBar.Page'#3#226#1#18'VertScrollBar.Pa'
+'ge'#3#247#0#13'ActiveControl'#7#8'OkButton'#7'Caption'#6#11'Insert Todo'#12
+'ClientHeight'#3#248#0#11'ClientWidth'#3#227#1#6'OnShow'#7#8'FormShow'#0#6'T'
+'Label'#9'TodoLabel'#4'Left'#2#8#6'Height'#2#14#3'Top'#2#8#5'Width'#2#27#7'C'
+'aption'#6#5'Text:'#12'FocusControl'#7#8'TodoMemo'#11'ParentColor'#8#0#0#6'T'
+'Label'#13'PriorityLabel'#4'Left'#2#10#6'Height'#2#14#3'Top'#3#167#0#5'Width'
+#2'#'#7'Caption'#6#8'Priority'#11'ParentColor'#8#0#0#6'TLabel'#10'OwnerLabel'
+#4'Left'#2'8'#6'Height'#2#14#3'Top'#3#168#0#5'Width'#2'!'#7'Caption'#6#5'Own'
+'er'#11'ParentColor'#8#0#0#6'TLabel'#13'CategoryLabel'#4'Left'#3#248#0#6'Hei'
+'ght'#2#14#3'Top'#3#168#0#5'Width'#2'.'#7'Caption'#6#8'Category'#11'ParentCo'
+'lor'#8#0#0#7'TButton'#8'OkButton'#4'Left'#3'8'#1#6'Height'#2#25#3'Top'#3#216
+#0#5'Width'#2'K'#7'Caption'#6#2'Ok'#11'ModalResult'#2#1#8'TabOrder'#2#1#0#0#7
+'TButton'#12'CancelButton'#4'Left'#3#141#1#6'Height'#2#25#3'Top'#3#216#0#5'W'
+'idth'#2'K'#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#2#0#0#5
+'TMemo'#8'TodoMemo'#4'Left'#2#8#6'Height'#3#136#0#3'Top'#2#24#5'Width'#3#208
+#1#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#0#0#5'TEdit'#12'PriorityE'
+'dit'#4'Left'#2#8#6'Height'#2#23#3'Top'#3#181#0#5'Width'#2'&'#10'OnKeyPress'
+#7#20'PriorityEditKeyPress'#8'TabOrder'#2#3#0#0#5'TEdit'#9'OwnerEdit'#4'Left'
+#2'8'#6'Height'#2#23#3'Top'#3#181#0#5'Width'#3#182#0#8'TabOrder'#2#4#0#0#5'T'
+'Edit'#12'CategoryEdit'#4'Left'#3#248#0#6'Height'#2#23#3'Top'#3#181#0#5'Widt'
+'h'#3#224#0#8'TabOrder'#2#5#0#0#0
+'ClientHeight'#3#248#0#11'ClientWidth'#3#227#1#8'OnCreate'#7#10'FormCreate'#0
+#6'TLabel'#9'TodoLabel'#4'Left'#2#8#6'Height'#2#20#3'Top'#2#8#5'Width'#2#30#7
+'Caption'#6#5'Text:'#12'FocusControl'#7#8'TodoMemo'#11'ParentColor'#8#0#0#6
+'TLabel'#13'PriorityLabel'#4'Left'#2#10#6'Height'#2#20#3'Top'#3#167#0#5'Widt'
+'h'#2'-'#7'Caption'#6#8'Priority'#11'ParentColor'#8#0#0#6'TLabel'#10'OwnerLa'
+'bel'#4'Left'#2'8'#6'Height'#2#20#3'Top'#3#168#0#5'Width'#2')'#7'Caption'#6#5
+'Owner'#11'ParentColor'#8#0#0#6'TLabel'#13'CategoryLabel'#4'Left'#3#248#0#6
+'Height'#2#20#3'Top'#3#168#0#5'Width'#2';'#7'Caption'#6#8'Category'#11'Paren'
+'tColor'#8#0#0#7'TButton'#8'OkButton'#4'Left'#3'8'#1#6'Height'#2#25#3'Top'#3
+#216#0#5'Width'#2'K'#7'Caption'#6#2'Ok'#11'ModalResult'#2#1#8'TabOrder'#2#1#0
+#0#7'TButton'#12'CancelButton'#4'Left'#3#141#1#6'Height'#2#25#3'Top'#3#216#0
+#5'Width'#2'K'#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#2#0#0
+#5'TMemo'#8'TodoMemo'#4'Left'#2#8#6'Height'#3#136#0#3'Top'#2#24#5'Width'#3
+#208#1#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#0#0#5'TEdit'#12'Prior'
+'ityEdit'#4'Left'#2#8#6'Height'#2#23#3'Top'#3#181#0#5'Width'#2'&'#10'OnKeyPr'
+'ess'#7#20'PriorityEditKeyPress'#8'TabOrder'#2#3#0#0#5'TEdit'#9'OwnerEdit'#4
+'Left'#2'8'#6'Height'#2#23#3'Top'#3#181#0#5'Width'#3#182#0#8'TabOrder'#2#4#0
+#0#5'TEdit'#12'CategoryEdit'#4'Left'#3#248#0#6'Height'#2#23#3'Top'#3#181#0#5
+'Width'#3#224#0#8'TabOrder'#2#5#0#0#0
]);

View File

@ -46,7 +46,7 @@ type
CancelButton: TButton;
TodoLabel: TLabel;
TodoMemo: TMemo;
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure PriorityEditKeyPress(Sender: TObject; var Key: char);
private
{ private declarations }
@ -54,14 +54,11 @@ type
{ public declarations }
end;
Function ExecuteTodoDialog: TTodoItem;
Function ExecuteTodoDialog: TTodoItem;
implementation
{ TTodoDialog }
{ TTodoDialog }
procedure TTodoDialog.PriorityEditKeyPress(Sender: TObject; var Key: char);
@ -70,9 +67,9 @@ begin
Key := #0;
end;
procedure TTodoDialog.FormShow(Sender: TObject);
procedure TTodoDialog.FormCreate(Sender: TObject);
begin
TodoMemo.SetFocus;
ActiveControl:=TodoMemo;
end;
function ExecuteTodoDialog: TTodoItem;
@ -94,7 +91,7 @@ begin
if TryStrToInt(aTodoDialog.PriorityEdit.Text, aPriority) then
Result.Priority := aPriority;
end;
aTodoDialog.Release;
aTodoDialog.Free;
end;
initialization

View File

@ -62,10 +62,12 @@ unit TodoList;
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, LResources,
ExtCtrls, ComCtrls, Menus, Buttons, GraphType,
StdCtrls, mPasLex, LCLIntf, LCLType,
CodeCache, CodeToolManager, LazarusIDEStrConsts, ActnList;
Classes, SysUtils, LCLProc, Forms, Controls, Graphics, Dialogs, LResources,
StrUtils, ExtCtrls, ComCtrls, Menus, Buttons, GraphType, ActnList,
StdCtrls, mPasLex, LCLIntf, LCLType, FileUtil,
CodeCache, CodeToolManager, LazarusIDEStrConsts,
Project;
Const
cTodoFlag = '#todo';
@ -79,6 +81,7 @@ type
{ TTodoItem: Class to hold TODO item information }
TTodoItem = Class(TObject)
private
FAltNotation: boolean;
@ -153,11 +156,6 @@ var
implementation
uses
Project,
StrUtils,
FileUtil;
{ TfrmTodo }
constructor TfrmTodo.Create(AOwner: TComponent);
@ -179,7 +177,7 @@ end;
procedure TfrmTodo.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if Key=VK_ESCAPE then
Close;
ModalResult:=mrCancel;
end;
procedure TfrmTodo.lvTodoClick(Sender: TObject);
@ -397,8 +395,8 @@ begin
try
for i:=0 to UsedInterfaceFilenames.Count-1 do
begin
if AnsiCompareStr(ExtractFileName(UsedInterfaceFileNames[i]),
CurFileName) = 0 then
if CompareFilenames(ExtractFileName(UsedInterfaceFileNames[i]),
CurFileName) = 0 then
begin
CurFileName:= UsedInterFaceFileNames[i];
Found:= true;
@ -409,7 +407,7 @@ begin
begin
for i:=0 to UsedImplementationFilenames.Count-1 do
begin
if AnsiCompareStr(ExtractFileName
if CompareFilenames(ExtractFileName
(UsedImplementationFilenames[i]), CurFileName) = 0 then
begin
CurFileName:= UsedImplementationFilenames[i];