unit U_BaseDataLink;

interface

uses
  System.SysUtils,windows,forms, System.Classes,
   dxSkinsDefaultPainters, dxCore, cxClasses,
  cxLookAndFeels,  cxContainer, cxEdit,
  System.ImageList, Vcl.ImgList, Vcl.Controls, cxImageList, cxGraphics, cxStyles,
    dxLayoutLookAndFeels,cxLocalization, dxSkinsForm, dxSkinsCore, dxSkinWXI,
  dxSkinSharpPlus, dxSkinOffice2013White;

type
  TBaseDataLink = class(TDataModule)
    dxSkinController1: TdxSkinController;
    cxEditStyleController1: TcxEditStyleController;
    ThreeLookAndFeelCol: TcxLookAndFeelController;
    cxImageList_bar: TcxImageList;
    ThreeColorBase: TcxStyleRepository;
    dxLayoutLookAndFeelList1: TdxLayoutLookAndFeelList;
    dxLayoutSkinLookAndFeel1: TdxLayoutSkinLookAndFeel;
    cxLocalizer1: TcxLocalizer;
    grid_head_blue: TcxStyle;
    grid_head_red: TcxStyle;
    grid_head_green: TcxStyle;
    grid_head_yellow: TcxStyle;
    grid_head_cyan: TcxStyle;
    grid_head_purple: TcxStyle;
    grid_black_blue: TcxStyle;
    grid_black_pink: TcxStyle;
    grid_black_grey: TcxStyle;
    grid_black_green: TcxStyle;
    grid_black_yellow: TcxStyle;
    grid_black_cyan: TcxStyle;
    grid_head_black: TcxStyle;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
  public

  end;

var
  BaseDataLink: TBaseDataLink;

implementation
uses
  U_globalVar,U_FormLayOutDesign;
{%CLASSGROUP 'Vcl.Controls.TControl'}

{$R *.dfm}

procedure TBaseDataLink.DataModuleCreate(Sender: TObject);
var
  str :String;
  pathStr:String;
  I: Integer;
//  thread:TThread;
begin
     ///////////////////
   //  dxSkinController1.BeginUpdate;
  //////////////////////
  //  thread:=TThread.CreateAnonymousThread(
   // procedure
   // begin

//           if (fileexists(ExtractFilePath(Application.ExeName) + 'devchs.ini') = true)
//             then
//           begin
//             cxLocalizer1.FileName := ExtractFilePath(Application.ExeName) +
//               'devchs.ini';
//             cxLocalizer1.Active := true;
//             cxLocalizer1.LanguageIndex := 1;
//           end;
//
//              pathStr:=ExtractFilePath(Application.ExeName) + '\AllSkins.skinres';
//              if FileExists(pathStr) then
//              begin
//                dxSkinsUserSkinLoadFromFile(pathStr, 'WXI');
//                RootLookAndFeel.SkinName := sdxSkinsUserSkinName;
//              end;
   // end);

   //  thread.FreeOnTerminate := True;
   //  thread.Start;

     dxSkinController1.BeginUpdate;
     TRY
     RootLookAndFeel.NativeStyle := false;
     gFontSize:=0;

           if (fileexists(ExtractFilePath(Application.ExeName) + 'devchs.ini') = true)
             then
           begin
             cxLocalizer1.FileName := ExtractFilePath(Application.ExeName) +
               'devchs.ini';
             cxLocalizer1.Active := true;
             cxLocalizer1.LanguageIndex := 1;
           end;

           getSystemIni();
           if not gIsUseSkin then
           begin
             dxSkinController1.UseSkins:=false;
             dxSkinController1.SkinName:='';
             dxSkinController1.Kind:=  lfStandard ;
             //RootLookAndFeel.NativeStyle := true;
           end
           else
           begin
              pathStr:=ExtractFilePath(Application.ExeName) + '\AllSkins.skinres';
              if FileExists(pathStr) then
              begin
                dxSkinsUserSkinLoadFromFile(pathStr, 'WXI');
                RootLookAndFeel.SkinName := sdxSkinsUserSkinName;
              end;
           end;
     FINALLY
         dxSkinController1.EndUpdate;
     END;
  end;


end.
