zoukankan      html  css  js  c++  java
  • rtti多国语言

     

    procedure TBaseForm.SetControlCaptions(Container: TWinControl);
    var
      I: Integer;
      sCaption, sNewCaption, sLanguage: string;
      T: TRttiType;
      P: TRttiProperty;
    begin
      if AppConfig.Language = lgOrigal then
        Exit;
      T := TRttiContext.Create.GetType(Container.ClassInfo);
      P := T.GetProperty('Caption');
      if P <> nil then
      begin
        sCaption := P.GetValue(Container).ToString;
        if (sCaption > '') and (sCaption < 'zzz') then
        begin
          sNewCaption := AppClient.GetDisplayText(ModuleId, sCaption);
          if sCaption <> sNewCaption then
            P.SetValue(Container, sNewCaption);
        end;
        FreeAndNil(P);
      end;
      if ((csAcceptsControls in Container.ControlStyle)
        or (csPannable in Container.ControlStyle)) then
      begin
        P := T.GetProperty('ControlCount');
        FreeAndNil(T);

        if P <> nil then
        begin
          FreeAndNil(P);
          for I := 0 to Container.ControlCount - 1 do
             SetControlCaptions(TWinControl(Container.Controls[I]));
        end;
      end
      else
        FreeAndNil(T);
    end;

  • 相关阅读:
    hdu 1286
    hdu 1420
    hdu 2068
    hdu 1718
    hdu 1231
    hdu 1072
    HDOJ 350留念
    hdu 1898
    hdu 1593
    帮助理解git的图
  • 原文地址:https://www.cnblogs.com/hnxxcxg/p/2940579.html
Copyright © 2011-2022 走看看