unit SideNavBar;

interface

uses
  Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, IWControl,
  IWAdvToolButton, IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl,
  IWCompLabel, LeftFrame, Controls, Forms, TopFrame, IWCompRectangle,
  IWTMSCtrls, IWOutlookBar, IWCompEdit, IWMultiColumnComboBox, IWHelpTip,
  IWTMSCheckList, IWCompListbox, IWCompButton, jpeg, IWExtCtrls,
  IWSideNavBar;

type
  TformSideNavBar = class(TIWAppForm)
    FrameTopFrame1: TFrameTopFrame;
    FrameLeftFrame1: TFrameLeftFrame;
    IWLabel7: TIWLabel;
    IWLabel2: TIWLabel;
    TIWSideNavBar1: TTIWSideNavBar;
    IWImage1: TIWImage;
    IWEdit1: TIWEdit;
    IWEdit2: TIWEdit;
    IWButton3: TIWButton;
    IWListbox1: TIWListbox;
    IWButton1: TIWButton;
    procedure IWButton1Click(Sender: TObject);
    procedure IWButton3Click(Sender: TObject);
    procedure TIWSideNavBar1ItemClick(Sender: TComponent; PanelIndex,
      ItemIndex: Integer);
  public
  end;

implementation

{$R *.dfm}





procedure TformSideNavBar.IWButton1Click(Sender: TObject);
var
i: integer;
begin
    with TIWSideNavBar1.Panels.Add do
      begin
        Glyph.FileName := '/files/doc_users.gif';
        Caption := 'New Panel ';
        Height := 0;

        with Items.Add do
        begin
          Caption := 'Users';
          Glyph.FileName := '/files/users.gif';
        end;

        for i:=1 to 1 do
        begin
          with Items.Add do
          begin
            Caption := 'User ' + IntToStr(i);
            Glyph.FileName := '/files/contacts24b.gif';
            Level := 1;
          end;
          with Items.Add do
          begin
            Caption := 'Details';
            Glyph.FileName := '/files/iwnew.gif';            
            Level := 2;
          end;
        end;

        with Items.Add do
        begin
          Caption := 'Extra';
          IsDivider := true;
        end;

        with Items.Add do
        begin
          Caption := 'Print List';
          Glyph.FileName := '/files/printer.gif';
        end;

    end;
IWButton1.Enabled := false;

end;

procedure TformSideNavBar.IWButton3Click(Sender: TObject);
begin
    IWListbox1.Items.Add(IWButton3.Text + ' : ' + IWEdit1.Text + ' : ' + IWEdit2.Text);
    TIWSideNavBar1.ActivePanel := 2;
end;

procedure TformSideNavBar.TIWSideNavBar1ItemClick(Sender: TComponent;
  PanelIndex, ItemIndex: Integer);
begin
 IWListbox1.Items.Add('Clicked Item ' + IntToStr(ItemIndex) + ': ' + TIWSideNavBar1.Panels[PanelIndex].Items[ItemIndex].Caption);
end;

end.
