mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 04:39:41 +01:00 
			
		
		
		
	IDE: docking: restore: keep autosizing disabled during restore
git-svn-id: trunk@46859 -
This commit is contained in:
		
							parent
							
								
									960141597a
								
							
						
					
					
						commit
						1021bbb19a
					
				@ -40,6 +40,8 @@ unit CodeBrowser;
 | 
			
		||||
 | 
			
		||||
{$mode objfpc}{$H+}
 | 
			
		||||
 | 
			
		||||
{off $DEFINE VerboseCodeBrowser}
 | 
			
		||||
 | 
			
		||||
interface
 | 
			
		||||
 | 
			
		||||
uses
 | 
			
		||||
@ -87,6 +89,7 @@ const
 | 
			
		||||
  CodeBrowserIDEName     = ' '+'Lazarus IDE';// Note: space is needed to avoid name clashing
 | 
			
		||||
  CodeBrowserProjectName = ' '+'Project';
 | 
			
		||||
  CodeBrowserHidden = ' ';
 | 
			
		||||
  CodeBrowserMaxTVIdentifiers = 5000; // the maximum amount of identifiers shown in the treeview
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
 | 
			
		||||
@ -386,7 +389,7 @@ var
 | 
			
		||||
function StringToCodeBrowserTextFilter(const s: string): TCodeBrowserTextFilter;
 | 
			
		||||
 | 
			
		||||
procedure InitCodeBrowserQuickFixItems;
 | 
			
		||||
procedure CreateCodeBrowser;
 | 
			
		||||
procedure CreateCodeBrowser(DisableAutoSizing: boolean);
 | 
			
		||||
procedure ShowCodeBrowser(const Identifier: string);
 | 
			
		||||
 | 
			
		||||
implementation
 | 
			
		||||
@ -433,18 +436,20 @@ begin
 | 
			
		||||
  RegisterIDEMsgQuickFix(TQuickFixIdentifierNotFound_Search.Create);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure CreateCodeBrowser;
 | 
			
		||||
procedure CreateCodeBrowser(DisableAutoSizing: boolean);
 | 
			
		||||
begin
 | 
			
		||||
  if CodeBrowserView=nil then
 | 
			
		||||
    CodeBrowserView:=TCodeBrowserView.Create(LazarusIDE.OwningComponent);
 | 
			
		||||
    IDEWindowCreators.CreateForm(CodeBrowserView,TCodeBrowserView,
 | 
			
		||||
      DisableAutoSizing,LazarusIDE.OwningComponent)
 | 
			
		||||
  else if DisableAutoSizing then
 | 
			
		||||
    CodeBrowserView.DisableAutoSizing;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure ShowCodeBrowser(const Identifier: string);
 | 
			
		||||
begin
 | 
			
		||||
  CreateCodeBrowser;
 | 
			
		||||
  IDEWindowCreators.ShowForm(NonModalIDEWindowNames[nmiwCodeBrowser],true);
 | 
			
		||||
  CodeBrowserView.SetScopeToCurUnitOwner(true,true);
 | 
			
		||||
  CodeBrowserView.SetFilterToSimpleIdentifier(Identifier);
 | 
			
		||||
  IDEWindowCreators.ShowForm(CodeBrowserView,true);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1876,26 +1881,47 @@ const
 | 
			
		||||
var
 | 
			
		||||
  Inheritance: String;
 | 
			
		||||
begin
 | 
			
		||||
  if CTNode.StartPos>=CTNode.EndPos then begin
 | 
			
		||||
    Identifier:='';
 | 
			
		||||
    Description:='';
 | 
			
		||||
    exit;
 | 
			
		||||
  end;
 | 
			
		||||
  case CTNode.Desc of
 | 
			
		||||
  ctnProcedure:
 | 
			
		||||
    begin
 | 
			
		||||
      {$IFDEF CodeBrowseFix}
 | 
			
		||||
      Identifier:=Tool.ExtractProcName(CTNode,ProcIdentifierFlags);
 | 
			
		||||
      Description:=Identifier;
 | 
			
		||||
      {$ELSE}
 | 
			
		||||
      Identifier:=Tool.ExtractProcHead(CTNode,ProcIdentifierFlags);
 | 
			
		||||
      Description:=Tool.ExtractProcHead(CTNode,ProcDescFlags);
 | 
			
		||||
      {$ENDIF}
 | 
			
		||||
    end;
 | 
			
		||||
  ctnVarDefinition:
 | 
			
		||||
    begin
 | 
			
		||||
      Identifier:=Tool.ExtractDefinitionName(CTNode);
 | 
			
		||||
      {$IFDEF CodeBrowseFix}
 | 
			
		||||
      Description:=Identifier;
 | 
			
		||||
      {$ELSE}
 | 
			
		||||
      Description:='var '+Identifier
 | 
			
		||||
                 +' : '+Shorten(Tool.ExtractDefinitionNodeType(CTNode));
 | 
			
		||||
      {$ENDIF}
 | 
			
		||||
    end;
 | 
			
		||||
  ctnConstDefinition:
 | 
			
		||||
    begin
 | 
			
		||||
      Identifier:=Tool.ExtractDefinitionName(CTNode);
 | 
			
		||||
      {$IFDEF CodeBrowseFix}
 | 
			
		||||
      Description:=Identifier;
 | 
			
		||||
      {$ELSE}
 | 
			
		||||
      Description:='const '+Shorten(Tool.ExtractNode(CTNode,NodeFlags));
 | 
			
		||||
      {$ENDIF}
 | 
			
		||||
    end;
 | 
			
		||||
  ctnTypeDefinition,ctnGenericType:
 | 
			
		||||
    begin
 | 
			
		||||
      Identifier:=Tool.ExtractDefinitionName(CTNode);
 | 
			
		||||
      {$IFDEF CodeBrowseFix}
 | 
			
		||||
      Description:=Identifier;
 | 
			
		||||
      {$ELSE}
 | 
			
		||||
      Description:='type '+Identifier;
 | 
			
		||||
      if CTNode.FirstChild<>nil then begin
 | 
			
		||||
        case CTNode.FirstChild.Desc of
 | 
			
		||||
@ -1927,11 +1953,16 @@ begin
 | 
			
		||||
          Description:=Description+' = record';
 | 
			
		||||
        end;
 | 
			
		||||
      end;
 | 
			
		||||
      {$ENDIF}
 | 
			
		||||
    end;
 | 
			
		||||
  ctnProperty:
 | 
			
		||||
    begin
 | 
			
		||||
      Identifier:=Tool.ExtractPropName(CTNode,false);
 | 
			
		||||
      {$IFDEF CodeBrowseFix}
 | 
			
		||||
      Description:=Identifier;
 | 
			
		||||
      {$ELSE}
 | 
			
		||||
      Description:='property '+Shorten(Tool.ExtractProperty(CTNode,PropDescFlags));
 | 
			
		||||
      {$ENDIF}
 | 
			
		||||
    end;
 | 
			
		||||
  ctnEnumIdentifier:
 | 
			
		||||
    begin
 | 
			
		||||
@ -1951,11 +1982,18 @@ var
 | 
			
		||||
  ShowEmptyNodes: boolean;
 | 
			
		||||
  NewPackageCount: integer;
 | 
			
		||||
  NewUnitCount: integer;
 | 
			
		||||
  NewIdentifierCount: PtrInt;
 | 
			
		||||
  NewIdentifierCount, ShownIdentifierCount: PtrInt;
 | 
			
		||||
  UsedMem: PtrUInt;
 | 
			
		||||
  
 | 
			
		||||
  LevelFilterText: array[TCodeBrowserLevel] of string;
 | 
			
		||||
  LevelFilterType: array[TCodeBrowserLevel] of TCodeBrowserTextFilter;
 | 
			
		||||
 | 
			
		||||
  function IncUsedMem(c: integer): boolean;
 | 
			
		||||
  begin
 | 
			
		||||
    Result:=(UsedMem div 16384)<>((UsedMem+c) div 16384);
 | 
			
		||||
    inc(UsedMem,c);
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
  function IdentifierFitsFilter(LvlType: TCodeBrowserLevel;
 | 
			
		||||
    const Identifier: string): boolean;
 | 
			
		||||
  begin
 | 
			
		||||
@ -1987,6 +2025,8 @@ var
 | 
			
		||||
      NewCodePos: TCodePosition;
 | 
			
		||||
    begin
 | 
			
		||||
      //DebugLn(['AddChildNode ',ChildCTNode.DescAsString,' ',ChildDescription]);
 | 
			
		||||
      if ShownIdentifierCount>=CodeBrowserMaxTVIdentifiers then exit;
 | 
			
		||||
 | 
			
		||||
      if (CTNode.Parent.Desc=ctnClassPrivate) and (not ShowPrivate) then
 | 
			
		||||
        exit;
 | 
			
		||||
      if (CTNode.Parent.Desc=ctnClassProtected) and (not ShowProtected)
 | 
			
		||||
@ -1995,11 +2035,18 @@ var
 | 
			
		||||
      GetNodeDescription(CTTool,CTNode,ChildDescription,ChildIdentifier);
 | 
			
		||||
 | 
			
		||||
      if IdentifierFitsFilter(cblIdentifiers,ChildIdentifier) then begin
 | 
			
		||||
        inc(ShownIdentifierCount);
 | 
			
		||||
        NewChildNode:=ParentBrowserNode.AddNode(ChildDescription,ChildIdentifier);
 | 
			
		||||
        if NewChildNode<>nil then begin
 | 
			
		||||
          NewChildNode.Desc:=CTNode.Desc;
 | 
			
		||||
          CTTool.CleanPosToCodePos(CTNode.StartPos,NewCodePos);
 | 
			
		||||
          NewChildNode.CodePos:=NewCodePos;
 | 
			
		||||
          {$IFDEF VerboseCodeBrowser}
 | 
			
		||||
          if (length(ChildDescription)>1000) then
 | 
			
		||||
            debugln(['AddChildNode WARNING: big description ',SrcUnit.Filename,' desc=',ChildDescription]);
 | 
			
		||||
          if IncUsedMem(NewChildNode.GetMemSize) then
 | 
			
		||||
            debugln(['AddChildNode used mem ',UsedMem]);
 | 
			
		||||
          {$ENDIF}
 | 
			
		||||
        end;
 | 
			
		||||
      end;
 | 
			
		||||
    end;
 | 
			
		||||
@ -2019,6 +2066,12 @@ var
 | 
			
		||||
      //DebugLn(['AddIdentifierNode ',CTNode.DescAsString,' Description="',Description,'"']);
 | 
			
		||||
      GetNodeDescription(CTTool,CTNode,Description,Identifier);
 | 
			
		||||
      NewNode:=CurUnit.AddNode(Description,Identifier);
 | 
			
		||||
      {$IFDEF VerboseCodeBrowser}
 | 
			
		||||
      if (length(Description)>1000) then
 | 
			
		||||
        debugln(['AddIdentifierNode WARNING: big description ',CurUnit.Filename,' desc=',Description]);
 | 
			
		||||
      if IncUsedMem(NewNode.GetMemSize) then
 | 
			
		||||
        debugln(['AddIdentifierNode used mem ',UsedMem,' ',CurUnit.Filename]);
 | 
			
		||||
      {$ENDIF}
 | 
			
		||||
      NewNode.Desc:=CTNode.Desc;
 | 
			
		||||
      CTTool.CleanPosToCodePos(CTNode.StartPos,NewCodePos);
 | 
			
		||||
      NewNode.CodePos:=NewCodePos;
 | 
			
		||||
@ -2047,6 +2100,7 @@ var
 | 
			
		||||
      if (NewNode.ChildNodes=nil)
 | 
			
		||||
      and (not IdentifierFitsFilter(cblIdentifiers,Identifier)) then begin
 | 
			
		||||
        // identifier is not needed -> remove
 | 
			
		||||
        // ToDo: remove nodes later
 | 
			
		||||
        CurUnit.DeleteNode(NewNode);
 | 
			
		||||
      end;
 | 
			
		||||
    end;
 | 
			
		||||
@ -2304,6 +2358,7 @@ var
 | 
			
		||||
  lvl: TCodeBrowserLevel;
 | 
			
		||||
  i: Integer;
 | 
			
		||||
begin
 | 
			
		||||
  UsedMem:=0;
 | 
			
		||||
  ShowPackages:=Options.HasLevel(cblPackages);
 | 
			
		||||
  ShowUnits:=Options.HasLevel(cblUnits);
 | 
			
		||||
  ShowIdentifiers:=Options.HasLevel(cblIdentifiers);
 | 
			
		||||
@ -2313,6 +2368,7 @@ begin
 | 
			
		||||
  NewPackageCount:=0;
 | 
			
		||||
  NewUnitCount:=0;
 | 
			
		||||
  NewIdentifierCount:=0;
 | 
			
		||||
  ShownIdentifierCount:=0;
 | 
			
		||||
 | 
			
		||||
  for lvl:=Low(TCodeBrowserLevel) to High(TCodeBrowserLevel) do begin
 | 
			
		||||
    LevelFilterText[lvl]:=Options.LevelFilterText[lvl];
 | 
			
		||||
@ -2523,7 +2579,13 @@ begin
 | 
			
		||||
    case CTNode.Desc of
 | 
			
		||||
    ctnProcedure:
 | 
			
		||||
      begin
 | 
			
		||||
        if SysUtils.CompareText(Tool.ExtractProcHead(CTNode,ProcIdentifierFlags),
 | 
			
		||||
        if SysUtils.CompareText(
 | 
			
		||||
          {$IFDEF CodeBrowseFix}
 | 
			
		||||
          Tool.ExtractProcName(CTNode,ProcIdentifierFlags)
 | 
			
		||||
          {$ELSE}
 | 
			
		||||
          Tool.ExtractProcHead(CTNode,ProcIdentifierFlags)
 | 
			
		||||
          {$ENDIF}
 | 
			
		||||
          ,
 | 
			
		||||
          Node.Identifier)<>0
 | 
			
		||||
        then
 | 
			
		||||
          exit; // source has changed
 | 
			
		||||
@ -3254,10 +3316,7 @@ begin
 | 
			
		||||
  then exit;
 | 
			
		||||
 | 
			
		||||
  // start code browser
 | 
			
		||||
  CreateCodeBrowser;
 | 
			
		||||
  CodeBrowserView.SetScopeToCurUnitOwner(true,true);
 | 
			
		||||
  CodeBrowserView.SetFilterToSimpleIdentifier(Identifier);
 | 
			
		||||
  IDEWindowCreators.ShowForm(CodeBrowserView,true);
 | 
			
		||||
  ShowCodeBrowser(Identifier);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
end.
 | 
			
		||||
 | 
			
		||||
@ -51,7 +51,7 @@ uses
 | 
			
		||||
  IDEWindowIntf, IDEImagesIntf, IDEDialogs,
 | 
			
		||||
  LazarusIDEStrConsts, CodeToolsOptions, CodeToolsDefPreview, TransferMacros,
 | 
			
		||||
  EditorOptions, InputFileDialog, IDEOptionDefs, LazConf, IDEProcs,
 | 
			
		||||
  EditDefineTree;
 | 
			
		||||
  EditDefineTree, CompilerOptions;
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
 | 
			
		||||
@ -573,7 +573,7 @@ begin
 | 
			
		||||
  with InputFileDlg do begin
 | 
			
		||||
  
 | 
			
		||||
    DefaultFPCSrcDir:='$(FPCSrcDir)';
 | 
			
		||||
    DefaultCompiler:='$(CompPath)';
 | 
			
		||||
    DefaultCompiler:=DefaultCompilerPath;
 | 
			
		||||
 | 
			
		||||
    BeginUpdate;
 | 
			
		||||
    Caption:=lisCodeToolsDefsCreateFPCMacrosAndPathsForAFPCProjectDirectory;
 | 
			
		||||
@ -646,7 +646,7 @@ begin
 | 
			
		||||
  InputFileDlg:=GetInputFileDialog;
 | 
			
		||||
  InputFileDlg.Macros:=Macros;
 | 
			
		||||
  with InputFileDlg do begin
 | 
			
		||||
    DefaultCompiler:='$(CompPath)';
 | 
			
		||||
    DefaultCompiler:=DefaultCompilerPath;
 | 
			
		||||
    
 | 
			
		||||
    BeginUpdate;
 | 
			
		||||
    Caption:=lisCodeToolsDefsCreateDefinesForFreePascalCompiler;
 | 
			
		||||
@ -690,7 +690,7 @@ begin
 | 
			
		||||
  InputFileDlg:=GetInputFileDialog;
 | 
			
		||||
  InputFileDlg.Macros:=Macros;
 | 
			
		||||
  with InputFileDlg do begin
 | 
			
		||||
    DefaultCompiler:='$(CompPath)';
 | 
			
		||||
    DefaultCompiler:=DefaultCompilerPath;
 | 
			
		||||
 | 
			
		||||
    BeginUpdate;
 | 
			
		||||
    Caption:=lisCodeToolsDefsCreateDefinesForFreePascalSVNSources;
 | 
			
		||||
 | 
			
		||||
@ -43,8 +43,8 @@ uses
 | 
			
		||||
  {$IFDEF CustomIDEComps}
 | 
			
		||||
  CustomIDEComps,
 | 
			
		||||
  {$ENDIF}
 | 
			
		||||
  LazarusIDEStrConsts, ComponentReg, ExtendedTabControls, DesignerProcs, PackageDefs,
 | 
			
		||||
  EnvironmentOpts;
 | 
			
		||||
  LazarusIDEStrConsts, ComponentReg, IDEWindowIntf, ExtendedTabControls,
 | 
			
		||||
  DesignerProcs, PackageDefs, EnvironmentOpts;
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
  TComponentSelectionMode = (
 | 
			
		||||
@ -214,7 +214,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TComponentPalette.ComponentListClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  MainIDE.DoShowComponentList(true);
 | 
			
		||||
  MainIDE.DoShowComponentList;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TComponentPalette.PalettePopupMenuPopup(Sender: TObject);
 | 
			
		||||
 | 
			
		||||
@ -69,17 +69,21 @@ type
 | 
			
		||||
var
 | 
			
		||||
  EditorFileManagerForm: TEditorFileManagerForm;
 | 
			
		||||
 | 
			
		||||
procedure ShowEditorFileManagerForm(BringToFront: boolean);
 | 
			
		||||
procedure ShowEditorFileManagerForm(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
 | 
			
		||||
implementation
 | 
			
		||||
 | 
			
		||||
{$R *.lfm}
 | 
			
		||||
 | 
			
		||||
procedure ShowEditorFileManagerForm(BringToFront: boolean);
 | 
			
		||||
procedure ShowEditorFileManagerForm(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if EditorFileManagerForm = Nil then
 | 
			
		||||
    Application.CreateForm(TEditorFileManagerForm, EditorFileManagerForm);
 | 
			
		||||
  IDEWindowCreators.ShowForm(EditorFileManagerForm,BringToFront);
 | 
			
		||||
    IDEWindowCreators.CreateForm(EditorFileManagerForm,TEditorFileManagerForm,
 | 
			
		||||
       State=iwgfDisabled,LazarusIDE.OwningComponent)
 | 
			
		||||
  else if State=iwgfDisabled then
 | 
			
		||||
    EditorFileManagerForm.DisableAlign;
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(EditorFileManagerForm,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
{ TEditorFileManagerForm }
 | 
			
		||||
 | 
			
		||||
@ -292,7 +292,7 @@ var
 | 
			
		||||
  SearchPageIndex: TTabSheet;
 | 
			
		||||
begin
 | 
			
		||||
  Result:=mrCancel;
 | 
			
		||||
  LazarusIDE.DoShowSearchResultsView(false);
 | 
			
		||||
  LazarusIDE.DoShowSearchResultsView(iwgfShow);
 | 
			
		||||
  SearchPageIndex:=nil;
 | 
			
		||||
  try
 | 
			
		||||
    // show result
 | 
			
		||||
 | 
			
		||||
@ -219,7 +219,7 @@ type
 | 
			
		||||
var
 | 
			
		||||
  FPDocEditor: TFPDocEditor = nil;
 | 
			
		||||
 | 
			
		||||
procedure DoShowFPDocEditor(Show, BringToFront: boolean);
 | 
			
		||||
procedure DoShowFPDocEditor(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
 | 
			
		||||
implementation
 | 
			
		||||
 | 
			
		||||
@ -228,15 +228,16 @@ implementation
 | 
			
		||||
 | 
			
		||||
{ TFPDocEditor }
 | 
			
		||||
 | 
			
		||||
procedure DoShowFPDocEditor(Show, BringToFront: boolean);
 | 
			
		||||
procedure DoShowFPDocEditor(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if FPDocEditor = Nil then
 | 
			
		||||
    Application.CreateForm(TFPDocEditor, FPDocEditor);
 | 
			
		||||
    IDEWindowCreators.CreateForm(FPDocEditor,TFPDocEditor,
 | 
			
		||||
       State=iwgfDisabled,LazarusIDE.OwningComponent)
 | 
			
		||||
  else if State=iwgfDisabled then
 | 
			
		||||
    FPDocEditor.DisableAutoSizing;
 | 
			
		||||
 | 
			
		||||
  if Show then
 | 
			
		||||
  begin
 | 
			
		||||
    IDEWindowCreators.ShowForm(FPDocEditor,BringToFront);
 | 
			
		||||
  end;
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(FPDocEditor,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TFPDocEditor.GetFirstElement: TDOMNode;
 | 
			
		||||
 | 
			
		||||
@ -214,7 +214,7 @@ begin
 | 
			
		||||
  with cobCompiler do begin
 | 
			
		||||
    Items.BeginUpdate;
 | 
			
		||||
    Items.Assign(EnvironmentOptions.CompilerFileHistory);
 | 
			
		||||
    AddFilenameToList(Items,'$(CompPath)');
 | 
			
		||||
    AddFilenameToList(Items,DefaultCompilerPath);
 | 
			
		||||
    SetComboBoxText(cobCompiler,Options.CompilerPath,cstFilename);
 | 
			
		||||
    Items.EndUpdate;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
@ -5867,6 +5867,8 @@ resourcestring
 | 
			
		||||
  lisNewPage = 'New page';
 | 
			
		||||
  lisPageName = 'Page name';
 | 
			
		||||
  lis_All_ = '<All>';
 | 
			
		||||
  lisJumpToProcedure = 'Jump to procedure %s';
 | 
			
		||||
  lisFindDeclarationOf = 'Find Declaration of %s';
 | 
			
		||||
implementation
 | 
			
		||||
 | 
			
		||||
end.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										262
									
								
								ide/main.pp
									
									
									
									
									
								
							
							
						
						
									
										262
									
								
								ide/main.pp
									
									
									
									
									
								
							@ -482,7 +482,7 @@ type
 | 
			
		||||
    procedure OnSrcNoteBookCloseQuery(Sender: TObject; var CloseAction: TCloseAction);
 | 
			
		||||
 | 
			
		||||
    // ObjectInspector + PropertyEditorHook events
 | 
			
		||||
    procedure CreateObjectInspector; override;
 | 
			
		||||
    procedure CreateObjectInspector(aDisableAutoSize: boolean);
 | 
			
		||||
    procedure OIOnSelectPersistents(Sender: TObject);
 | 
			
		||||
    procedure OIOnShowOptions(Sender: TObject);
 | 
			
		||||
    procedure OIOnViewRestricted(Sender: TObject);
 | 
			
		||||
@ -748,14 +748,13 @@ type
 | 
			
		||||
    procedure DoExecuteRemoteControl;
 | 
			
		||||
    function DoViewUnitsAndForms(OnlyForms: boolean): TModalResult;
 | 
			
		||||
    function DoSelectFrame: TComponentClass;
 | 
			
		||||
    procedure DoViewUnitDependencies(Show: boolean);
 | 
			
		||||
    procedure DoViewJumpHistory(Show: boolean);
 | 
			
		||||
    procedure DoViewUnitInfo;
 | 
			
		||||
    procedure DoShowCodeExplorer(Show: boolean);
 | 
			
		||||
    procedure DoShowCodeBrowser(Show: boolean);
 | 
			
		||||
    procedure DoShowRestrictionBrowser(Show: boolean; const RestrictedName: String = '');
 | 
			
		||||
    procedure DoShowComponentList(Show: boolean); override;
 | 
			
		||||
    procedure DoShowInspector(Show: boolean);
 | 
			
		||||
    procedure DoShowCodeExplorer(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
    procedure DoShowCodeBrowser(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
    procedure DoShowRestrictionBrowser(const RestrictedName: String = ''; State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
    procedure DoShowComponentList(State: TIWGetFormState = iwgfShowOnTop); override;
 | 
			
		||||
    procedure DoShowJumpHistory(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
    procedure DoShowInspector(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
    procedure CreateIDEWindow(Sender: TObject; aFormName: string;
 | 
			
		||||
                          var AForm: TCustomForm; DoDisableAutoSizing: boolean);
 | 
			
		||||
    function CreateNewUniqueFilename(const Prefix, Ext: string;
 | 
			
		||||
@ -774,7 +773,7 @@ type
 | 
			
		||||
                               Flags: TOpenFlags): TModalResult; override;
 | 
			
		||||
    function DoPublishProject(Flags: TSaveFlags;
 | 
			
		||||
                              ShowDialog: boolean): TModalResult; override;
 | 
			
		||||
    procedure DoShowProjectInspector(Show: boolean); override;
 | 
			
		||||
    procedure DoShowProjectInspector(State: TIWGetFormState = iwgfShowOnTop); override;
 | 
			
		||||
    function DoAddActiveUnitToProject: TModalResult;
 | 
			
		||||
    function DoRemoveFromProjectDialog: TModalResult;
 | 
			
		||||
    function DoWarnAmbiguousFiles: TModalResult;
 | 
			
		||||
@ -913,7 +912,7 @@ type
 | 
			
		||||
 | 
			
		||||
    // search results
 | 
			
		||||
    function DoJumpToSearchResult(FocusEditor: boolean): boolean;
 | 
			
		||||
    procedure DoShowSearchResultsView(Show: boolean; BringToFront: boolean = False); override;
 | 
			
		||||
    procedure DoShowSearchResultsView(State: TIWGetFormState = iwgfShowOnTop); override;
 | 
			
		||||
 | 
			
		||||
    // form editor and designer
 | 
			
		||||
    procedure DoBringToFrontFormOrUnit;
 | 
			
		||||
@ -927,8 +926,8 @@ type
 | 
			
		||||
    procedure InvalidateAllDesignerForms;
 | 
			
		||||
    procedure UpdateIDEComponentPalette;
 | 
			
		||||
    procedure ShowDesignerForm(AForm: TCustomForm);
 | 
			
		||||
    procedure DoViewAnchorEditor(Show: boolean);
 | 
			
		||||
    procedure DoViewTabOrderEditor(Show: boolean);
 | 
			
		||||
    procedure DoViewAnchorEditor(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
    procedure DoViewTabOrderEditor(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
    procedure DoToggleViewComponentPalette;
 | 
			
		||||
    procedure DoToggleViewIDESpeedButtons;
 | 
			
		||||
 | 
			
		||||
@ -1694,16 +1693,16 @@ begin
 | 
			
		||||
  if ObjectInspector1.GetActivePropertyRow = nil then
 | 
			
		||||
  begin
 | 
			
		||||
    if C <> nil then
 | 
			
		||||
      DoShowRestrictionBrowser(true,C.ClassName)
 | 
			
		||||
      DoShowRestrictionBrowser(C.ClassName)
 | 
			
		||||
    else
 | 
			
		||||
      DoShowRestrictionBrowser(true);
 | 
			
		||||
      DoShowRestrictionBrowser;
 | 
			
		||||
  end
 | 
			
		||||
  else
 | 
			
		||||
  begin
 | 
			
		||||
    if C <> nil then
 | 
			
		||||
      DoShowRestrictionBrowser(true,C.ClassName + '.' + ObjectInspector1.GetActivePropertyRow.Name)
 | 
			
		||||
      DoShowRestrictionBrowser(C.ClassName + '.' + ObjectInspector1.GetActivePropertyRow.Name)
 | 
			
		||||
    else
 | 
			
		||||
      DoShowRestrictionBrowser(true);
 | 
			
		||||
      DoShowRestrictionBrowser;
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
@ -2838,12 +2837,12 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewAnchorEditorClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoViewAnchorEditor(true);
 | 
			
		||||
  DoViewAnchorEditor;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewTabOrderClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoViewTabOrderEditor(true);
 | 
			
		||||
  DoViewTabOrderEditor;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewComponentPaletteClicked(Sender: TObject);
 | 
			
		||||
@ -3309,14 +3308,14 @@ begin
 | 
			
		||||
  ecExtractProc:              DoExtractProcFromSelection;
 | 
			
		||||
  // user used shortcut/menu item to show the window, so focusing is ok.
 | 
			
		||||
  ecToggleMessages:           DoShowMessagesView;
 | 
			
		||||
  ecToggleCodeExpl:           DoShowCodeExplorer(true);
 | 
			
		||||
  ecToggleCodeBrowser:        DoShowCodeBrowser(true);
 | 
			
		||||
  ecToggleRestrictionBrowser: DoShowRestrictionBrowser(true);
 | 
			
		||||
  ecViewComponents:           DoShowComponentList(true);
 | 
			
		||||
  ecToggleFPDocEditor:        DoShowFPDocEditor(true,true);
 | 
			
		||||
  ecToggleCodeExpl:           DoShowCodeExplorer;
 | 
			
		||||
  ecToggleCodeBrowser:        DoShowCodeBrowser;
 | 
			
		||||
  ecToggleRestrictionBrowser: DoShowRestrictionBrowser;
 | 
			
		||||
  ecViewComponents:           DoShowComponentList;
 | 
			
		||||
  ecToggleFPDocEditor:        DoShowFPDocEditor;
 | 
			
		||||
  ecViewProjectUnits:         DoViewUnitsAndForms(false);
 | 
			
		||||
  ecViewProjectForms:         DoViewUnitsAndForms(true);
 | 
			
		||||
  ecProjectInspector:         DoShowProjectInspector(true);
 | 
			
		||||
  ecProjectInspector:         DoShowProjectInspector;
 | 
			
		||||
  ecConfigCustomComps:        PkgBoss.ShowConfigureCustomComponents;
 | 
			
		||||
  ecExtToolFirst..ecExtToolLast: DoRunExternalTool(Command-ecExtToolFirst,false);
 | 
			
		||||
  ecSyntaxCheck:              DoCheckSyntax;
 | 
			
		||||
@ -3702,20 +3701,26 @@ begin
 | 
			
		||||
  LCLIntf.ShowWindow(AForm.Handle,SW_SHOWNORMAL);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoViewAnchorEditor(Show: boolean);
 | 
			
		||||
procedure TMainIDE.DoViewAnchorEditor(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if AnchorDesigner=nil then
 | 
			
		||||
    AnchorDesigner:=TAnchorDesigner.Create(OwningComponent);
 | 
			
		||||
  if Show then
 | 
			
		||||
    IDEWindowCreators.ShowForm(AnchorDesigner,true);
 | 
			
		||||
    IDEWindowCreators.CreateForm(AnchorDesigner,TAnchorDesigner,
 | 
			
		||||
       State=iwgfDisabled,LazarusIDE.OwningComponent)
 | 
			
		||||
  else if State=iwgfDisabled then
 | 
			
		||||
    AnchorDesigner.DisableAlign;
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(AnchorDesigner,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoViewTabOrderEditor(Show: boolean);
 | 
			
		||||
procedure TMainIDE.DoViewTabOrderEditor(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if TabOrderDialog=nil then
 | 
			
		||||
    TabOrderDialog:=TTabOrderDialog.Create(OwningComponent);
 | 
			
		||||
  if Show then
 | 
			
		||||
    IDEWindowCreators.ShowForm(TabOrderDialog,true);
 | 
			
		||||
    IDEWindowCreators.CreateForm(TabOrderDialog,TTabOrderDialog,
 | 
			
		||||
       State=iwgfDisabled,LazarusIDE.OwningComponent)
 | 
			
		||||
  else if State=iwgfDisabled then
 | 
			
		||||
    TabOrderDialog.DisableAlign;
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(TabOrderDialog,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoToggleViewComponentPalette;
 | 
			
		||||
@ -4017,29 +4022,29 @@ Begin
 | 
			
		||||
  DoViewUnitsAndForms(true);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuSourceUnitDependenciesClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoViewUnitDependencies(true);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuSourceUnitInfoClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoViewUnitInfo;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuSourceUnitDependenciesClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  ShowUnitDependenciesClicked(Sender);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewCodeExplorerClick(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoShowCodeExplorer(true);
 | 
			
		||||
  DoShowCodeExplorer;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewCodeBrowserClick(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoShowCodeBrowser(true);
 | 
			
		||||
  DoShowCodeBrowser;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewComponentsClick(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoShowComponentList(true);
 | 
			
		||||
  DoShowComponentList;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewMacroListClick(Sender: TObject);
 | 
			
		||||
@ -4049,7 +4054,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewRestrictionBrowserClick(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoShowRestrictionBrowser(true);
 | 
			
		||||
  DoShowRestrictionBrowser;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewMessagesClick(Sender: TObject);
 | 
			
		||||
@ -4060,8 +4065,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewSearchResultsClick(Sender: TObject);
 | 
			
		||||
Begin
 | 
			
		||||
  // show and bring to front
 | 
			
		||||
  DoShowSearchResultsView(true, true);
 | 
			
		||||
  DoShowSearchResultsView;
 | 
			
		||||
End;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuNewProjectClicked(Sender: TObject);
 | 
			
		||||
@ -4139,7 +4143,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuProjectInspectorClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoShowProjectInspector(true);
 | 
			
		||||
  DoShowProjectInspector;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuAddToProjectClicked(Sender: TObject);
 | 
			
		||||
@ -4433,7 +4437,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuViewFPDocEditorClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoShowFPDocEditor(true,true);
 | 
			
		||||
  DoShowFPDocEditor;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuToolConvertDFMtoLFMClicked(Sender: TObject);
 | 
			
		||||
@ -5093,7 +5097,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.mnuWindowManagerClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  ShowEditorFileManagerForm(true);
 | 
			
		||||
  ShowEditorFileManagerForm;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.SaveEnvironment(Immediately: boolean);
 | 
			
		||||
@ -5705,16 +5709,6 @@ begin
 | 
			
		||||
  Result := mrOk;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoViewUnitDependencies(Show: boolean);
 | 
			
		||||
begin
 | 
			
		||||
  ShowUnitDependencies(true,Show);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoViewJumpHistory(Show: boolean);
 | 
			
		||||
begin
 | 
			
		||||
  IDEWindowCreators.ShowForm(NonModalIDEWindowNames[nmiwJumpHistory],Show);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoViewUnitInfo;
 | 
			
		||||
var ActiveSrcEdit:TSourceEditor;
 | 
			
		||||
  ActiveUnitInfo:TUnitInfo;
 | 
			
		||||
@ -5794,56 +5788,75 @@ begin
 | 
			
		||||
    DoGotoIncludeDirective;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowCodeExplorer(Show: boolean);
 | 
			
		||||
procedure TMainIDE.DoShowCodeExplorer(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if CodeExplorerView=nil then 
 | 
			
		||||
  if CodeExplorerView=nil then
 | 
			
		||||
  begin
 | 
			
		||||
    CodeExplorerView:=TCodeExplorerView.Create(OwningComponent);
 | 
			
		||||
    IDEWindowCreators.CreateForm(CodeExplorerView,TCodeExplorerView,
 | 
			
		||||
       State=iwgfDisabled,OwningComponent);
 | 
			
		||||
    CodeExplorerView.OnGetDirectivesTree:=@OnCodeExplorerGetDirectivesTree;
 | 
			
		||||
    CodeExplorerView.OnJumpToCode:=@OnCodeExplorerJumpToCode;
 | 
			
		||||
    CodeExplorerView.OnShowOptions:=@OnCodeExplorerShowOptions;
 | 
			
		||||
  end;
 | 
			
		||||
  end else if State=iwgfDisabled then
 | 
			
		||||
    CodeExplorerView.DisableAutoSizing;
 | 
			
		||||
 | 
			
		||||
  if Show then
 | 
			
		||||
  begin
 | 
			
		||||
    IDEWindowCreators.ShowForm(CodeExplorerView,true);
 | 
			
		||||
  if State>=iwgfShow then begin
 | 
			
		||||
    IDEWindowCreators.ShowForm(CodeExplorerView,State=iwgfShowOnTop);
 | 
			
		||||
    CodeExplorerView.Refresh(true);
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowCodeBrowser(Show: boolean);
 | 
			
		||||
procedure TMainIDE.DoShowCodeBrowser(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  CreateCodeBrowser;
 | 
			
		||||
  if Show then
 | 
			
		||||
    IDEWindowCreators.ShowForm(CodeBrowserView,true);
 | 
			
		||||
  CreateCodeBrowser(State=iwgfDisabled);
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(CodeBrowserView,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowRestrictionBrowser(Show: boolean; const RestrictedName: String);
 | 
			
		||||
procedure TMainIDE.DoShowRestrictionBrowser(const RestrictedName: String;
 | 
			
		||||
  State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if RestrictionBrowserView = nil then
 | 
			
		||||
    RestrictionBrowserView := TRestrictionBrowserView.Create(OwningComponent);
 | 
			
		||||
    IDEWindowCreators.CreateForm(RestrictionBrowserView,TRestrictionBrowserView,
 | 
			
		||||
      State=iwgfDisabled,OwningComponent)
 | 
			
		||||
  else if State=iwgfDisabled then
 | 
			
		||||
    RestrictionBrowserView.DisableAutoSizing;
 | 
			
		||||
 | 
			
		||||
  RestrictionBrowserView.SetIssueName(RestrictedName);
 | 
			
		||||
  if Show then
 | 
			
		||||
    IDEWindowCreators.ShowForm(RestrictionBrowserView,true);
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(RestrictionBrowserView,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowComponentList(Show: boolean);
 | 
			
		||||
procedure TMainIDE.DoShowComponentList(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if ComponentListForm = nil then
 | 
			
		||||
  begin
 | 
			
		||||
    ComponentListForm := TComponentListForm.Create(OwningComponent);
 | 
			
		||||
    IDEWindowCreators.CreateForm(ComponentListForm,TComponentListForm,
 | 
			
		||||
       State=iwgfDisabled,OwningComponent);
 | 
			
		||||
    ComponentListForm.Name:=NonModalIDEWindowNames[nmiwComponentList];
 | 
			
		||||
  end;
 | 
			
		||||
  if Show then
 | 
			
		||||
    IDEWindowCreators.ShowForm(ComponentListForm,true);
 | 
			
		||||
  end else if State=iwgfDisabled then
 | 
			
		||||
    ComponentListForm.DisableAutoSizing;
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(ComponentListForm,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowInspector(Show: boolean);
 | 
			
		||||
procedure TMainIDE.DoShowJumpHistory(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  CreateObjectInspector;
 | 
			
		||||
  if Show then begin
 | 
			
		||||
    IDEWindowCreators.ShowForm(ObjectInspector1,true);
 | 
			
		||||
  if JumpHistoryViewWin=nil then begin
 | 
			
		||||
    IDEWindowCreators.CreateForm(JumpHistoryViewWin,TJumpHistoryViewWin,
 | 
			
		||||
      State=iwgfDisabled,OwningComponent);
 | 
			
		||||
    JumpHistoryViewWin.OnSelectionChanged := @JumpHistoryViewSelectionChanged;
 | 
			
		||||
  end else if State=iwgfDisabled then
 | 
			
		||||
    JumpHistoryViewWin.DisableAutoSizing;
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(JumpHistoryViewWin,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowInspector(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  CreateObjectInspector(State=iwgfDisabled);
 | 
			
		||||
  if State>=iwgfShow then begin
 | 
			
		||||
    IDEWindowCreators.ShowForm(ObjectInspector1,State=iwgfShowOnTop);
 | 
			
		||||
    if ObjectInspector1.IsVisible then
 | 
			
		||||
    begin
 | 
			
		||||
      ObjectInspector1.FocusGrid;
 | 
			
		||||
@ -5866,82 +5879,81 @@ procedure TMainIDE.CreateIDEWindow(Sender: TObject; aFormName: string; var
 | 
			
		||||
    Result:=SysUtils.CompareText(copy(aFormName,1,length(Prefix)),Prefix)=0;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
var
 | 
			
		||||
  State: TIWGetFormState;
 | 
			
		||||
begin
 | 
			
		||||
  if DoDisableAutoSizing then
 | 
			
		||||
    State:=iwgfDisabled
 | 
			
		||||
  else
 | 
			
		||||
    State:=iwgfEnabled;
 | 
			
		||||
  if ItIs(NonModalIDEWindowNames[nmiwMessagesViewName]) then
 | 
			
		||||
    AForm:=MessagesView
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwUnitDependenciesName]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoViewUnitDependencies(false);
 | 
			
		||||
    ShowUnitDependencies(State);
 | 
			
		||||
    AForm:=UnitDependenciesWindow;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwCodeExplorerName]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowCodeExplorer(false);
 | 
			
		||||
    DoShowCodeExplorer(State);
 | 
			
		||||
    AForm:=CodeExplorerView;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwFPDocEditorName]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowFPDocEditor(false,false);
 | 
			
		||||
    DoShowFPDocEditor(State);
 | 
			
		||||
    AForm:=FPDocEditor;
 | 
			
		||||
  end
 | 
			
		||||
  // ToDo: nmiwClipbrdHistoryName:
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwProjectInspector]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowProjectInspector(false);
 | 
			
		||||
    DoShowProjectInspector(State);
 | 
			
		||||
    AForm:=ProjInspector;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwSearchResultsViewName]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowSearchResultsView(false);
 | 
			
		||||
    DoShowSearchResultsView(State);
 | 
			
		||||
    AForm:=SearchResultsView;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwAnchorEditor]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoViewAnchorEditor(false);
 | 
			
		||||
    DoViewAnchorEditor(State);
 | 
			
		||||
    AForm:=AnchorDesigner;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwTabOrderEditor]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoViewTabOrderEditor(false);
 | 
			
		||||
    DoViewTabOrderEditor(State);
 | 
			
		||||
    AForm:=TabOrderDialog;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwCodeBrowser]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowCodeBrowser(false);
 | 
			
		||||
    DoShowCodeBrowser(State);
 | 
			
		||||
    AForm:=CodeBrowserView;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwIssueBrowser]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowRestrictionBrowser(false);
 | 
			
		||||
    DoShowRestrictionBrowser('',State);
 | 
			
		||||
    AForm:=RestrictionBrowserView;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwJumpHistory]) then
 | 
			
		||||
  begin
 | 
			
		||||
    IDEWindowCreators.CreateForm(JumpHistoryViewWin,TJumpHistoryViewWin,
 | 
			
		||||
      DoDisableAutoSizing,OwningComponent);
 | 
			
		||||
    with JumpHistoryViewWin do begin
 | 
			
		||||
      OnSelectionChanged := @JumpHistoryViewSelectionChanged;
 | 
			
		||||
    end;
 | 
			
		||||
    DoShowJumpHistory(State);
 | 
			
		||||
    AForm:=JumpHistoryViewWin;
 | 
			
		||||
    exit;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwComponentList]) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowComponentList(false);
 | 
			
		||||
    DoShowComponentList(State);
 | 
			
		||||
    AForm:=ComponentListForm;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(NonModalIDEWindowNames[nmiwEditorFileManager]) then
 | 
			
		||||
  begin
 | 
			
		||||
    ShowEditorFileManagerForm(false);
 | 
			
		||||
    ShowEditorFileManagerForm(State);
 | 
			
		||||
    AForm:=EditorFileManagerForm;
 | 
			
		||||
  end
 | 
			
		||||
  else if ItIs(DefaultObjectInspectorName) then
 | 
			
		||||
  begin
 | 
			
		||||
    DoShowInspector(false);
 | 
			
		||||
    DoShowInspector(State);
 | 
			
		||||
    AForm:=ObjectInspector1;
 | 
			
		||||
  end;
 | 
			
		||||
  if (AForm<>nil) and DoDisableAutoSizing then
 | 
			
		||||
    AForm.DisableAutoSizing;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TMainIDE.CreateNewUniqueFilename(const Prefix, Ext: string;
 | 
			
		||||
@ -6275,10 +6287,11 @@ begin
 | 
			
		||||
    Project1.ProjectDirectory, MainBuildBoss.GetProjectPublishDir);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowProjectInspector(Show: boolean);
 | 
			
		||||
procedure TMainIDE.DoShowProjectInspector(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if ProjInspector=nil then begin
 | 
			
		||||
    ProjInspector:=TProjectInspectorForm.Create(OwningComponent);
 | 
			
		||||
    IDEWindowCreators.CreateForm(ProjInspector,TProjectInspectorForm,
 | 
			
		||||
       State=iwgfDisabled,LazarusIDE.OwningComponent);
 | 
			
		||||
    ProjInspector.OnShowOptions:=@mnuProjectOptionsClicked;
 | 
			
		||||
    ProjInspector.OnAddUnitToProject:=@ProjInspectorAddUnitToProject;
 | 
			
		||||
    ProjInspector.OnAddDependency:=@PkgBoss.OnProjectInspectorAddDependency;
 | 
			
		||||
@ -6290,9 +6303,11 @@ begin
 | 
			
		||||
    ProjInspector.OnCopyMoveFiles:=@PkgBoss.OnProjectInspectorCopyMoveFiles;
 | 
			
		||||
 | 
			
		||||
    ProjInspector.LazProject:=Project1;
 | 
			
		||||
  end;
 | 
			
		||||
  if Show then
 | 
			
		||||
    IDEWindowCreators.ShowForm(ProjInspector,true);
 | 
			
		||||
  end else if STate=iwgfDisabled then
 | 
			
		||||
    ProjInspector.DisableAlign;
 | 
			
		||||
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(ProjInspector,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TMainIDE.DoAddActiveUnitToProject: TModalResult;
 | 
			
		||||
@ -7998,7 +8013,7 @@ end;
 | 
			
		||||
procedure TMainIDE.DoBringToFrontFormOrInspector(ForceInspector: boolean);
 | 
			
		||||
begin
 | 
			
		||||
  if ForceInspector then begin
 | 
			
		||||
    DoShowInspector(true);
 | 
			
		||||
    DoShowInspector(iwgfShowOnTop);
 | 
			
		||||
    exit;
 | 
			
		||||
  end;
 | 
			
		||||
  {$IFDEF VerboseIDEDisplayState}
 | 
			
		||||
@ -8008,7 +8023,7 @@ begin
 | 
			
		||||
  dsInspector: DoShowDesignerFormOfCurrentSrc;
 | 
			
		||||
  dsInspector2: DoShowSourceOfActiveDesignerForm;
 | 
			
		||||
  else
 | 
			
		||||
    DoShowInspector(true);
 | 
			
		||||
    DoShowInspector(iwgfShowOnTop);
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
@ -8283,15 +8298,16 @@ begin
 | 
			
		||||
  IDEWindowCreators.ShowForm(MessagesView,BringToFront);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.DoShowSearchResultsView(Show: boolean; BringToFront: boolean = False);
 | 
			
		||||
procedure TMainIDE.DoShowSearchResultsView(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if SearchresultsView=Nil then begin
 | 
			
		||||
    SearchresultsView:=TSearchResultsView.Create(OwningComponent);
 | 
			
		||||
    IDEWindowCreators.CreateForm(SearchresultsView,TSearchResultsView,
 | 
			
		||||
       State=iwgfDisabled,LazarusIDE.OwningComponent);
 | 
			
		||||
    SearchresultsView.OnSelectionChanged := OnSearchResultsViewSelectionChanged;
 | 
			
		||||
  end;
 | 
			
		||||
  if Show then begin
 | 
			
		||||
    IDEWindowCreators.ShowForm(SearchresultsView,BringToFront);
 | 
			
		||||
  end;
 | 
			
		||||
  end else if State=iwgfDisabled then
 | 
			
		||||
    SearchResultsView.DisableAutoSizing;
 | 
			
		||||
  if State>=iwgfShow then
 | 
			
		||||
    IDEWindowCreators.ShowForm(SearchresultsView,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
function TMainIDE.GetTestBuildDirectory: string;
 | 
			
		||||
@ -9548,7 +9564,7 @@ begin
 | 
			
		||||
      exit;
 | 
			
		||||
    end;
 | 
			
		||||
 | 
			
		||||
    LazarusIDE.DoShowSearchResultsView(false);
 | 
			
		||||
    LazarusIDE.DoShowSearchResultsView(iwgfShow);
 | 
			
		||||
    // create a search result page
 | 
			
		||||
    //debugln(['ShowIdentifierReferences ',DbgSName(SearchResultsView)]);
 | 
			
		||||
    SearchPageIndex:=SearchResultsView.AddSearch(
 | 
			
		||||
@ -10916,12 +10932,12 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.OnDesignerShowAnchorEditor(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoViewAnchorEditor(True);
 | 
			
		||||
  DoViewAnchorEditor;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.OnDesignerShowTabOrderEditor(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoViewTabOrderEditor(True);
 | 
			
		||||
  DoViewTabOrderEditor;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.OnSrcNoteBookAddJumpPoint(ACaretXY: TPoint;
 | 
			
		||||
@ -11117,7 +11133,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.OnSrcNotebookViewJumpHistory(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  DoViewJumpHistory(true);
 | 
			
		||||
  DoShowJumpHistory;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.OnSrcNoteBookPopupMenu(const AddMenuItemProc: TAddMenuItemProc);
 | 
			
		||||
@ -11160,15 +11176,19 @@ begin
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TMainIDE.CreateObjectInspector;
 | 
			
		||||
procedure TMainIDE.CreateObjectInspector(aDisableAutoSize: boolean);
 | 
			
		||||
begin
 | 
			
		||||
  if ObjectInspector1<>nil then exit;
 | 
			
		||||
  ObjectInspector1 := TObjectInspectorDlg.Create(OwningComponent);
 | 
			
		||||
  if ObjectInspector1<>nil then begin
 | 
			
		||||
    if aDisableAutoSize then
 | 
			
		||||
      ObjectInspector1.DisableAutoSizing;
 | 
			
		||||
    exit;
 | 
			
		||||
  end;
 | 
			
		||||
  IDEWindowCreators.CreateForm(ObjectInspector1,TObjectInspectorDlg,
 | 
			
		||||
     aDisableAutoSize,OwningComponent);
 | 
			
		||||
  ObjectInspector1.Name:=DefaultObjectInspectorName;
 | 
			
		||||
  ObjectInspector1.ShowFavorites:=True;
 | 
			
		||||
  ObjectInspector1.ShowRestricted:=True;
 | 
			
		||||
  ObjectInspector1.Favorites:=LoadOIFavoriteProperties;
 | 
			
		||||
//  ObjectInspector1.FindDeclarationPopupmenuItem.Visible:=true;
 | 
			
		||||
  ObjectInspector1.OnAddToFavorites:=@OIOnAddToFavorites;
 | 
			
		||||
  ObjectInspector1.OnFindDeclarationOfProperty:=@OIOnFindDeclarationOfProperty;
 | 
			
		||||
  ObjectInspector1.OnUpdateRestricted := @OIOnUpdateRestricted;
 | 
			
		||||
 | 
			
		||||
@ -152,7 +152,6 @@ type
 | 
			
		||||
                           Flags: TCodeToolsFlags): boolean;
 | 
			
		||||
    procedure ActivateCodeToolAbortableMode;
 | 
			
		||||
    function OnCodeToolBossCheckAbort: boolean;
 | 
			
		||||
    procedure CreateObjectInspector; virtual; abstract;
 | 
			
		||||
    procedure DoShowDesignerFormOfCurrentSrc; virtual; abstract;
 | 
			
		||||
    function CreateDesignerForComponent(AnUnitInfo: TUnitInfo;
 | 
			
		||||
                        AComponent: TComponent): TCustomForm; virtual; abstract;
 | 
			
		||||
@ -179,7 +178,7 @@ type
 | 
			
		||||
          var ActiveSourceEditor: TSourceEditor; var ActiveUnitInfo: TUnitInfo); virtual; abstract;
 | 
			
		||||
    procedure GetUnitWithPersistent(APersistent: TPersistent;
 | 
			
		||||
          var ActiveSourceEditor: TSourceEditor; var ActiveUnitInfo: TUnitInfo); virtual; abstract;
 | 
			
		||||
    procedure DoShowComponentList(Show: boolean); virtual; abstract;
 | 
			
		||||
    procedure DoShowComponentList(State: TIWGetFormState = iwgfShowOnTop); virtual; abstract;
 | 
			
		||||
 | 
			
		||||
    function DoOpenMacroFile(Sender: TObject; const AFilename: string): TModalResult; override;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -64,7 +64,7 @@ uses
 | 
			
		||||
  CodeToolManager, CodeCache, AVL_Tree, SynEditKeyCmds,
 | 
			
		||||
  // IDEIntf
 | 
			
		||||
  PropEdits, ObjectInspector, MenuIntf, SrcEditorIntf, ProjectIntf,
 | 
			
		||||
  CompOptsIntf, LazIDEIntf, IDEDialogs,
 | 
			
		||||
  CompOptsIntf, LazIDEIntf, IDEDialogs, IDEWindowIntf,
 | 
			
		||||
  // IDE
 | 
			
		||||
  LazConf, LazarusIDEStrConsts, ProjectDefs, Project, PublishModule, BuildLazDialog,
 | 
			
		||||
  TransferMacros, ProgressDlg, EnvironmentOpts, EditorOptions, CompilerOptions,
 | 
			
		||||
@ -158,7 +158,7 @@ type
 | 
			
		||||
    function DoOpenMacroFile(Sender: TObject;
 | 
			
		||||
        const AFilename: string): TModalResult; virtual; abstract;
 | 
			
		||||
 | 
			
		||||
    procedure DoShowProjectInspector(Show: boolean); virtual; abstract;
 | 
			
		||||
    procedure DoShowProjectInspector(State: TIWGetFormState = iwgfShowOnTop); virtual; abstract;
 | 
			
		||||
    function PrepareForCompile: TModalResult; virtual; abstract; // stop things that interfere with compilation, like debugging
 | 
			
		||||
    function DoSaveBuildIDEConfigs(Flags: TBuildLazarusFlags): TModalResult; virtual; abstract;
 | 
			
		||||
    function DoExampleManager: TModalResult; virtual; abstract;
 | 
			
		||||
 | 
			
		||||
@ -959,9 +959,10 @@ procedure TSearchProgressForm.DoSearchAndAddToSearchResults;
 | 
			
		||||
var
 | 
			
		||||
  ListPage: TTabSheet;
 | 
			
		||||
  Cnt: integer;
 | 
			
		||||
  State: TIWGetFormState;
 | 
			
		||||
begin
 | 
			
		||||
  Cnt:= 0;
 | 
			
		||||
  LazarusIDE.DoShowSearchResultsView(False);
 | 
			
		||||
  LazarusIDE.DoShowSearchResultsView(iwgfShow);
 | 
			
		||||
  ListPage:=SearchResultsView.AddSearch(SearchText,SearchText,
 | 
			
		||||
                            ReplaceText,SearchDirectories,SearchMask,SearchOptions);
 | 
			
		||||
  try
 | 
			
		||||
@ -983,7 +984,11 @@ begin
 | 
			
		||||
    ListPage.Caption:= Format('%s (%d)',[ListPage.Caption,Cnt]);
 | 
			
		||||
    SearchResultsView.EndUpdate(ListPage.PageIndex);
 | 
			
		||||
    // show, but bring to front only if Search Progress dialog was active
 | 
			
		||||
    LazarusIDE.DoShowSearchResultsView(True, fWasActive);
 | 
			
		||||
    if fWasActive then
 | 
			
		||||
      State:=iwgfShowOnTop
 | 
			
		||||
    else
 | 
			
		||||
      State:=iwgfShow;
 | 
			
		||||
    LazarusIDE.DoShowSearchResultsView(State);
 | 
			
		||||
  end;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -49,7 +49,7 @@ uses
 | 
			
		||||
  LazFileCache,
 | 
			
		||||
  // codetools
 | 
			
		||||
  BasicCodeTools, CodeBeautifier, CodeToolManager, CodeCache, SourceLog,
 | 
			
		||||
  LinkScanner,
 | 
			
		||||
  LinkScanner, CodeTree,
 | 
			
		||||
  // synedit
 | 
			
		||||
  SynEditLines, SynEditStrConst, SynEditTypes, SynEdit, SynRegExpr,
 | 
			
		||||
  SynEditHighlighter, SynEditAutoComplete, SynEditKeyCmds, SynCompletion,
 | 
			
		||||
@ -6154,6 +6154,12 @@ var
 | 
			
		||||
  EditorPopupPoint, EditorCaret: TPoint;
 | 
			
		||||
  SelAvail, SelAvailAndWritable, AtIdentifier: Boolean;
 | 
			
		||||
  CurWordAtCursor: String;
 | 
			
		||||
  CodeTool: TCodeTool;
 | 
			
		||||
  CaretXY: TCodeXYPosition;
 | 
			
		||||
  CleanPos: integer;
 | 
			
		||||
  CodeNode: TCodeTreeNode;
 | 
			
		||||
  ProcNode: TCodeTreeNode;
 | 
			
		||||
  ProcName: String;
 | 
			
		||||
begin
 | 
			
		||||
  SourceEditorMenuRoot.MenuItem:=SrcPopupMenu.Items;
 | 
			
		||||
  SourceEditorMenuRoot.BeginUpdate;
 | 
			
		||||
@ -6183,11 +6189,34 @@ begin
 | 
			
		||||
    // add context specific menu items
 | 
			
		||||
    CurFilename:=ASrcEdit.FileName;
 | 
			
		||||
    ShortFileName:=ExtractFileName(CurFilename);
 | 
			
		||||
    SelAvail:=ASrcEdit.EditorComponent.SelAvail;
 | 
			
		||||
    SelAvailAndWritable:=SelAvail and (not ASrcEdit.ReadOnly);
 | 
			
		||||
    CurWordAtCursor:=ASrcEdit.GetWordAtCurrentCaret;
 | 
			
		||||
    AtIdentifier:=IsValidIdent(CurWordAtCursor);
 | 
			
		||||
 | 
			
		||||
    // ask Codetools
 | 
			
		||||
    MainCodeBuf:=nil;
 | 
			
		||||
    if FilenameIsPascalUnit(ShortFileName)
 | 
			
		||||
    or (CompareFileExt(ShortFileName,'.inc',true)=0) then
 | 
			
		||||
      MainCodeBuf:=CodeToolBoss.GetMainCode(ASrcEdit.CodeBuffer)
 | 
			
		||||
    else if FilenameIsPascalSource(ShortFileName) then
 | 
			
		||||
      MainCodeBuf:=ASrcEdit.CodeBuffer;
 | 
			
		||||
    CodeTool:=nil;
 | 
			
		||||
    CaretXY:=CleanCodeXYPosition;
 | 
			
		||||
    CaretXY.Code:=ASrcEdit.CodeBuffer;
 | 
			
		||||
    CaretXY.X:=ASrcEdit.CursorTextXY.X;
 | 
			
		||||
    CaretXY.Y:=ASrcEdit.CursorTextXY.Y;
 | 
			
		||||
    CodeNode:=nil;
 | 
			
		||||
    if MainCodeBuf<>nil then begin
 | 
			
		||||
      CodeToolBoss.Explore(MainCodeBuf,CodeTool,true);
 | 
			
		||||
      if CodeTool<>nil then begin
 | 
			
		||||
        CodeTool.CaretToCleanPos(CaretXY,CleanPos);
 | 
			
		||||
        CodeNode:=CodeTool.FindDeepestNodeAtPos(CleanPos,false);
 | 
			
		||||
      end;
 | 
			
		||||
    end;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    if (FilenameIsAbsolute(CurFilename)) then begin
 | 
			
		||||
      if FilenameIsPascalUnit(ShortFileName)
 | 
			
		||||
      or (CompareFileExt(ShortFileName,'.inc',true)=0) then
 | 
			
		||||
        MainCodeBuf:=CodeToolBoss.GetMainCode(ASrcEdit.CodeBuffer);
 | 
			
		||||
      if (MainCodeBuf<>nil) and (MainCodeBuf<>ASrcEdit.CodeBuffer)
 | 
			
		||||
      and (not MainCodeBuf.IsVirtual) then begin
 | 
			
		||||
        // this is an include file => add link to open unit
 | 
			
		||||
@ -6204,6 +6233,7 @@ begin
 | 
			
		||||
        MaybeAddPopup('.lrs');
 | 
			
		||||
        MaybeAddPopup('.s');
 | 
			
		||||
      end;
 | 
			
		||||
      // ToDo: unit resources
 | 
			
		||||
      if (CompareFileExt(ShortFileName,'.lfm',true)=0)
 | 
			
		||||
      or (CompareFileExt(ShortFileName,'.dfm',true)=0) then begin
 | 
			
		||||
        MaybeAddPopup('.pas');
 | 
			
		||||
@ -6250,22 +6280,35 @@ begin
 | 
			
		||||
    EditorPopupPoint:=EditorComp.ScreenToClient(SrcPopUpMenu.PopupPoint);
 | 
			
		||||
    if EditorPopupPoint.X>EditorComp.Gutter.Width then begin
 | 
			
		||||
      // user clicked on text
 | 
			
		||||
      // collect some flags
 | 
			
		||||
      SelAvail:=ASrcEdit.EditorComponent.SelAvail;
 | 
			
		||||
      SelAvailAndWritable:=SelAvail and (not ASrcEdit.ReadOnly);
 | 
			
		||||
      // enable menu items
 | 
			
		||||
      // enable search menu items
 | 
			
		||||
      SrcEditMenuFindDeclaration.Enabled:=CurWordAtCursor<>'';
 | 
			
		||||
      if CurWordAtCursor<>'' then
 | 
			
		||||
        SrcEditMenuFindDeclaration.Caption:=Format(lisFindDeclarationOf, [
 | 
			
		||||
          CurWordAtCursor])
 | 
			
		||||
      else
 | 
			
		||||
        SrcEditMenuFindDeclaration.Caption:=uemFindDeclaration;
 | 
			
		||||
      SrcEditMenuFindIdentifierReferences.Enabled:=AtIdentifier;
 | 
			
		||||
      SrcEditMenuFindUsedUnitReferences.Enabled:=AtIdentifier;
 | 
			
		||||
      SrcEditMenuFindOverloads.Enabled:=AtIdentifier;
 | 
			
		||||
      ProcName:='';
 | 
			
		||||
      if CodeNode<>nil then begin
 | 
			
		||||
        ProcNode:=CodeNode.GetNodeOfType(ctnProcedure);
 | 
			
		||||
        if ProcNode<>nil then
 | 
			
		||||
          ProcName:=CodeTool.ExtractProcName(ProcNode,[]);
 | 
			
		||||
      end;
 | 
			
		||||
      SrcEditMenuProcedureJump.Enabled:=(ProcName<>'');
 | 
			
		||||
      if ProcName<>'' then
 | 
			
		||||
        SrcEditMenuProcedureJump.Caption:=Format(lisJumpToProcedure, [ProcName])
 | 
			
		||||
      else
 | 
			
		||||
        SrcEditMenuProcedureJump.Caption:=uemProcedureJump;
 | 
			
		||||
      // enable refactoring menu items
 | 
			
		||||
      SrcEditMenuEncloseSelection.Enabled := SelAvailAndWritable;
 | 
			
		||||
      SrcEditMenuEncloseInIFDEF.Enabled := SelAvailAndWritable;
 | 
			
		||||
      SrcEditMenuExtractProc.Enabled := SelAvailAndWritable;
 | 
			
		||||
      SrcEditMenuInvertAssignment.Enabled := SelAvailAndWritable;
 | 
			
		||||
      CurWordAtCursor:=ASrcEdit.GetWordAtCurrentCaret;
 | 
			
		||||
      AtIdentifier:=IsValidIdent(CurWordAtCursor);
 | 
			
		||||
      SrcEditMenuFindIdentifierReferences.Enabled:=AtIdentifier;
 | 
			
		||||
      SrcEditMenuFindUsedUnitReferences.Enabled:=AtIdentifier;
 | 
			
		||||
      SrcEditMenuRenameIdentifier.Enabled:=AtIdentifier and (not ASrcEdit.ReadOnly);
 | 
			
		||||
      SrcEditMenuShowAbstractMethods.Enabled:=not ASrcEdit.ReadOnly;
 | 
			
		||||
      SrcEditMenuShowEmptyMethods.Enabled:=not ASrcEdit.ReadOnly;
 | 
			
		||||
      SrcEditMenuFindOverloads.Enabled:=AtIdentifier;
 | 
			
		||||
      SrcEditMenuMakeResourceString.Enabled:=not ASrcEdit.ReadOnly;
 | 
			
		||||
    end else
 | 
			
		||||
    begin
 | 
			
		||||
@ -7269,7 +7312,7 @@ end;
 | 
			
		||||
 | 
			
		||||
procedure TSourceNotebook.OnPopupOpenProjectInsp(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  MainIDEInterface.DoShowProjectInspector(True);
 | 
			
		||||
  MainIDEInterface.DoShowProjectInspector;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TSourceNotebook.OpenAtCursorClicked(Sender: TObject);
 | 
			
		||||
 | 
			
		||||
@ -44,8 +44,8 @@ uses
 | 
			
		||||
  KeywordFuncLists, FindRenameIdentifier, GenericCheckList, ViewUnit_Dlg,
 | 
			
		||||
  DiskDiffsDialog, InputHistory, CheckLFMDlg, LCLMemManager, CodeToolManager,
 | 
			
		||||
  CodeToolsStructs, ConvCodeTool, CodeCache, CodeTree, FindDeclarationTool,
 | 
			
		||||
  BasicCodeTools, SynEdit, UnitResources, IDEExternToolIntf, ExtToolDialog,
 | 
			
		||||
  PublishModule, etMessagesWnd;
 | 
			
		||||
  BasicCodeTools, SynEdit, UnitResources, IDEExternToolIntf, ObjectInspector,
 | 
			
		||||
  ExtToolDialog, PublishModule, etMessagesWnd;
 | 
			
		||||
 | 
			
		||||
type
 | 
			
		||||
 | 
			
		||||
@ -1816,7 +1816,7 @@ begin
 | 
			
		||||
    // show form and select form
 | 
			
		||||
    if NewUnitInfo.Component<>nil then begin
 | 
			
		||||
      // show form
 | 
			
		||||
      MainIDE.CreateObjectInspector;
 | 
			
		||||
      IDEWindowCreators.ShowForm(DefaultObjectInspectorName,false);
 | 
			
		||||
      MainIDE.DoShowDesignerFormOfCurrentSrc;
 | 
			
		||||
    end else begin
 | 
			
		||||
      MainIDE.DisplayState:= dsSource;
 | 
			
		||||
@ -3286,7 +3286,7 @@ begin
 | 
			
		||||
  try
 | 
			
		||||
    Project1.BeginUpdate(true);
 | 
			
		||||
    try
 | 
			
		||||
      Project1.CompilerOptions.CompilerPath:='$(CompPath)';
 | 
			
		||||
      Project1.CompilerOptions.CompilerPath:=DefaultCompilerPath;
 | 
			
		||||
      if pfUseDefaultCompilerOptions in Project1.Flags then begin
 | 
			
		||||
        MainIDE.DoMergeDefaultProjectOptions(Project1);
 | 
			
		||||
        Project1.Flags:=Project1.Flags-[pfUseDefaultCompilerOptions];
 | 
			
		||||
@ -5805,7 +5805,7 @@ begin
 | 
			
		||||
    MainIDE.DisplayState := dsForm;
 | 
			
		||||
    GlobalDesignHook.LookupRoot := NewComponent;
 | 
			
		||||
    TheControlSelection.AssignPersistent(NewComponent);
 | 
			
		||||
    MainIDE.CreateObjectInspector;
 | 
			
		||||
    IDEWindowCreators.ShowForm(DefaultObjectInspectorName,false);
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
  // show new form
 | 
			
		||||
 | 
			
		||||
@ -314,7 +314,7 @@ var
 | 
			
		||||
  UnitDependenciesWindow: TUnitDependenciesWindow;
 | 
			
		||||
 | 
			
		||||
procedure ShowUnitDependenciesClicked(Sender: TObject);
 | 
			
		||||
procedure ShowUnitDependencies(Show, BringToFront: boolean);
 | 
			
		||||
procedure ShowUnitDependencies(State: TIWGetFormState = iwgfShowOnTop);
 | 
			
		||||
procedure InitUnitDependenciesQuickFixItems;
 | 
			
		||||
 | 
			
		||||
function CompareUDBaseNodes(UDNode1, UDNode2: Pointer): integer;
 | 
			
		||||
@ -323,15 +323,18 @@ implementation
 | 
			
		||||
 | 
			
		||||
procedure ShowUnitDependenciesClicked(Sender: TObject);
 | 
			
		||||
begin
 | 
			
		||||
  ShowUnitDependencies(true,true);
 | 
			
		||||
  ShowUnitDependencies;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure ShowUnitDependencies(Show, BringToFront: boolean);
 | 
			
		||||
procedure ShowUnitDependencies(State: TIWGetFormState);
 | 
			
		||||
begin
 | 
			
		||||
  if UnitDependenciesWindow = Nil then
 | 
			
		||||
    Application.CreateForm(TUnitDependenciesWindow, UnitDependenciesWindow);
 | 
			
		||||
  if Show then
 | 
			
		||||
    IDEWindowCreators.ShowForm(UnitDependenciesWindow,BringToFront);
 | 
			
		||||
    IDEWindowCreators.CreateForm(UnitDependenciesWindow,TUnitDependenciesWindow,
 | 
			
		||||
       State=iwgfDisabled,LazarusIDE.OwningComponent)
 | 
			
		||||
  else if State=iwgfDisabled then
 | 
			
		||||
    UnitDependenciesWindow.DisableAlign;
 | 
			
		||||
 if State>=iwgfShow then
 | 
			
		||||
   IDEWindowCreators.ShowForm(UnitDependenciesWindow,State=iwgfShowOnTop);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure InitUnitDependenciesQuickFixItems;
 | 
			
		||||
@ -441,7 +444,7 @@ var
 | 
			
		||||
  Path: TStringList;
 | 
			
		||||
begin
 | 
			
		||||
  if not IsApplicable(Msg,UnitName1,UnitName2) then exit;
 | 
			
		||||
  ShowUnitDependencies(true,true);
 | 
			
		||||
  ShowUnitDependencies;
 | 
			
		||||
  Path:=TStringList.Create;
 | 
			
		||||
  try
 | 
			
		||||
    Path.Add(UnitName1);
 | 
			
		||||
 | 
			
		||||
@ -990,7 +990,7 @@ function TPkgManager.PackageGraphExplorerOpenProject(Sender: TObject;
 | 
			
		||||
  AProject: TProject): TModalResult;
 | 
			
		||||
begin
 | 
			
		||||
  if AProject<>Project1 then exit(mrCancel);
 | 
			
		||||
  MainIDE.DoShowProjectInspector(true);
 | 
			
		||||
  MainIDE.DoShowProjectInspector;
 | 
			
		||||
  Result:=mrOk;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
@ -1364,7 +1364,7 @@ begin
 | 
			
		||||
        if Dependency is TPkgDependency then begin
 | 
			
		||||
          // check if project
 | 
			
		||||
          if Dependency.Owner is TProject then begin
 | 
			
		||||
            MainIDE.DoShowProjectInspector(true);
 | 
			
		||||
            MainIDE.DoShowProjectInspector;
 | 
			
		||||
            Result:=IDEMessageDialogAb(lisPkgMangBrokenDependency,
 | 
			
		||||
              Format(lisPkgMangTheProjectRequiresThePackageButItWasNotFound,
 | 
			
		||||
                    [Dependency.AsString, LineEnding]),
 | 
			
		||||
@ -3854,7 +3854,7 @@ begin
 | 
			
		||||
  if (ADependency.Owner is TProject) then begin
 | 
			
		||||
    // broken dependency used by project -> show project inspector
 | 
			
		||||
    if ADependency.Owner=Project1 then begin
 | 
			
		||||
      MainIDE.DoShowProjectInspector(true);
 | 
			
		||||
      MainIDE.DoShowProjectInspector;
 | 
			
		||||
      Msg:=Format(lisSeeProjectProjectInspector, [Msg]);
 | 
			
		||||
    end;
 | 
			
		||||
  end;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user