unit cde_MainForm;
{$mode delphi}
{$codepage UTF8}
interface
uses Classes, SysUtils, FileUtil, Forms, Controls, Dialogs, StdCtrls, Buttons,
  ExtCtrls, ComCtrls, Menus, kernel, SimplyJSON, LazUTF8Classes;
type
  { Tcde_Main }
  Tcde_Main = class(TForm)
    DiscPages: TPageControl;
    Images: TImageList;
    MainMenu: TMainMenu;
    DiscM: TMenuItem;
    ActionsM: TMenuItem;
    HelpM: TMenuItem;
    NoDiscFound: TPanel;
    TabSheet1: TTabSheet;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure DiscsMenuClick(Sender: TObject);
  private
  public
  DiscList: TStringListUTF8;
  end;
var
  cde_Main: Tcde_Main;
implementation
{$R *.lfm}
procedure Tcde_Main.FormCreate(Sender: TObject);
var Ind: Byte;
begin
UpdateLanguage;
DiscList:= TStringListUTF8.Create;
UpdateDL(DiscList);
if DiscList.Count > 0 then
 begin
 NoDiscFound.Hide;
 DiscPages.Show;
 for Ind:= 0 to DiscList.Count - 1 do
  CreateDriveRec(Ind);
 end
 else
 begin
 DiscPages.Hide;
 NoDiscFound.Show;
 end;
end;
procedure Tcde_Main.FormDestroy(Sender: TObject);
begin
FreeAndNil(DiscList);
end;
procedure Tcde_Main.DiscsMenuClick(Sender: TObject);
var Indx: Integer;
begin
Indx:= (Sender as TMenuItem).Tag;
DiscPages.ActivePageIndex:= Indx;
end;
end.
