unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, NxScrollControl, NxToolBox, NxTBXToolBox, StdCtrls, XPMan,
  ExtCtrls, ImgList,

  TBXAluminumTheme, TBXStripesTheme, TBXRomaTheme, TBXReliferTheme,
  TBXNexosXTheme, TBXNexos2Theme, TBXNexos3Theme, TBXNexos4Theme, TBXNexos5Theme,
  TBXTristanTheme, TBXDreamTheme, TBXSentimoXTheme,
  TBXTristan2Theme, TBXXitoTheme, TBXMonaiTheme, 
  TBXWhidbeyTheme, TBXEosTheme, TBXOfficeKTheme, TBXOfficeCTheme,
  TBXAthenTheme, TBXOffice11AdaptiveTheme, TBXNewOfficeAdaptiveTheme, TBXOffice2003Theme,
  TBXSwitcher, NxCollection, NxEdit;

type
  TForm1 = class(TForm)
    TBXSwitcher1: TTBXSwitcher;
    XPManifest1: TXPManifest;
    ImageList1: TImageList;
    NxTBXFlipPanel1: TNxTBXFlipPanel;
    NxTBXButton1: TNxTBXButton;
    NxTBXButton2: TNxTBXButton;
    NxTBXAlertWindow1: TNxTBXAlertWindow;
    NxTBXButton3: TNxTBXButton;
    ImageList2: TImageList;
    ImageList3: TImageList;
    NxTBXOutlookBar1: TNxTBXOutlookBar;
    NxTBXToolBox1: TNxTBXToolBox;
    Label1: TLabel;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    ComboBox1: TComboBox;
    procedure FormCreate(Sender: TObject);
    procedure CheckBox1Click(Sender: TObject);
    procedure CheckBox2Click(Sender: TObject);
    procedure NxTBXButton1Click(Sender: TObject);
    procedure NxTBXButton2Click(Sender: TObject);
    procedure NxTBXButton3Click(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  i: Integer;
begin
  TBXSwitcher1.Theme := 'Tristan2';
  NxTBXToolBox1.DoubleBuffered := True;
  for i := 0 to TBXSwitcher1.ThemeCount - 1 do
  begin
    ComboBox1.Items.Add(TBXSwitcher1.Themes[i]);
  end;
  ComboBox1.ItemIndex := -1;
  NxTBXToolBox1.SelectedItem := ((NxTBXToolBox1.Categories.Items[0] as TNxToolBoxCategoryItem).Items.Items[0] as TNxToolBoxItem);
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
  if CheckBox1.Checked then
  begin
    NxTBXToolBox1.ThemeOptions := NxTBXToolBox1.ThemeOptions + [bxEnableThemes];
    NxTBXButton1.ThemeOptions := NxTBXButton1.ThemeOptions + [bxEnableThemes];
    NxTBXButton2.ThemeOptions := NxTBXButton2.ThemeOptions + [bxEnableThemes];
  end else
  begin
    NxTBXToolBox1.ThemeOptions := NxTBXToolBox1.ThemeOptions - [bxEnableThemes];
    NxTBXButton1.ThemeOptions := NxTBXButton1.ThemeOptions - [bxEnableThemes];
    NxTBXButton2.ThemeOptions := NxTBXButton2.ThemeOptions - [bxEnableThemes];
  end;
end;

procedure TForm1.CheckBox2Click(Sender: TObject);
begin
  if CheckBox2.Checked then
    NxTBXToolBox1.ThemeOptions := NxTBXToolBox1.ThemeOptions + [bxDisplayBackground]
      else NxTBXToolBox1.ThemeOptions := NxTBXToolBox1.ThemeOptions - [bxDisplayBackground];

end;

procedure TForm1.NxTBXButton1Click(Sender: TObject);
begin
  with NxTBXToolBox1.Categories.Add do
  begin
    Caption := 'Category';
  end;
end;

procedure TForm1.NxTBXButton2Click(Sender: TObject);
begin
  with TNxToolBoxCategoryItem(NxTBXToolBox1.Categories.Items[NxTBXToolBox1.Categories.Count - 1]).Items.Add do
  begin
    Caption := 'Item';
    ImageIndex := Random(ImageList1.Count);
  end;
end;

procedure TForm1.NxTBXButton3Click(Sender: TObject);
begin
  NxTBXAlertWindow1.Popup;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  TBXSwitcher1.Theme := ComboBox1.Items[ComboBox1.ItemIndex];
end;

end.
