*.h
public: // User declarations TStrings* GetPropertyList(TFmxObject *Component,bool includePropType);*.cpp
// --------------------------------------------------------------------------- TStrings* TfrmMain::GetPropertyList(TFmxObject *Component,bool includePropType) { Typinfo::TTypeKinds SupportKinds; SupportKinds << tkUnknown << tkInteger << tkChar << tkEnumeration << tkFloat << tkString << tkSet << tkClass << tkMethod << tkWChar << tkLString << tkWString << tkVariant << tkArray << tkRecord << tkInterface << tkInt64 << tkDynArray; Typinfo::TPropList pList; TStrings *propList = new TStringList(); AnsiString propName,propType; //получаем список свойств int nPropCount = GetPropList((Typinfo::PTypeInfo)(Component->ClassInfo()), SupportKinds, ((Typinfo::PPropList)(&pList))); for( int j = 0; j < nPropCount; j++) { propName=pList[j]->Name; propType=(*(pList[j]->PropType))->Name; if (includePropType)propList->Add(propName + " : "+ propType); else propList->Add(propName); } return propList; } // ---------------------------------------------------------------------------
Комментариев нет:
Отправить комментарий