unit cde_MainForm;
{$mode delphi}
{$codepage UTF8}
interface
uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons, ExtCtrls, ButtonComps, kernel,
     SimplyJSON, cde_skins;
type
  { Tcde_Main }
  Tcde_Main = class(TForm)
    WorkArea: TPanel;
    procedure CloseBtnClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    procedure ApplySkin;
  public
  end;
var
  cde_Main: Tcde_Main;
implementation
{$R *.lfm}
procedure Tcde_Main.FormCreate(Sender: TObject);
begin
ApplySkin;
CreateDriveRec('f');
//LogoImg.Picture.LoadFromFile(GetCDEPath + 'images\Main_logo.png');
//VersionLbl.Caption:= 'v. ' + FileVersion(GetCDEPath + 'bin\cdejecter.exe');
//case GetBuildPlatform of
 //ospUnknown: VersionLbl.Caption:= VersionLbl.Caption;
 //ospWin32: VersionLbl.Caption:= VersionLbl.Caption + ' (x32)';
 //ospWin64: VersionLbl.Caption:= VersionLbl.Caption + ' (x64)';
 //end;
end;
procedure Tcde_Main.CloseBtnClick(Sender: TObject);
begin
cde_Main.Close;
end;
procedure Tcde_Main.ApplySkin;
begin
//Apply font
Font:= JSReadFont('/default', Font, GetSkinDir + 'cdea_main\font.json');
TitleLbl.Font:= JSReadFont('/caption', TitleLbl.Font, GetSkinDir + 'cdea_main\font.json');
//Apply backgrounds
HeaderBackground.Picture.LoadFromFile(GetSkinDir + 'cdea_main\' + JSReadString('/HeaderBackground/image', 'HeaderBackground.bmp', GetSkinDir + 'cdea_main\skinoptions.json'));
HeaderBackground.Stretch:= JSReadBoolean('/HeaderBackground/stretch', False, GetSkinDir + 'cdea_main\skinoptions.json');
HeaderBackground.Transparent:= JSReadBoolean('/HeaderBackground/transperent', False, GetSkinDir + 'cdea_main\skinoptions.json');
Background.Picture.LoadFromFile(GetSkinDir + 'cdea_main\' + JSReadString('/Background/image', 'Background.bmp', GetSkinDir + 'cdea_main\skinoptions.json'));
Background.Stretch:= JSReadBoolean('/Background/stretch', False, GetSkinDir + 'cdea_main\skinoptions.json');
Background.Transparent:= JSReadBoolean('/Background/transperent', False, GetSkinDir + 'cdea_main\skinoptions.json');
//Apply buttons
//- CloseBtn
CloseBtn.Bitmap.LoadFromFile(GetSkinDir + 'cdea_main\closebtn\normal.bmp');
CloseBtn.BitmapOver.LoadFromFile(GetSkinDir + 'cdea_main\closebtn\mover.bmp');
CloseBtn.BitmapDown.LoadFromFile(GetSkinDir + 'cdea_main\closebtn\mclick.bmp');
end;
end.
