- todo list widget ready
This commit is contained in:
Basile Burg 2015-09-01 16:48:11 +02:00
parent d1c255d44b
commit fa9b575103
4 changed files with 22 additions and 16 deletions

View File

@ -31,6 +31,7 @@ type
procedure saveToFile(const aFilename: string);
function getIfModified: boolean;
//
function getIfIsSource(const aFilename: string): boolean;
function getOutputFilename: string;
//
function getConfigurationCount: integer;
@ -138,23 +139,32 @@ begin
exit(fModified);
end;
function TCEDubProject.getIfIsSource(const aFilename: string): boolean;
begin
//TODO-cDUB: implement
exit(false);
end;
function TCEDubProject.getOutputFilename: string;
begin
//TODO-cDUB: implement
exit('');
end;
function TCEDubProject.getConfigurationCount: integer;
begin
//TODO-cDUB: implement
exit(0);
end;
procedure TCEDubProject.setActiveConfiguration(index: integer);
begin
//TODO-cDUB: implement
end;
function TCEDubProject.getConfigurationName(index: integer): string;
begin
//TODO-cDUB: implement
exit('');
end;

View File

@ -51,6 +51,8 @@ type
//function moduleImportCount: integer;
//function moduleImport(index: integer): string;
// returns true if aFilename is a project source
function getIfIsSource(const aFilename: string): boolean;
// returns the name of the file produced when a project is compiled
function getOutputFilename: string;

View File

@ -74,7 +74,7 @@ type
procedure endUpdate;
procedure reset;
procedure addDefaults;
function isProjectSource(const aFilename: string): boolean;
function getIfIsSource(const aFilename: string): boolean;
function getAbsoluteSourceName(aIndex: integer): string;
function getAbsoluteFilename(const aFilename: string): string;
procedure addSource(const aFilename: string);
@ -395,7 +395,7 @@ begin
end;
end;
function TCENativeProject.isProjectSource(const aFilename: string): boolean;
function TCENativeProject.getIfIsSource(const aFilename: string): boolean;
var
i: Integer;
begin

View File

@ -81,7 +81,7 @@ type
private
fAutoRefresh: Boolean;
fSingleClick: Boolean;
fProj: TCENativeProject;
fProj: ICECommonProject;
fDoc: TCESynMemo;
fToolProc: TCEProcess;
fTodos: TTodoItems;
@ -336,15 +336,12 @@ end;
{$REGION ICEProjectObserver ----------------------------------------------------}
procedure TCETodoListWidget.projNew(aProject: ICECommonProject);
begin
fProj := nil;
if aProject.getFormat <> pfNative then
exit;
fProj := TCENativeProject(aProject.getProject);
fProj := aProject;
end;
procedure TCETodoListWidget.projChanged(aProject: ICECommonProject);
begin
if fProj <> aProject.getProject then
if fProj <> aProject then
exit;
if Visible and fAutoRefresh then
callToolProcess;
@ -352,7 +349,7 @@ end;
procedure TCETodoListWidget.projClosing(aProject: ICECommonProject);
begin
if fProj <> aProject.getProject then
if fProj <> aProject then
exit;
fProj := nil;
if Visible and fAutoRefresh then
@ -361,12 +358,9 @@ end;
procedure TCETodoListWidget.projFocused(aProject: ICECommonProject);
begin
if aProject.getProject = fProj then
if aProject = fProj then
exit;
fProj := nil;
if aProject.getFormat <> pfNative then
exit;
fProj := TCENativeProject(aProject.getProject);
fProj := aProject;
if Visible and fAutoRefresh then
callToolProcess;
end;
@ -386,7 +380,7 @@ begin
if ((fProj <> nil) and (fDoc = nil)) then
exit(tcProject);
//
if fProj.isProjectSource(fDoc.fileName) then
if fProj.getIfIsSource(fDoc.fileName) then
exit(tcProject)
else
exit(tcFile);