mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 08:29:32 +02:00
added TComponent to ad to package new component dialog
git-svn-id: trunk@7187 -
This commit is contained in:
parent
dcefb8d97e
commit
3d37b16f09
@ -2277,7 +2277,8 @@ resourcestring
|
||||
// add to package dialog
|
||||
lisA2PInvalidFilename = 'Invalid filename';
|
||||
lisA2PTheFilenameIsAmbiguousPleaseSpecifiyAFilename = 'The filename %s%s%s '
|
||||
+'is ambiguous.%sPlease specifiy a filename with full path.';
|
||||
+'is ambiguous, because the package has no default directory yet.%s'
|
||||
+'Please specify a filename with full path.';
|
||||
lisA2PFileNotUnit = 'File not unit';
|
||||
lisA2PPascalUnitsMustHaveTheExtensionPPOrPas = 'Pascal units must have the '
|
||||
+'extension .pp or .pas';
|
||||
|
@ -612,7 +612,7 @@ var
|
||||
i: Integer;
|
||||
begin
|
||||
if FindComponent(Prefix)=nil then begin
|
||||
Result:=Prefix;
|
||||
Result:=Prefix+'1';
|
||||
end else begin
|
||||
i:=1;
|
||||
repeat
|
||||
|
@ -1659,13 +1659,14 @@ begin
|
||||
if not IsValidIdent(fLastNewComponentAncestorType) then exit;
|
||||
PkgComponent:=TPkgComponent(
|
||||
IDEComponentPalette.FindComponent(fLastNewComponentAncestorType));
|
||||
if PkgComponent=nil then exit;
|
||||
|
||||
|
||||
// create unique classname
|
||||
ClassNameEdit.Text:=IDEComponentPalette.CreateNewClassName(
|
||||
if (not IsValidIdent(ClassNameEdit.Text)) or (ClassNameEdit.Text='') then
|
||||
ClassNameEdit.Text:=IDEComponentPalette.CreateNewClassName(
|
||||
fLastNewComponentAncestorType);
|
||||
// choose the same page name
|
||||
PalettePageCombobox.Text:=PkgComponent.Page.PageName;
|
||||
if (PalettePageCombobox.Text='') and (PkgComponent<>nil) then
|
||||
PalettePageCombobox.Text:=PkgComponent.Page.PageName;
|
||||
// filename
|
||||
AutoCompleteNewComponentUnitName;
|
||||
end;
|
||||
@ -1789,13 +1790,18 @@ begin
|
||||
PackageGraph.IterateComponentClasses(LazPackage,@OnIterateComponentClasses,
|
||||
true,true);
|
||||
end;
|
||||
// put them into the combobox
|
||||
// put them into a list
|
||||
sl:=TStringList.Create;
|
||||
ANode:=fPkgComponents.FindLowest;
|
||||
while ANode<>nil do begin
|
||||
sl.Add(TPkgComponent(ANode.Data).ComponentClass.ClassName);
|
||||
ANode:=fPkgComponents.FindSuccessor(ANode);
|
||||
end;
|
||||
// add at least TComponent
|
||||
sl.Add('TComponent');
|
||||
sl.Sort;
|
||||
|
||||
// put them into the combobox
|
||||
OldAncestorType:=AncestorComboBox.Text;
|
||||
AncestorComboBox.Items.Assign(sl);
|
||||
AncestorComboBox.Text:=OldAncestorType;
|
||||
|
Loading…
Reference in New Issue
Block a user