mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-10-31 04:41:42 +01:00 
			
		
		
		
	IDEIntf: added TAbstractOptionsEditorDialog.FindEditor(aClassName: string)
git-svn-id: trunk@57326 -
This commit is contained in:
		
							parent
							
								
									499ddd57ef
								
							
						
					
					
						commit
						060db859c5
					
				| @ -260,6 +260,7 @@ type | ||||
|     procedure AddButtonSeparator; virtual; abstract; | ||||
|     function AddControl(AControlClass: TControlClass): TControl; virtual; abstract; reintroduce; | ||||
|     function FindEditor(AEditor: TAbstractIDEOptionsEditorClass): TAbstractIDEOptionsEditor; virtual; abstract; | ||||
|     function FindEditor(const IDEOptionsEditorClassName: string): TAbstractIDEOptionsEditor; virtual; abstract; | ||||
|     function FindEditor(GroupIndex, AIndex: integer): TAbstractIDEOptionsEditor; virtual; abstract; | ||||
|     function FindEditorClass(GroupIndex, AIndex: integer): TAbstractIDEOptionsEditorClass; virtual; abstract; | ||||
|     procedure OpenEditor(AEditor: TAbstractIDEOptionsEditorClass); virtual; abstract; | ||||
|  | ||||
| @ -96,6 +96,7 @@ type | ||||
|     procedure SaveIDEOptions(Sender: TObject; AOptions: TAbstractIDEOptions); | ||||
|     procedure CreateEditors; | ||||
|     function SearchEditorNode(AEditor: TAbstractIDEOptionsEditorClass): TTreeNode; | ||||
|     function SearchEditorNode(const IDEOptionsEditorClassName: string): TTreeNode; | ||||
|     function PassesFilter(ARec: PIDEOptionsGroupRec): Boolean; | ||||
|     procedure SetSettings(const AValue: TIDEOptionsEditorSettings); | ||||
|     function AllBuildModes: boolean; | ||||
| @ -110,6 +111,7 @@ type | ||||
|     procedure OpenEditor(AEditor: TAbstractIDEOptionsEditorClass); override; | ||||
|     procedure OpenEditor(GroupIndex, AIndex: integer); override; | ||||
|     function FindEditor(AEditor: TAbstractIDEOptionsEditorClass): TAbstractIDEOptionsEditor; override; | ||||
|     function FindEditor(const IDEOptionsEditorClassName: string): TAbstractIDEOptionsEditor; override; | ||||
|     function FindEditor(GroupIndex, AIndex: integer): TAbstractIDEOptionsEditor; override; | ||||
|     function FindEditorClass(GroupIndex, AIndex: integer): TAbstractIDEOptionsEditorClass; override; | ||||
|     function ResetFilter: Boolean; override; | ||||
| @ -591,6 +593,28 @@ begin | ||||
|   Result := Traverse(CategoryTree.Items.GetFirstNode); | ||||
| end; | ||||
| 
 | ||||
| function TIDEOptionsDialog.SearchEditorNode( | ||||
|   const IDEOptionsEditorClassName: string): TTreeNode; | ||||
| 
 | ||||
|   function Traverse(ANode: TTreeNode): TTreeNode; | ||||
|   begin | ||||
|     Result := nil; | ||||
|     if ANode <> nil then | ||||
|     begin | ||||
|       if (ANode.Data <> nil) | ||||
|       and (CompareText(TObject(ANode.Data).ClassName,IDEOptionsEditorClassName)=0) then | ||||
|         Result := ANode; | ||||
|       if Result = nil then | ||||
|         Result := Traverse(ANode.GetFirstChild); | ||||
|       if Result = nil then | ||||
|         Result := Traverse(ANode.GetNextSibling); | ||||
|     end; | ||||
|   end; | ||||
| 
 | ||||
| begin | ||||
|   Result := Traverse(CategoryTree.Items.GetFirstNode); | ||||
| end; | ||||
| 
 | ||||
| function TIDEOptionsDialog.PassesFilter(ARec: PIDEOptionsGroupRec): Boolean; | ||||
| var | ||||
|   i: Integer; | ||||
| @ -741,6 +765,18 @@ begin | ||||
|     Result := nil; | ||||
| end; | ||||
| 
 | ||||
| function TIDEOptionsDialog.FindEditor(const IDEOptionsEditorClassName: string | ||||
|   ): TAbstractIDEOptionsEditor; | ||||
| var | ||||
|   Node: TTreeNode; | ||||
| begin | ||||
|   Node := SearchEditorNode(IDEOptionsEditorClassName); | ||||
|   if Node <> nil then | ||||
|     Result := TAbstractIDEOptionsEditor(Node.Data) | ||||
|   else | ||||
|     Result := nil; | ||||
| end; | ||||
| 
 | ||||
| function TIDEOptionsDialog.FindEditor(GroupIndex, AIndex: integer): TAbstractIDEOptionsEditor; | ||||
| var | ||||
|   EditorClass: TAbstractIDEOptionsEditorClass; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 mattias
						mattias