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:
wp_xxyyzz
2023-06-24 22:41:48 +00:00
parent 9f5674152f
commit 87836a7f2b
32 changed files with 6461 additions and 0 deletions

View 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

View 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

View 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.