added TComponent to ad to package new component dialog

git-svn-id: trunk@7187 -
This commit is contained in:
mattias 2005-05-21 14:30:16 +00:00
parent dcefb8d97e
commit 3d37b16f09
3 changed files with 14 additions and 7 deletions

View File

@ -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';

View File

@ -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

View File

@ -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;