home *** CD-ROM | disk | FTP | other *** search
- {see TVisualValue}
- unit VisualValue;
-
- interface
- uses LangValue,
- Classes;
- type
- {TVisualValue born to be a parent for all VCL ILangValue s }
- TVisualValue=class(ILangValue)
- protected
- fLangOwner:IValueOwner;
- fLangName:string;
- procedure wrLangOwner(a:IValueOwner);
- published
- {Name of TVisualValue in language }
- property LangName:string read fLangName write fLangName;
- constructor Create(o:TComponent);override;
- {Owner of TVisualValue in language for example VM for }
- {procedure a Class instance for method }
- property LangOwner:IValueOwner read fLangOwner write wrLangOwner;
- function CreateSame(o:TComponent):TVisualValue;virtual;
- end;
-
- type TVisualValueClass=class of TVisualValue;
- implementation
- procedure TVisualValue.wrLangOwner;
- begin
- if fLangOwner<>nil then
- begin
- fLangOwner.RemoveValue(Self);
- end;
- fLangOwner:=a;
- if fLangOwner<>nil then
- begin
- fLangOwner.AddValue(LangName,Self);
- end;
- end;
- constructor TVisualValue.Create;
- begin
- Inherited Create(o);
- fLangOwner:=nil;
- LangName:=Name;
- end;
- function TVisualValue.CreateSame;
- Var c:TVisualValueClass;
- begin
- c:=TVisualValueClass(ClassType);
- Result:=C.Create(o);
- Result.LangName:=Self.LangName;
- end;
-
- end.
-