rtti controls: TTIComboBox now keeps Items if the property does not provide a value list

git-svn-id: trunk@11782 -
This commit is contained in:
mattias 2007-08-10 18:49:43 +00:00
parent 217be5842e
commit fb10d9cb9c

View File

@ -160,7 +160,8 @@ Type
var MappedValues: TStrings;
UseAllExistingAlias, AddValuesWithoutAlias,
IfNoValuesAvailableAddAllAlias: boolean);
procedure AssignCollectedAliasValuesTo(DestList: TStrings);
procedure AssignCollectedAliasValuesTo(DestList: TStrings;
KeepIfNoneCollected: boolean = true);
function HasAliasValues: boolean;
procedure BuildEnumAliasValues(AStringArray: PString);
public
@ -1632,7 +1633,6 @@ end;
procedure TCustomPropertyLink.InvalidateEditor;
begin
FreeThenNil(FCollectedValues);
FreeThenNil(FEditor);
end;
@ -1990,14 +1990,16 @@ begin
AddValuesWithoutAlias,IfNoValuesAvailableAddAllAlias);
end;
procedure TCustomPropertyLink.AssignCollectedAliasValuesTo(DestList: TStrings);
procedure TCustomPropertyLink.AssignCollectedAliasValuesTo(DestList: TStrings;
KeepIfNoneCollected: boolean);
var
MappedValues: TStrings;
begin
MappedValues:=nil;
MapCollectedValues(AliasValues,MappedValues,true,true,true);
try
DestList.Assign(MappedValues);
if (MappedValues.Count>0) or (not KeepIfNoneCollected) then
DestList.Assign(MappedValues);
finally
MappedValues.Free;
end;