mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:59:17 +02:00
ideintf: free options index searching
- GetFreeIDEOptionsGroupIndex - to find free group index - GetFreeIDEOptionsIndex - to find free options index inside group git-svn-id: trunk@23092 -
This commit is contained in:
parent
cc0ea5f1a0
commit
f5cb1ce5f9
@ -113,6 +113,8 @@ type
|
|||||||
function FindEditor(AEditor: TAbstractIDEOptionsEditorClass): TAbstractIDEOptionsEditor; virtual; abstract;
|
function FindEditor(AEditor: TAbstractIDEOptionsEditorClass): TAbstractIDEOptionsEditor; virtual; abstract;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetFreeIDEOptionsGroupIndex(AStartIndex: Integer): Integer;
|
||||||
|
function GetFreeIDEOptionsIndex(AGroupIndex: Integer; AStartIndex: Integer): Integer;
|
||||||
procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass);
|
procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass);
|
||||||
procedure RegisterIDEOptionsEditor(AGroupIndex: Integer; AEditorClass: TAbstractIDEOptionsEditorClass; AIndex: Integer; AParent: Integer = NoParent);
|
procedure RegisterIDEOptionsEditor(AGroupIndex: Integer; AEditorClass: TAbstractIDEOptionsEditorClass; AIndex: Integer; AParent: Integer = NoParent);
|
||||||
|
|
||||||
@ -178,7 +180,7 @@ begin
|
|||||||
Result := FIDEEditorGroups;
|
Result := FIDEEditorGroups;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; AGroupClass:TAbstractIDEOptionsClass);
|
procedure RegisterIDEOptionsGroup(AGroupIndex: Integer; AGroupClass: TAbstractIDEOptionsClass);
|
||||||
begin
|
begin
|
||||||
IDEEditorGroups.Add(AGroupIndex, AGroupClass);
|
IDEEditorGroups.Add(AGroupIndex, AGroupClass);
|
||||||
end;
|
end;
|
||||||
@ -202,6 +204,30 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function GetFreeIDEOptionsGroupIndex(AStartIndex: Integer): Integer;
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
for I := AStartIndex to High(Integer) do
|
||||||
|
if IDEEditorGroups.GetByIndex(I) = nil then
|
||||||
|
Exit(I);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function GetFreeIDEOptionsIndex(AGroupIndex: Integer; AStartIndex: Integer): Integer;
|
||||||
|
var
|
||||||
|
Rec: PIDEOptionsGroupRec;
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
Result := -1; // -1 = error
|
||||||
|
Rec := IDEEditorGroups.GetByIndex(AGroupIndex);
|
||||||
|
if Rec = nil then
|
||||||
|
Exit;
|
||||||
|
|
||||||
|
for I := AStartIndex to High(Integer) do
|
||||||
|
if Rec^.Items.GetByIndex(I) = nil then
|
||||||
|
Exit(I);
|
||||||
|
end;
|
||||||
|
|
||||||
function GroupListCompare(Item1, Item2: Pointer): Integer;
|
function GroupListCompare(Item1, Item2: Pointer): Integer;
|
||||||
var
|
var
|
||||||
Rec1: PIDEOptionsGroupRec absolute Item1;
|
Rec1: PIDEOptionsGroupRec absolute Item1;
|
||||||
|
Loading…
Reference in New Issue
Block a user