Hi all, I'm aware that my subject is not clear but -as a result of inadequate english vocabulary- i couldn't come up with a better self-defining subject, sorry. Here's my problem: I'm trying to make a manual localization with a self-developed algorithm. I've written a procedure to go through all of the components on a given form and find the ones with the localization-enabled properties (which are manually defined in the code), then this procedure finds the appropriate translation of the property from a translation cross-table and changes the value. The procedure checks the components for having a "text", "caption", "Columns", etc property. If, for example, a "Columns" property is found then it checks to see if the "Columns" class is TListColumns or TDBGridColumns. Here's the actual code (i know it's not state-of-the-art coding, but hey, it works) : ... var aLine: String; aCmp: TComponent; ... tmpPropInfo:= GetPropInfo(aCmp.ClassInfo, 'Columns'); if Assigned(tmpPropInfo) then begin tmpClass:= GetObjectPropClass(aCmp, 'Columns'); if Assigned(tmpClass) then begin if (tmpClass = TDBGridColumns) then begin tmpObj:= GetObjectProp(aCmp, 'Columns', TDBGridColumns); if (TDBGridColumns(tmpObj).Count > 0) then begin for J:= 0 to Pred(TDBGridColumns(tmpObj).Count) do TDBGridColumns(tmpObj)[J].Title.Caption:= SetLangMsgGenel(aLine + 'Columns[' + IntToStr(J) + '].Title.Caption', TDBGridColumns(tmpObj)[J].Title.Caption); end; end else if (tmpClass = TListColumns) then begin tmpObj:= GetObjectProp(aCmp, 'Columns', TListColumns); if (TListColumns(tmpObj).Count > 0) then begin for J:= 0 to Pred(TListColumns(tmpObj).Count) do TListColumns(tmpObj)[J].Caption:= SetLangMsgGenel(aLine + 'Columns[' + IntToStr(J) + '].Caption', TListColumns(tmpObj)[J].Caption); end; end; end; end;
In order this code to work I have to include "DBCtrls" unit in my uses clause. What I would like to have is a way that won't need me to include this unit. I want to access the Count and Items[J].Title.Caption properties, for example, of TDBGridColumns class without having to include the unit. It may require more (and complicated) coding maybe, but still this has to be done. I would really appreciate any help. Thank you very much, in advance. HasanC.