implemented open project after open standard windows

git-svn-id: trunk@6367 -
This commit is contained in:
mattias 2004-12-12 03:54:09 +00:00
parent 770988ec33
commit 4e924ae6a2
8 changed files with 90 additions and 46 deletions

View File

@ -1205,6 +1205,7 @@ var
var IdentContext: TFindContext): boolean;
var
Params: TFindDeclarationParams;
IdentifierNotPublished: Boolean;
begin
Result:=false;
IdentContext:=CleanFindContext;
@ -1215,18 +1216,18 @@ var
Params:=TFindDeclarationParams.Create;
try
Params.Flags:=[fdfSearchInAncestors,fdfExceptionOnNotFound,
fdfExceptionOnPredefinedIdent,fdfIgnoreMissingParams,
fdfIgnoreOverloadedProcs];
fdfExceptionOnPredefinedIdent,fdfIgnoreMissingParams,
fdfIgnoreOverloadedProcs];
Params.ContextNode:=ClassContext.Node;
Params.SetIdentifier(ClassContext.Tool,PChar(IdentName),nil);
try
{DebugLn('FindLFMIdentifier A ',
' Ident=',
'"',GetIdentifier(Params.Identifier),'"',
' Context="',ClassContext.Node.DescAsString,'" "',StringToPascalConst(copy(ClassContext.Tool.Src,ClassContext.Node.StartPos,20)),'"',
' File="',ExtractFilename(ClassContext.Tool.MainFilename)+'"',
' Flags=[',FindDeclarationFlagsAsString(Params.Flags),']'
);}
//DebugLn('FindLFMIdentifier A ',
// ' Ident=',
// '"'+GetIdentifier(Params.Identifier)+'"',
// ' Context="'+ClassContext.Node.DescAsString,'" "',StringToPascalConst(copy(ClassContext.Tool.Src,ClassContext.Node.StartPos,20))+'"',
// ' File="'+ExtractFilename(ClassContext.Tool.MainFilename)+'"',
// ' Flags=['+FindDeclarationFlagsAsString(Params.Flags)+']'
// );
if ClassContext.Tool.FindIdentifierInContext(Params) then begin
IdentContext:=CreateFindContext(Params);
end;
@ -1237,21 +1238,22 @@ var
finally
Params.Free;
end;
if IdentContext.Node<>nil then begin
Result:=true;
IdentifierNotPublished:=false;
if (IdentContext.Node<>nil) then begin
if (IdentContext.Node.Parent<>nil)
and (IdentContext.Node.Parent.Desc<>ctnClassPublished)
then begin
LFMTree.AddError(lfmeIdentifierNotPublished,LFMNode,
'identifier '+IdentName+' is not published',
DefaultErrorPosition);
exit;
end;
end else begin
// no node found
then
IdentifierNotPublished:=true
else
Result:=true;
end;
if (IdentContext.Node=nil) or IdentifierNotPublished then begin
// no proper node found
// -> search in DefineProperties
if SearchAlsoInDefineProperties then begin
//debugln('FindLFMIdentifier A SearchAlsoInDefineProperties=',dbgs(SearchAlsoInDefineProperties));
if FindNonPublishedDefineProperty(LFMNode,DefaultErrorPosition,
IdentName,ClassContext)
then begin
@ -1260,10 +1262,17 @@ var
end;
end;
if (not Result) and ErrorOnNotFound then begin
LFMTree.AddError(lfmeIdentifierNotFound,LFMNode,
'identifier '+IdentName+' not found',
DefaultErrorPosition);
exit;
if (IdentContext.Node<>nil) and IdentifierNotPublished then begin
LFMTree.AddError(lfmeIdentifierNotPublished,LFMNode,
'identifier '+IdentName+' is not published in class '
+'"'+ClassContext.Tool.ExtractClassName(ClassContext.Node,false)+'"',
DefaultErrorPosition);
end else begin
LFMTree.AddError(lfmeIdentifierNotFound,LFMNode,
'identifier '+IdentName+' not found in class '
+'"'+ClassContext.Tool.ExtractClassName(ClassContext.Node,false)+'"',
DefaultErrorPosition);
end;
end;
end;
@ -1301,8 +1310,9 @@ var
Params.Free;
end;
if Result.Node=nil then begin
// FindClassNodeForLFMObject
LFMTree.AddError(lfmeIdentifierNotFound,LFMNode,
'identifier '+GetIdentifier(Identifier)+' not found',
'class '+GetIdentifier(Identifier)+' not found',
DefaultErrorPosition);
exit;
end;

View File

@ -67,11 +67,9 @@ each control that's dropped onto the form
Function FSetProp(PRI : PPropInfo; const Value) : Boolean;
Function FGetProp(PRI : PPropInfo; var Value) : Boolean;
function GetDesigner: TComponentEditorDesigner;
protected
Function GetPPropInfobyIndex(Index : Integer) : PPropInfo;
Function GetPPropInfobyName(Name : ShortString) : PPropInfo;
Function GetPPropInfoByIndex(Index : Integer) : PPropInfo;
Function GetPPropInfoByName(Name : ShortString) : PPropInfo;
public
constructor Create;
constructor Create(AComponent: TComponent);
@ -273,6 +271,8 @@ function CompareComponentAndInterface(Key, Data: Pointer): integer;
function CompareDefPropCacheItems(Item1, Item2: TDefinePropertiesCacheItem): integer;
function ComparePersClassNameAndDefPropCacheItem(Key: Pointer;
Item: TDefinePropertiesCacheItem): integer;
procedure RegisterStandardClasses;
implementation
@ -309,6 +309,11 @@ begin
Result:=CompareText(AnsiString(Key),Item.PersistentClassname);
end;
procedure RegisterStandardClasses;
begin
RegisterClasses([TStrings]);
end;
{ TComponentInterface }
constructor TComponentInterface.Create;
@ -1464,6 +1469,8 @@ var
const APersistentClass: TPersistentClass): boolean;
begin
Result:=false;
if APersistent<>nil then
RaiseGDBException('TCustomFormEditor.FindDefineProperty.CreateTempPersistent Inconsistency');
try
if APersistentClass.InheritsFrom(TComponent) then
APersistent:=TComponentClass(APersistentClass).Create(nil)
@ -1530,11 +1537,16 @@ var
end;
begin
//debugln('TCustomFormEditor.GetDefineProperties ',
// ' APersistentClassName="',APersistentClassName,'"',
// ' AncestorClassName="',AncestorClassName,'"',
// ' Identifier="',Identifier,'"');
IsDefined:=false;
if FDefineProperties=nil then
FDefineProperties:=TAVLTree.Create(TListSortCompare(@CompareDefPropCacheItems));
FDefineProperties:=
TAVLTree.Create(TListSortCompare(@CompareDefPropCacheItems));
ANode:=FDefineProperties.FindKey(PChar(APersistentClassName),
TListSortCompare(@ComparePersClassNameAndDefPropCacheItem));
TListSortCompare(@ComparePersClassNameAndDefPropCacheItem));
if ANode=nil then begin
// cache component class, try to retrieve the define properties
CacheItem:=TDefinePropertiesCacheItem.Create;
@ -1922,7 +1934,7 @@ end;
procedure TDefinePropertiesReader.AddPropertyName(const Name: string);
begin
//debugln('TDefinePropertiesReader.AddPropertyName Name="',Name,'"');
debugln('TDefinePropertiesReader.AddPropertyName Name="',Name,'"');
if FDefinePropertyNames=nil then FDefinePropertyNames:=TStringList.Create;
if FDefinePropertyNames.IndexOf(Name)<=0 then
FDefinePropertyNames.Add(Name);
@ -1955,10 +1967,13 @@ end;
procedure TDefinePropertiesPersistent.PublicDefineProperties(Filer: TFiler);
begin
//debugln('TDefinePropertiesPersistent.PublicDefineProperties A ',ClassName);
debugln('TDefinePropertiesPersistent.PublicDefineProperties A ',ClassName,' ',dbgsName(FTarget));
Target.DefineProperties(Filer);
//debugln('TDefinePropertiesPersistent.PublicDefineProperties END ',ClassName);
debugln('TDefinePropertiesPersistent.PublicDefineProperties END ',ClassName,' ',dbgsName(FTarget));
end;
initialization
RegisterStandardClasses;
end.

View File

@ -73,6 +73,7 @@ begin
MainIDE:=TMainIDE.Create(Application);
MainIDE.CreateOftenUsedForms;
MainIDE.StartIDE;
{$IFDEF IDE_MEM_CHECK}
CheckHeapWrtMemCnt('lazarus.pp: TMainIDE created');
{$ENDIF}
@ -99,6 +100,9 @@ end.
{
$Log$
Revision 1.64 2004/12/12 03:54:08 mattias
implemented open project after open standard windows
Revision 1.63 2004/11/10 15:25:32 mattias
updated memcheck.pas from heaptrc.pp

View File

@ -533,8 +533,9 @@ type
class procedure ParseCmdLineOptions;
constructor Create(TheOwner: TComponent); override;
procedure CreateOftenUsedForms; override;
procedure StartIDE; override;
destructor Destroy; override;
procedure CreateOftenUsedForms; override;
procedure CreateSearchResultWindow;
procedure UpdateDefaultPascalFileExtensions;
@ -987,18 +988,21 @@ begin
HelpBoss.LoadHelpOptions;
UpdateWindowsMenu;
end;
procedure TMainIDE.StartIDE;
begin
// set OnIdle handlers
Application.AddOnUserInputHandler(@OnApplicationUserInput,true);
Application.AddOnIdleHandler(@OnApplicationIdle,true);
Screen.AddHandlerRemoveForm(@OnScreenRemoveForm,true);
SetupHints;
// Now load a project
SetupStartProject;
// reopen extra windows
ReOpenIDEWindows;
// set OnIdle handlers
Application.AddOnUserInputHandler(@OnApplicationUserInput,true);
Application.AddOnIdleHandler(@OnApplicationIdle,true);
Screen.AddHandlerRemoveForm(@OnScreenRemoveForm,true);
SetupHints;
end;
destructor TMainIDE.Destroy;
@ -6757,7 +6761,8 @@ begin
// open messages window
SourceNotebook.ClearErrorLines;
MessagesView.Clear;
if MessagesView<>nil then
MessagesView.Clear;
DoArrangeSourceEditorAndMessageView(false);
// parse the LFM file and the pascal unit
@ -10971,6 +10976,9 @@ end.
{ =============================================================================
$Log$
Revision 1.808 2004/12/12 03:54:08 mattias
implemented open project after open standard windows
Revision 1.807 2004/12/11 01:17:22 mattias
implemented global debugger search path

View File

@ -118,6 +118,7 @@ type
property ToolStatus: TIDEToolStatus read FToolStatus write SetToolStatus;
constructor Create(TheOwner: TComponent); override;
procedure StartIDE; virtual; abstract;
destructor Destroy; override;
procedure CreateOftenUsedForms; virtual; abstract;

View File

@ -264,7 +264,7 @@ type
end;
type
TCustomGrid=class(TCustomControl)
TCustomGrid = class(TCustomControl)
private
FAutoAdvance: TAutoAdvance;
FDefaultDrawing: Boolean;
@ -545,7 +545,7 @@ type
TGetEditEvent = procedure (Sender: TObject; ACol, ARow: Integer; var Value: string) of object;
TSetEditEvent = procedure (Sender: TObject; ACol, ARow: Integer; const Value: string) of object;
TDrawGrid=class(TCustomGrid)
TDrawGrid = class(TCustomGrid)
private
FOnColRowDeleted: TgridOperationEvent;
FOnColRowExchanged: TgridOperationEvent;

View File

@ -42,7 +42,7 @@
------------------------------------------------------------------------------}
constructor TProgressBar.Create (AOwner : TComponent);
begin
inherited Create (AOwner);
inherited Create(AOwner);
fCompStyle := csProgressBar;
FPosition := 0;
FStep := 10;
@ -302,6 +302,9 @@ end;
{
$Log$
Revision 1.11 2004/12/12 03:54:09 mattias
implemented open project after open standard windows
Revision 1.10 2004/09/23 14:50:47 micha
convert LM_SETPROPERTIES message to interface method for TProgressBar

View File

@ -313,7 +313,7 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure PopUp(X, Y : Integer);
procedure PopUp(X, Y: Integer);
property PopupComponent: TComponent read FPopupComponent
write FPopupComponent;
property PopupPoint: TPoint read FPopupPoint;
@ -403,6 +403,9 @@ end.
{
$Log$
Revision 1.76 2004/12/12 03:54:09 mattias
implemented open project after open standard windows
Revision 1.75 2004/12/10 21:36:27 mattias
implemented TMenuItem.SetVisible