You've already forked lazarus-ccr
NiceSidebar: new package by Priyatna
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8849 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
34
components/nicesidebar/Demo3/common/Unit1.dfm
Normal file
34
components/nicesidebar/Demo3/common/Unit1.dfm
Normal file
@ -0,0 +1,34 @@
|
||||
object Form1: TForm1
|
||||
Left = 369
|
||||
Top = 174
|
||||
Caption = 'NiceSideBar Demo - priyatna.org'
|
||||
ClientHeight = 442
|
||||
ClientWidth = 586
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -12
|
||||
Font.Name = 'Segoe UI'
|
||||
Font.Style = []
|
||||
Position = poDesktopCenter
|
||||
OnCreate = FormCreate
|
||||
TextHeight = 15
|
||||
object Button1: TButton
|
||||
Left = 312
|
||||
Top = 120
|
||||
Width = 129
|
||||
Height = 25
|
||||
Caption = 'Set ItemIndex'
|
||||
TabOrder = 0
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 312
|
||||
Top = 160
|
||||
Width = 129
|
||||
Height = 25
|
||||
Caption = 'Set SubItemIndex'
|
||||
TabOrder = 1
|
||||
OnClick = Button2Click
|
||||
end
|
||||
end
|
30
components/nicesidebar/Demo3/common/Unit1.lfm
Normal file
30
components/nicesidebar/Demo3/common/Unit1.lfm
Normal file
@ -0,0 +1,30 @@
|
||||
object Form1: TForm1
|
||||
Left = 369
|
||||
Height = 480
|
||||
Top = 174
|
||||
Width = 598
|
||||
Caption = 'NiceSideBar Demo - priyatna.org'
|
||||
ClientHeight = 480
|
||||
ClientWidth = 598
|
||||
Color = clBtnFace
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '2.3.0.0'
|
||||
object Button1: TButton
|
||||
Left = 312
|
||||
Height = 25
|
||||
Top = 120
|
||||
Width = 129
|
||||
Caption = 'Set ItemIndex'
|
||||
OnClick = Button1Click
|
||||
TabOrder = 0
|
||||
end
|
||||
object Button2: TButton
|
||||
Left = 312
|
||||
Height = 25
|
||||
Top = 160
|
||||
Width = 129
|
||||
Caption = 'Set SubItemIndex'
|
||||
OnClick = Button2Click
|
||||
TabOrder = 1
|
||||
end
|
||||
end
|
90
components/nicesidebar/Demo3/common/Unit1.pas
Normal file
90
components/nicesidebar/Demo3/common/Unit1.pas
Normal file
@ -0,0 +1,90 @@
|
||||
unit Unit1;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$MODE Delphi}
|
||||
{$ENDIF}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, NiceSidebar, ExtCtrls, StdCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
SideBar: TNiceSideBar;
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$R *.lfm}
|
||||
{$ELSE}
|
||||
{$R *.dfm}
|
||||
{$ENDIF}
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
var
|
||||
Item: TSideBarItem;
|
||||
begin
|
||||
SideBar := TNiceSideBar.Create(Self);
|
||||
with SideBar do
|
||||
begin
|
||||
BeginUpdate;
|
||||
Parent := Self;
|
||||
|
||||
//GroupSeparator := 0;
|
||||
|
||||
Item := Items.Add;
|
||||
Item.Caption := 'Test Item 1';
|
||||
Item.Items.CommaText := '"Sub Item 1","Sub Item 2","Sub Item 3","Sub Item 4"';
|
||||
|
||||
Item := Items.Add;
|
||||
Item.Caption := 'Test Item 2';
|
||||
Item.Items.CommaText := '"Sub Item 1","Sub Item 2","Sub Item 3","Sub Item 4"';
|
||||
|
||||
ItemIndex := Item.Index;
|
||||
SubItemIndex := 2;
|
||||
|
||||
Item := Items.Add;
|
||||
Item.Caption := 'Test Item 3';
|
||||
Item.Items.CommaText := '"Sub Item 1","Sub Item 2","Sub Item 3","Sub Item 4"';
|
||||
|
||||
Item := Items.Add;
|
||||
Item.Caption := 'Test Item 4';
|
||||
Item.Items.CommaText := '"Sub Item 1","Sub Item 2","Sub Item 3","Sub Item 4"';
|
||||
|
||||
Item := Items.Add;
|
||||
Item.Caption := 'Test Item 5';
|
||||
Item.Items.CommaText := '"Sub Item 1","Sub Item 2","Sub Item 3","Sub Item 4"';
|
||||
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
begin
|
||||
SideBar.ItemIndex := 0;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button2Click(Sender: TObject);
|
||||
begin
|
||||
SideBar.SubItemIndex := 2;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user