Стартовый пул
This commit is contained in:
103
spktoolbar/demos/actions/project1.lpi
Normal file
103
spktoolbar/demos/actions/project1.lpi
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="1">
|
||||
<Mode0 Name="default"/>
|
||||
</Modes>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="SpkToolbarPackage"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="unit2.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="AboutForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit2"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="bin\project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
24
spktoolbar/demos/actions/project1.lpr
Normal file
24
spktoolbar/demos/actions/project1.lpr
Normal file
@@ -0,0 +1,24 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
LCLVersion, Forms, Unit1, Unit2
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
{$IF LCL_FullVersion >= 1080000}
|
||||
Application.Scaled:=True;
|
||||
{$ENDIF}
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
2251
spktoolbar/demos/actions/unit1.lfm
Normal file
2251
spktoolbar/demos/actions/unit1.lfm
Normal file
File diff suppressed because it is too large
Load Diff
337
spktoolbar/demos/actions/unit1.pas
Normal file
337
spktoolbar/demos/actions/unit1.pas
Normal file
@@ -0,0 +1,337 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ActnList,
|
||||
StdActns, StdCtrls, Menus, ComCtrls, ExtCtrls,
|
||||
SpkToolbar, spkt_Buttons, spkt_Checkboxes, spkt_Pane, spkt_Tab, spkt_Appearance;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
AcOpen: TAction;
|
||||
AcClassicalGUI: TAction;
|
||||
AcRibbonGUI: TAction;
|
||||
AcSave: TAction;
|
||||
AcQuit: TAction;
|
||||
AcAutoSave: TAction;
|
||||
AcSaveNow: TAction;
|
||||
AcBold: TAction;
|
||||
AcItalic: TAction;
|
||||
AcLeftJustify: TAction;
|
||||
AcCenter: TAction;
|
||||
AcRightJustify: TAction;
|
||||
AcAbout: TAction;
|
||||
AcUnderline: TAction;
|
||||
ActionList: TActionList;
|
||||
AcEditCopy: TEditCopy;
|
||||
AcEditCut: TEditCut;
|
||||
AcEditPaste: TEditPaste;
|
||||
ImageList: TImageList;
|
||||
Label1: TLabel;
|
||||
LargeImageList: TImageList;
|
||||
MainMenu: TMainMenu;
|
||||
MenuItem1: TMenuItem;
|
||||
MenuItem10: TMenuItem;
|
||||
MenuItem11: TMenuItem;
|
||||
MenuItem12: TMenuItem;
|
||||
MenuItem13: TMenuItem;
|
||||
MenuItem14: TMenuItem;
|
||||
MenuItem15: TMenuItem;
|
||||
MenuItem16: TMenuItem;
|
||||
MenuItem17: TMenuItem;
|
||||
MenuItem18: TMenuItem;
|
||||
MenuItem19: TMenuItem;
|
||||
MenuItem2: TMenuItem;
|
||||
MenuItem20: TMenuItem;
|
||||
MenuItem21: TMenuItem;
|
||||
MenuItem22: TMenuItem;
|
||||
MenuItem23: TMenuItem;
|
||||
MenuItem24: TMenuItem;
|
||||
MenuItem25: TMenuItem;
|
||||
MenuItem26: TMenuItem;
|
||||
MenuItem27: TMenuItem;
|
||||
MenuItem28: TMenuItem;
|
||||
MenuItem29: TMenuItem;
|
||||
MenuItem3: TMenuItem;
|
||||
MenuItem30: TMenuItem;
|
||||
MenuItem31: TMenuItem;
|
||||
MenuItem4: TMenuItem;
|
||||
MenuItem5: TMenuItem;
|
||||
MenuItem6: TMenuItem;
|
||||
MenuItem7: TMenuItem;
|
||||
MenuItem8: TMenuItem;
|
||||
MenuItem9: TMenuItem;
|
||||
Panel1: TPanel;
|
||||
SpkLargeButton4: TSpkLargeButton;
|
||||
SpkPane2: TSpkPane;
|
||||
SpkPane4: TSpkPane;
|
||||
SpkSmallButton10: TSpkSmallButton;
|
||||
SpkSmallButton11: TSpkSmallButton;
|
||||
SpkSmallButton4: TSpkSmallButton;
|
||||
SpkSmallButton6: TSpkSmallButton;
|
||||
SpkSmallButton8: TSpkSmallButton;
|
||||
SpkSmallButton9: TSpkSmallButton;
|
||||
SpkTab4: TSpkTab;
|
||||
SpkTab5: TSpkTab;
|
||||
StyleMenu: TPopupMenu;
|
||||
SpkCheckbox1: TSpkCheckbox;
|
||||
SpkLargeButton1: TSpkLargeButton;
|
||||
SpkLargeButton2: TSpkLargeButton;
|
||||
SpkLargeButton3: TSpkLargeButton;
|
||||
SpkPane1: TSpkPane;
|
||||
SpkPane3: TSpkPane;
|
||||
SpkPane5: TSpkPane;
|
||||
SpkPane6: TSpkPane;
|
||||
SpkRadioButton1: TSpkRadioButton;
|
||||
SpkRadioButton2: TSpkRadioButton;
|
||||
SpkSmallButton1: TSpkSmallButton;
|
||||
SpkSmallButton2: TSpkSmallButton;
|
||||
SpkSmallButton3: TSpkSmallButton;
|
||||
SpkSmallButton5: TSpkSmallButton;
|
||||
SpkSmallButton7: TSpkSmallButton;
|
||||
SpkTab1: TSpkTab;
|
||||
SpkTab2: TSpkTab;
|
||||
SpkTab3: TSpkTab;
|
||||
SpkToolbar1: TSpkToolbar;
|
||||
ToolBar1: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton10: TToolButton;
|
||||
ToolButton11: TToolButton;
|
||||
ToolButton12: TToolButton;
|
||||
ToolButton13: TToolButton;
|
||||
ToolButton14: TToolButton;
|
||||
ToolButton15: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
ToolButton6: TToolButton;
|
||||
ToolButton7: TToolButton;
|
||||
ToolButton8: TToolButton;
|
||||
ToolButton9: TToolButton;
|
||||
procedure AcAboutExecute(Sender: TObject);
|
||||
procedure AcAutoSaveExecute(Sender: TObject);
|
||||
procedure AcBoldExecute(Sender: TObject);
|
||||
procedure AcCenterExecute(Sender: TObject);
|
||||
procedure AcClassicalGUIExecute(Sender: TObject);
|
||||
procedure AcEditCopyExecute(Sender: TObject);
|
||||
procedure AcEditCutExecute(Sender: TObject);
|
||||
procedure AcEditPasteExecute(Sender: TObject);
|
||||
procedure AcItalicExecute(Sender: TObject);
|
||||
procedure AcLeftJustifyExecute(Sender: TObject);
|
||||
procedure AcOpenExecute(Sender: TObject);
|
||||
procedure AcQuitExecute(Sender: TObject);
|
||||
procedure AcRibbonGUIExecute(Sender: TObject);
|
||||
procedure AcRightJustifyExecute(Sender: TObject);
|
||||
procedure AcSaveExecute(Sender: TObject);
|
||||
procedure AcSaveNowExecute(Sender: TObject);
|
||||
procedure AcUnderlineExecute(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure StyleMenuClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
procedure LoadFromIni;
|
||||
procedure SaveToIni;
|
||||
procedure SetStyle(AStyle: TSpkStyle);
|
||||
procedure SetUserInterface(Ribbon:boolean);
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
inifiles, unit2;
|
||||
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.AcClassicalGUIExecute(Sender: TObject);
|
||||
begin
|
||||
SetUserInterface(false);
|
||||
end;
|
||||
|
||||
procedure TForm1.AcAboutExecute(Sender: TObject);
|
||||
var
|
||||
F: TAboutForm;
|
||||
begin
|
||||
F := TAboutForm.Create(nil);
|
||||
try
|
||||
F.ShowModal;
|
||||
finally
|
||||
F.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.AcAutoSaveExecute(Sender: TObject);
|
||||
begin
|
||||
// Checked is handled by "AutoCheck". Need this method to have the action enabled.
|
||||
end;
|
||||
|
||||
procedure TForm1.AcBoldExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Bold" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcCenterExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Center" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcEditCopyExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Copy" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcEditCutExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Cut" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcEditPasteExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Paste" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcItalicExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Italic" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcLeftJustifyExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Left-justify" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcOpenExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Open" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcQuitExecute(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TForm1.AcRibbonGUIExecute(Sender: TObject);
|
||||
begin
|
||||
SetUserInterface(true);
|
||||
end;
|
||||
|
||||
procedure TForm1.AcRightJustifyExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Right-justify" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcSaveExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Save" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcSaveNowExecute(Sender: TObject);
|
||||
begin
|
||||
SaveToIni;
|
||||
end;
|
||||
|
||||
procedure TForm1.AcUnderlineExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Underline" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
begin
|
||||
if CanClose then
|
||||
if MessageDlg('Do you really want to close this application?', mtConfirmation,
|
||||
[mbYes, mbNo], 0) <> mrYes
|
||||
then
|
||||
CanClose := false;
|
||||
if CanClose then
|
||||
if AcAutoSave.Checked then
|
||||
SaveToIni;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
SetUserInterface(true);
|
||||
Label1.Caption := '';
|
||||
LoadFromIni;
|
||||
end;
|
||||
|
||||
procedure TForm1.LoadFromIni;
|
||||
var
|
||||
ini: TCustomIniFile;
|
||||
begin
|
||||
ini := TMemIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
|
||||
try
|
||||
SetUserInterface(ini.ReadBool('MainForm', 'RibbonInterface', AcRibbonGUI.Checked));
|
||||
SpkToolbar1.Style := TSpkStyle(ini.ReadInteger('MainForm', 'RibbonStyle', 0));
|
||||
SetStyle(SpkToolbar1.Style);
|
||||
finally
|
||||
ini.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.StyleMenuClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
// SpkToolbar1.Style := TSpkStyle((Sender as TMenuItem).Tag);
|
||||
for i:=0 to StyleMenu.Items.Count-1 do
|
||||
StyleMenu.Items[i].Checked := StyleMenu.Items[i] = TMenuItem(Sender);
|
||||
SetStyle(TSpkStyle((Sender as TMenuItem).Tag));
|
||||
end;
|
||||
|
||||
procedure TForm1.SetStyle(AStyle: TSpkStyle);
|
||||
begin
|
||||
SpkToolbar1.Style := AStyle;
|
||||
case SpkToolbar1.Style of
|
||||
spkOffice2007Blue : SpkToolbar1.Color := clSkyBlue;
|
||||
spkOffice2007Silver : SpkToolbar1.Color := clWhite;
|
||||
spkOffice2007SilverTurquoise : SpkToolbar1.Color := clWhite;
|
||||
spkMetroLight : SpkToolbar1.Color := clSilver;
|
||||
spkMetroDark : SpkToolbar1.Color := $080808;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.SaveToIni;
|
||||
var
|
||||
ini: TCustomIniFile;
|
||||
begin
|
||||
ini := TMemIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
|
||||
try
|
||||
ini.WriteBool('MainForm', 'RibbonInterface', AcRibbonGUI.Checked);
|
||||
ini.WriteInteger('MainForm', 'RibbonStyle', ord(SpkToolbar1.Style));
|
||||
finally
|
||||
ini.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.SetUserInterface(Ribbon: boolean);
|
||||
begin
|
||||
if Ribbon then begin
|
||||
Menu := nil;
|
||||
Toolbar1.Hide;
|
||||
SpkToolbar1.Show;
|
||||
AcRibbonGUI.Checked := true;
|
||||
end else begin
|
||||
SpkToolbar1.Hide;
|
||||
Menu := MainMenu;
|
||||
Toolbar1.Show;
|
||||
AcClassicalGUI.Checked := true;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
63
spktoolbar/demos/actions/unit2.lfm
Normal file
63
spktoolbar/demos/actions/unit2.lfm
Normal file
@@ -0,0 +1,63 @@
|
||||
object AboutForm: TAboutForm
|
||||
Left = 419
|
||||
Height = 185
|
||||
Top = 225
|
||||
Width = 320
|
||||
Caption = 'About...'
|
||||
ClientHeight = 185
|
||||
ClientWidth = 320
|
||||
Position = poMainFormCenter
|
||||
LCLVersion = '1.9.0.0'
|
||||
object Label1: TLabel
|
||||
Left = 0
|
||||
Height = 30
|
||||
Top = 24
|
||||
Width = 320
|
||||
Align = alTop
|
||||
Alignment = taCenter
|
||||
BorderSpacing.Top = 24
|
||||
Caption = 'SpkToolbar Demo'
|
||||
Font.Height = -21
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 70
|
||||
Width = 320
|
||||
Align = alTop
|
||||
Alignment = taCenter
|
||||
BorderSpacing.Top = 16
|
||||
Caption = 'Icons kindly provided by'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 89
|
||||
Width = 320
|
||||
Align = alTop
|
||||
Alignment = taCenter
|
||||
BorderSpacing.Top = 4
|
||||
Caption = 'http://www.fatcow.com/free-icons'
|
||||
Font.Color = clBlue
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
OnClick = Label3Click
|
||||
OnMouseEnter = Label3MouseEnter
|
||||
OnMouseLeave = Label3MouseLeave
|
||||
end
|
||||
object BtnClose: TButton
|
||||
Left = 128
|
||||
Height = 25
|
||||
Top = 136
|
||||
Width = 75
|
||||
Cancel = True
|
||||
Caption = 'Close'
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
56
spktoolbar/demos/actions/unit2.pas
Normal file
56
spktoolbar/demos/actions/unit2.pas
Normal file
@@ -0,0 +1,56 @@
|
||||
unit Unit2;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TAboutForm }
|
||||
|
||||
TAboutForm = class(TForm)
|
||||
BtnClose: TButton;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
procedure Label3Click(Sender: TObject);
|
||||
procedure Label3MouseEnter(Sender: TObject);
|
||||
procedure Label3MouseLeave(Sender: TObject);
|
||||
private
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
AboutForm: TAboutForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
LCLIntf;
|
||||
|
||||
{ TAboutForm }
|
||||
|
||||
procedure TAboutForm.Label3Click(Sender: TObject);
|
||||
begin
|
||||
OpenURL(TLabel(Sender).Caption);
|
||||
end;
|
||||
|
||||
procedure TAboutForm.Label3MouseEnter(Sender: TObject);
|
||||
begin
|
||||
Label3.Font.Style := [fsUnderline];
|
||||
end;
|
||||
|
||||
procedure TAboutForm.Label3MouseLeave(Sender: TObject);
|
||||
begin
|
||||
Label3.Font.Style := [];
|
||||
end;
|
||||
|
||||
end.
|
||||
|
103
spktoolbar/demos/actions_hidpi/project1.lpi
Normal file
103
spktoolbar/demos/actions_hidpi/project1.lpi
Normal file
@@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<FormatVersion Value="2"/>
|
||||
<Modes Count="1">
|
||||
<Mode0 Name="default"/>
|
||||
</Modes>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="SpkToolbarPackage"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
<Unit2>
|
||||
<Filename Value="unit2.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="AboutForm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit2"/>
|
||||
</Unit2>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="bin\project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
25
spktoolbar/demos/actions_hidpi/project1.lpr
Normal file
25
spktoolbar/demos/actions_hidpi/project1.lpr
Normal file
@@ -0,0 +1,25 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
LCLVersion, Forms, Unit1, Unit2
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
{$IF LCL_FullVersion < 1090000}
|
||||
*** This demo requires Laz version >= 1.9 ***
|
||||
{$ENDIF}
|
||||
Application.Scaled:=True;
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
5162
spktoolbar/demos/actions_hidpi/unit1.lfm
Normal file
5162
spktoolbar/demos/actions_hidpi/unit1.lfm
Normal file
File diff suppressed because it is too large
Load Diff
338
spktoolbar/demos/actions_hidpi/unit1.pas
Normal file
338
spktoolbar/demos/actions_hidpi/unit1.pas
Normal file
@@ -0,0 +1,338 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ActnList,
|
||||
StdActns, StdCtrls, Menus, ComCtrls, ExtCtrls,
|
||||
SpkToolbar, spkt_Buttons, spkt_Checkboxes, spkt_Pane, spkt_Tab, spkt_Appearance;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
AcOpen: TAction;
|
||||
AcClassicalGUI: TAction;
|
||||
AcRibbonGUI: TAction;
|
||||
AcSave: TAction;
|
||||
AcQuit: TAction;
|
||||
AcAutoSave: TAction;
|
||||
AcSaveNow: TAction;
|
||||
AcBold: TAction;
|
||||
AcItalic: TAction;
|
||||
AcLeftJustify: TAction;
|
||||
AcCenter: TAction;
|
||||
AcRightJustify: TAction;
|
||||
AcAbout: TAction;
|
||||
AcUnderline: TAction;
|
||||
ActionList: TActionList;
|
||||
AcEditCopy: TEditCopy;
|
||||
AcEditCut: TEditCut;
|
||||
AcEditPaste: TEditPaste;
|
||||
ImageList: TImageList;
|
||||
HiResImages: TImageList;
|
||||
Label1: TLabel;
|
||||
LargeImageList: TImageList;
|
||||
MainMenu: TMainMenu;
|
||||
MenuItem1: TMenuItem;
|
||||
MenuItem10: TMenuItem;
|
||||
MenuItem11: TMenuItem;
|
||||
MenuItem12: TMenuItem;
|
||||
MenuItem13: TMenuItem;
|
||||
MenuItem14: TMenuItem;
|
||||
MenuItem15: TMenuItem;
|
||||
MenuItem16: TMenuItem;
|
||||
MenuItem17: TMenuItem;
|
||||
MenuItem18: TMenuItem;
|
||||
MenuItem19: TMenuItem;
|
||||
MenuItem2: TMenuItem;
|
||||
MenuItem20: TMenuItem;
|
||||
MenuItem21: TMenuItem;
|
||||
MenuItem22: TMenuItem;
|
||||
MenuItem23: TMenuItem;
|
||||
MenuItem24: TMenuItem;
|
||||
MenuItem25: TMenuItem;
|
||||
MenuItem26: TMenuItem;
|
||||
MenuItem27: TMenuItem;
|
||||
MenuItem28: TMenuItem;
|
||||
MenuItem29: TMenuItem;
|
||||
MenuItem3: TMenuItem;
|
||||
MenuItem30: TMenuItem;
|
||||
MenuItem31: TMenuItem;
|
||||
MenuItem4: TMenuItem;
|
||||
MenuItem5: TMenuItem;
|
||||
MenuItem6: TMenuItem;
|
||||
MenuItem7: TMenuItem;
|
||||
MenuItem8: TMenuItem;
|
||||
MenuItem9: TMenuItem;
|
||||
Panel1: TPanel;
|
||||
SpkLargeButton4: TSpkLargeButton;
|
||||
SpkPane2: TSpkPane;
|
||||
SpkPane4: TSpkPane;
|
||||
SpkSmallButton10: TSpkSmallButton;
|
||||
SpkSmallButton11: TSpkSmallButton;
|
||||
SpkSmallButton4: TSpkSmallButton;
|
||||
SpkSmallButton6: TSpkSmallButton;
|
||||
SpkSmallButton8: TSpkSmallButton;
|
||||
SpkSmallButton9: TSpkSmallButton;
|
||||
SpkTab4: TSpkTab;
|
||||
SpkTab5: TSpkTab;
|
||||
StyleMenu: TPopupMenu;
|
||||
SpkCheckbox1: TSpkCheckbox;
|
||||
SpkLargeButton1: TSpkLargeButton;
|
||||
SpkLargeButton2: TSpkLargeButton;
|
||||
SpkLargeButton3: TSpkLargeButton;
|
||||
SpkPane1: TSpkPane;
|
||||
SpkPane3: TSpkPane;
|
||||
SpkPane5: TSpkPane;
|
||||
SpkPane6: TSpkPane;
|
||||
SpkRadioButton1: TSpkRadioButton;
|
||||
SpkRadioButton2: TSpkRadioButton;
|
||||
SpkSmallButton1: TSpkSmallButton;
|
||||
SpkSmallButton2: TSpkSmallButton;
|
||||
SpkSmallButton3: TSpkSmallButton;
|
||||
SpkSmallButton5: TSpkSmallButton;
|
||||
SpkSmallButton7: TSpkSmallButton;
|
||||
SpkTab1: TSpkTab;
|
||||
SpkTab2: TSpkTab;
|
||||
SpkTab3: TSpkTab;
|
||||
SpkToolbar1: TSpkToolbar;
|
||||
ToolBar1: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton10: TToolButton;
|
||||
ToolButton11: TToolButton;
|
||||
ToolButton12: TToolButton;
|
||||
ToolButton13: TToolButton;
|
||||
ToolButton14: TToolButton;
|
||||
ToolButton15: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
ToolButton5: TToolButton;
|
||||
ToolButton6: TToolButton;
|
||||
ToolButton7: TToolButton;
|
||||
ToolButton8: TToolButton;
|
||||
ToolButton9: TToolButton;
|
||||
procedure AcAboutExecute(Sender: TObject);
|
||||
procedure AcAutoSaveExecute(Sender: TObject);
|
||||
procedure AcBoldExecute(Sender: TObject);
|
||||
procedure AcCenterExecute(Sender: TObject);
|
||||
procedure AcClassicalGUIExecute(Sender: TObject);
|
||||
procedure AcEditCopyExecute(Sender: TObject);
|
||||
procedure AcEditCutExecute(Sender: TObject);
|
||||
procedure AcEditPasteExecute(Sender: TObject);
|
||||
procedure AcItalicExecute(Sender: TObject);
|
||||
procedure AcLeftJustifyExecute(Sender: TObject);
|
||||
procedure AcOpenExecute(Sender: TObject);
|
||||
procedure AcQuitExecute(Sender: TObject);
|
||||
procedure AcRibbonGUIExecute(Sender: TObject);
|
||||
procedure AcRightJustifyExecute(Sender: TObject);
|
||||
procedure AcSaveExecute(Sender: TObject);
|
||||
procedure AcSaveNowExecute(Sender: TObject);
|
||||
procedure AcUnderlineExecute(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure StyleMenuClick(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
procedure LoadFromIni;
|
||||
procedure SaveToIni;
|
||||
procedure SetStyle(AStyle: TSpkStyle);
|
||||
procedure SetUserInterface(Ribbon:boolean);
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
inifiles, unit2;
|
||||
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.AcClassicalGUIExecute(Sender: TObject);
|
||||
begin
|
||||
SetUserInterface(false);
|
||||
end;
|
||||
|
||||
procedure TForm1.AcAboutExecute(Sender: TObject);
|
||||
var
|
||||
F: TAboutForm;
|
||||
begin
|
||||
F := TAboutForm.Create(nil);
|
||||
try
|
||||
F.ShowModal;
|
||||
finally
|
||||
F.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.AcAutoSaveExecute(Sender: TObject);
|
||||
begin
|
||||
// Checked is handled by "AutoCheck". Need this method to have the action enabled.
|
||||
end;
|
||||
|
||||
procedure TForm1.AcBoldExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Bold" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcCenterExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Center" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcEditCopyExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Copy" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcEditCutExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Cut" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcEditPasteExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Paste" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcItalicExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Italic" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcLeftJustifyExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Left-justify" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcOpenExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Open" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcQuitExecute(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TForm1.AcRibbonGUIExecute(Sender: TObject);
|
||||
begin
|
||||
SetUserInterface(true);
|
||||
end;
|
||||
|
||||
procedure TForm1.AcRightJustifyExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Right-justify" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcSaveExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Save" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.AcSaveNowExecute(Sender: TObject);
|
||||
begin
|
||||
SaveToIni;
|
||||
end;
|
||||
|
||||
procedure TForm1.AcUnderlineExecute(Sender: TObject);
|
||||
begin
|
||||
Label1.Caption := '"Underline" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||
begin
|
||||
if CanClose then
|
||||
if MessageDlg('Do you really want to close this application?', mtConfirmation,
|
||||
[mbYes, mbNo], 0) <> mrYes
|
||||
then
|
||||
CanClose := false;
|
||||
if CanClose then
|
||||
if AcAutoSave.Checked then
|
||||
SaveToIni;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
SetUserInterface(true);
|
||||
Label1.Caption := '';
|
||||
LoadFromIni;
|
||||
end;
|
||||
|
||||
procedure TForm1.LoadFromIni;
|
||||
var
|
||||
ini: TCustomIniFile;
|
||||
begin
|
||||
ini := TMemIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
|
||||
try
|
||||
SetUserInterface(ini.ReadBool('MainForm', 'RibbonInterface', AcRibbonGUI.Checked));
|
||||
SpkToolbar1.Style := TSpkStyle(ini.ReadInteger('MainForm', 'RibbonStyle', 0));
|
||||
SetStyle(SpkToolbar1.Style);
|
||||
finally
|
||||
ini.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.StyleMenuClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
// SpkToolbar1.Style := TSpkStyle((Sender as TMenuItem).Tag);
|
||||
for i:=0 to StyleMenu.Items.Count-1 do
|
||||
StyleMenu.Items[i].Checked := StyleMenu.Items[i] = TMenuItem(Sender);
|
||||
SetStyle(TSpkStyle((Sender as TMenuItem).Tag));
|
||||
end;
|
||||
|
||||
procedure TForm1.SetStyle(AStyle: TSpkStyle);
|
||||
begin
|
||||
SpkToolbar1.Style := AStyle;
|
||||
case SpkToolbar1.Style of
|
||||
spkOffice2007Blue : SpkToolbar1.Color := clSkyBlue;
|
||||
spkOffice2007Silver : SpkToolbar1.Color := clWhite;
|
||||
spkOffice2007SilverTurquoise : SpkToolbar1.Color := clWhite;
|
||||
spkMetroLight : SpkToolbar1.Color := clSilver;
|
||||
spkMetroDark : SpkToolbar1.Color := $080808;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.SaveToIni;
|
||||
var
|
||||
ini: TCustomIniFile;
|
||||
begin
|
||||
ini := TMemIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
|
||||
try
|
||||
ini.WriteBool('MainForm', 'RibbonInterface', AcRibbonGUI.Checked);
|
||||
ini.WriteInteger('MainForm', 'RibbonStyle', ord(SpkToolbar1.Style));
|
||||
finally
|
||||
ini.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.SetUserInterface(Ribbon: boolean);
|
||||
begin
|
||||
if Ribbon then begin
|
||||
Menu := nil;
|
||||
Toolbar1.Hide;
|
||||
SpkToolbar1.Show;
|
||||
AcRibbonGUI.Checked := true;
|
||||
end else begin
|
||||
SpkToolbar1.Hide;
|
||||
Menu := MainMenu;
|
||||
Toolbar1.Show;
|
||||
AcClassicalGUI.Checked := true;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
|
64
spktoolbar/demos/actions_hidpi/unit2.lfm
Normal file
64
spktoolbar/demos/actions_hidpi/unit2.lfm
Normal file
@@ -0,0 +1,64 @@
|
||||
object AboutForm: TAboutForm
|
||||
Left = 419
|
||||
Height = 185
|
||||
Top = 225
|
||||
Width = 320
|
||||
Caption = 'About...'
|
||||
ClientHeight = 185
|
||||
ClientWidth = 320
|
||||
Position = poMainFormCenter
|
||||
LCLVersion = '1.9.0.0'
|
||||
object Label1: TLabel
|
||||
Left = 0
|
||||
Height = 30
|
||||
Top = 24
|
||||
Width = 320
|
||||
Align = alTop
|
||||
Alignment = taCenter
|
||||
BorderSpacing.Top = 24
|
||||
Caption = 'SpkToolbar Demo'
|
||||
Font.Height = -21
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 70
|
||||
Width = 320
|
||||
Align = alTop
|
||||
Alignment = taCenter
|
||||
BorderSpacing.Top = 16
|
||||
Caption = 'Icons kindly provided by'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
Cursor = crHandPoint
|
||||
Left = 0
|
||||
Height = 15
|
||||
Top = 89
|
||||
Width = 320
|
||||
Align = alTop
|
||||
Alignment = taCenter
|
||||
BorderSpacing.Top = 4
|
||||
Caption = 'https://icons8.com/'
|
||||
Font.Color = clBlue
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
OnClick = Label3Click
|
||||
OnMouseEnter = Label3MouseEnter
|
||||
OnMouseLeave = Label3MouseLeave
|
||||
end
|
||||
object BtnClose: TButton
|
||||
Left = 128
|
||||
Height = 25
|
||||
Top = 136
|
||||
Width = 75
|
||||
Cancel = True
|
||||
Caption = 'Close'
|
||||
Default = True
|
||||
ModalResult = 1
|
||||
TabOrder = 0
|
||||
end
|
||||
end
|
56
spktoolbar/demos/actions_hidpi/unit2.pas
Normal file
56
spktoolbar/demos/actions_hidpi/unit2.pas
Normal file
@@ -0,0 +1,56 @@
|
||||
unit Unit2;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
|
||||
|
||||
type
|
||||
|
||||
{ TAboutForm }
|
||||
|
||||
TAboutForm = class(TForm)
|
||||
BtnClose: TButton;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
procedure Label3Click(Sender: TObject);
|
||||
procedure Label3MouseEnter(Sender: TObject);
|
||||
procedure Label3MouseLeave(Sender: TObject);
|
||||
private
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
AboutForm: TAboutForm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
LCLIntf;
|
||||
|
||||
{ TAboutForm }
|
||||
|
||||
procedure TAboutForm.Label3Click(Sender: TObject);
|
||||
begin
|
||||
OpenURL(TLabel(Sender).Caption);
|
||||
end;
|
||||
|
||||
procedure TAboutForm.Label3MouseEnter(Sender: TObject);
|
||||
begin
|
||||
Label3.Font.Style := [fsUnderline];
|
||||
end;
|
||||
|
||||
procedure TAboutForm.Label3MouseLeave(Sender: TObject);
|
||||
begin
|
||||
Label3.Font.Style := [];
|
||||
end;
|
||||
|
||||
end.
|
||||
|
98
spktoolbar/demos/basic/Project1.lpi
Normal file
98
spktoolbar/demos/basic/Project1.lpi
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<MainUnitHasUsesSectionForAllUnits Value="False"/>
|
||||
<MainUnitHasCreateFormStatements Value="False"/>
|
||||
<MainUnitHasTitleStatement Value="False"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="SpkToolbarPackage"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="Project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="Unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form2"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="bin\project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
<Optimizations>
|
||||
<OptimizationLevel Value="2"/>
|
||||
</Optimizations>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
16
spktoolbar/demos/basic/Project1.lpr
Normal file
16
spktoolbar/demos/basic/Project1.lpr
Normal file
@@ -0,0 +1,16 @@
|
||||
program Project1;
|
||||
|
||||
{$MODE Delphi}
|
||||
|
||||
uses
|
||||
Forms, Interfaces,
|
||||
Unit1 in 'Unit1.pas' {Form2};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
// Application.MainFormOnTaskbar := True;
|
||||
Application.CreateForm(TForm2, Form2);
|
||||
Application.Run;
|
||||
end.
|
2979
spktoolbar/demos/basic/Unit1.lfm
Normal file
2979
spktoolbar/demos/basic/Unit1.lfm
Normal file
File diff suppressed because it is too large
Load Diff
116
spktoolbar/demos/basic/Unit1.pas
Normal file
116
spktoolbar/demos/basic/Unit1.pas
Normal file
@@ -0,0 +1,116 @@
|
||||
unit Unit1;
|
||||
|
||||
{$MODE Delphi}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
LCLIntf, LCLType, LMessages, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, SpkToolbar, StdCtrls, ExtCtrls, SpkGUITools, SpkMath, SpkGraphTools,
|
||||
Spin, spkt_Tab, spkt_Pane, ActnList, {ButtonGroup,} Menus, spkt_Types,
|
||||
spkt_Tools, ImgList, spkt_BaseItem, spkt_Buttons;
|
||||
|
||||
type
|
||||
TForm2 = class(TForm)
|
||||
ActionList1: TActionList;
|
||||
Action1: TAction;
|
||||
PopupMenu1: TPopupMenu;
|
||||
LargeImages: TImageList;
|
||||
Images: TImageList;
|
||||
SpkToolbar1: TSpkToolbar;
|
||||
SpkTab1: TSpkTab;
|
||||
CUsersSpookDokumenty1: TMenuItem;
|
||||
DDokumenty1: TMenuItem;
|
||||
SpkPane2: TSpkPane;
|
||||
SpkSmallButton2: TSpkSmallButton;
|
||||
SpkSmallButton3: TSpkSmallButton;
|
||||
SpkSmallButton4: TSpkSmallButton;
|
||||
SpkLargeButton4: TSpkLargeButton;
|
||||
SpkPane3: TSpkPane;
|
||||
SpkSmallButton1: TSpkSmallButton;
|
||||
SpkSmallButton5: TSpkSmallButton;
|
||||
SpkSmallButton6: TSpkSmallButton;
|
||||
SpkSmallButton7: TSpkSmallButton;
|
||||
SpkSmallButton8: TSpkSmallButton;
|
||||
SpkPane4: TSpkPane;
|
||||
SpkSmallButton10: TSpkSmallButton;
|
||||
SpkLargeButton5: TSpkLargeButton;
|
||||
SpkSmallButton9: TSpkSmallButton;
|
||||
SpkTab2: TSpkTab;
|
||||
SpkPane5: TSpkPane;
|
||||
SpkLargeButton6: TSpkLargeButton;
|
||||
SpkLargeButton7: TSpkLargeButton;
|
||||
SpkLargeButton8: TSpkLargeButton;
|
||||
PopupMenu2: TPopupMenu;
|
||||
Recent11: TMenuItem;
|
||||
Recent21: TMenuItem;
|
||||
Recent31: TMenuItem;
|
||||
SpkPane1: TSpkPane;
|
||||
SpkLargeButton1: TSpkLargeButton;
|
||||
SpkLargeButton2: TSpkLargeButton;
|
||||
SpkLargeButton3: TSpkLargeButton;
|
||||
SpkPane6: TSpkPane;
|
||||
SpkSmallButton11: TSpkSmallButton;
|
||||
SpkSmallButton12: TSpkSmallButton;
|
||||
SpkSmallButton13: TSpkSmallButton;
|
||||
procedure Button2Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form2: TForm2;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
procedure TForm2.Button2Click(Sender: TObject);
|
||||
|
||||
var i,j,k : integer;
|
||||
Item : TSpkSmallButton;
|
||||
Pane : TSpkPane;
|
||||
Tab : TSpkTab;
|
||||
|
||||
begin
|
||||
SpkToolbar1.BeginUpdate;
|
||||
|
||||
for i := 0 to 20 do
|
||||
Tab:=SpkToolbar1.Tabs.add;
|
||||
|
||||
for k := 0 to 6 do
|
||||
begin
|
||||
Pane:=SpkTab1.Panes.Add;
|
||||
for j := 0 to 2 do
|
||||
begin
|
||||
Item:=Pane.Items.AddSmallButton;
|
||||
Item.TableBehaviour:=tbBeginsRow;
|
||||
//Item.GroupBehaviour:=gbBeginsGroup;
|
||||
Item.ShowCaption:=false;
|
||||
Item.ImageIndex:=random(50);
|
||||
//Item.DropdownMenu:=PopupMenu1;
|
||||
|
||||
for i := 0 to 4 do
|
||||
begin
|
||||
Item:=Pane.Items.AddSmallButton;
|
||||
Item.ShowCaption:=false;
|
||||
Item.ImageIndex:=random(50);
|
||||
//Item.GroupBehaviour:=gbContinuesGroup;
|
||||
//Item.DropdownMenu:=PopupMenu1;
|
||||
end;
|
||||
|
||||
Item:=Pane.Items.AddSmallButton;
|
||||
Item.TableBehaviour:=tbContinuesRow;
|
||||
//Item.GroupBehaviour:=gbEndsGroup;
|
||||
Item.ShowCaption:=false;
|
||||
Item.ImageIndex:=random(50);
|
||||
//Item.DropdownMenu:=PopupMenu1;
|
||||
end;
|
||||
end;
|
||||
|
||||
SpkToolbar1.EndUpdate;
|
||||
end;
|
||||
|
||||
end.
|
92
spktoolbar/demos/runtime/project1.lpi
Normal file
92
spktoolbar/demos/runtime/project1.lpi
Normal file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="SpkToolbarPackage"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="bin\project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<OtherUnitFiles Value="..\..\SpkToolbar"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<CodeGeneration>
|
||||
<SmartLinkUnit Value="True"/>
|
||||
</CodeGeneration>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<DebugInfoType Value="dsDwarf2"/>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<LinkSmart Value="True"/>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
21
spktoolbar/demos/runtime/project1.lpr
Normal file
21
spktoolbar/demos/runtime/project1.lpr
Normal file
@@ -0,0 +1,21 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
1680
spktoolbar/demos/runtime/unit1.lfm
Normal file
1680
spktoolbar/demos/runtime/unit1.lfm
Normal file
File diff suppressed because it is too large
Load Diff
463
spktoolbar/demos/runtime/unit1.pas
Normal file
463
spktoolbar/demos/runtime/unit1.pas
Normal file
@@ -0,0 +1,463 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, SpkToolbar,
|
||||
SpkGUITools, SpkMath, SpkGraphTools, spkt_Tab, spkt_Pane, spkt_Types,
|
||||
spkt_Tools, ImgList, ComCtrls, Menus, Grids, ExtCtrls, StdCtrls,
|
||||
spkt_BaseItem, spkt_Buttons, spkt_Checkboxes;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
ImageList: TImageList;
|
||||
LargeImageList: TImageList;
|
||||
MenuItem1: TMenuItem;
|
||||
MenuItem2: TMenuItem;
|
||||
MenuItem3: TMenuItem;
|
||||
MnuOffice2007Blue: TMenuItem;
|
||||
MnuOffice2007Silver1: TMenuItem;
|
||||
MnuOffice2007Silver2: TMenuItem;
|
||||
MnuMetroLight: TMenuItem;
|
||||
MnuMetroDark: TMenuItem;
|
||||
Panel1: TPanel;
|
||||
SpkLargeButton1: TSpkLargeButton;
|
||||
SpkLargeButton2: TSpkLargeButton;
|
||||
SpkPane2: TSpkPane;
|
||||
StylePopupMenu: TPopupMenu;
|
||||
RecentFilesPopupMenu: TPopupMenu;
|
||||
SpkPane1: TSpkPane;
|
||||
SpkSmallButton1: TSpkSmallButton;
|
||||
SpkSmallButton2: TSpkSmallButton;
|
||||
SpkSmallButton3: TSpkSmallButton;
|
||||
SpkTab1: TSpkTab;
|
||||
StatusBar1: TStatusBar;
|
||||
StringGrid1: TStringGrid;
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure StyleChangeHandler(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
SpkToolbar : TSpkToolbar;
|
||||
CbHorizGrid : TSpkCheckbox;
|
||||
CbVertGrid: TSpkCheckbox;
|
||||
CbRowSelect: TSpkCheckbox;
|
||||
procedure AboutHandler(Sender: TObject);
|
||||
procedure FileOpenHandler(Sender: TObject);
|
||||
procedure FileSaveHandler(Sender: TObject);
|
||||
procedure FileQuitHandler(Sender: TObject);
|
||||
procedure HorizontalGridLinesHandler(Sender: TObject);
|
||||
procedure VerticalGridLinesHandler(Sender: TObject);
|
||||
procedure RowSelectHandler(Sender: TObject);
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
LCLIntf, spkt_Appearance;
|
||||
|
||||
{ TAboutForm }
|
||||
type
|
||||
TAboutForm = class(TForm)
|
||||
private
|
||||
FIconLink: TLabel;
|
||||
procedure LinkClickHandler(Sender: TObject);
|
||||
procedure LinkMouseEnterHandler(Sender: TObject);
|
||||
procedure LinkMouseLeaveHandler(Sender: TObject);
|
||||
public
|
||||
constructor CreateNew(AOwner: TComponent; Num: Integer = 0); override;
|
||||
end;
|
||||
|
||||
constructor TAboutForm.CreateNew(AOwner: TComponent; Num: Integer = 0);
|
||||
begin
|
||||
inherited;
|
||||
Width := 300;
|
||||
Height := 180;
|
||||
Caption := 'About';
|
||||
Position := poMainFormCenter;
|
||||
with TLabel.Create(self) do begin
|
||||
Caption := 'SpkToolbar demo';
|
||||
Parent := self;
|
||||
Align := alTop;
|
||||
BorderSpacing.Top := 16;
|
||||
Font.Size := 16;
|
||||
Alignment := taCenter;
|
||||
end;
|
||||
with TLabel.Create(self) do begin
|
||||
Caption := 'Icons kindly provided by';
|
||||
Parent := self;
|
||||
Align := alTop;
|
||||
Alignment := taCenter;
|
||||
BorderSpacing.Top := 16;
|
||||
Left := 16;
|
||||
Top := 999;
|
||||
end;
|
||||
FIconLink := TLabel.Create(self);
|
||||
with FIconLink do begin
|
||||
Caption := 'http://www.fatcow.com/free-icons';
|
||||
Font.Color := clBlue;
|
||||
//Font.Style := [fsUnderline];
|
||||
Parent := self;
|
||||
Align := alTop;
|
||||
Alignment := taCenter;
|
||||
Top := 9999;
|
||||
OnClick := @LinkClickHandler;
|
||||
OnMouseEnter := @LinkMouseEnterHandler;
|
||||
OnMouseLeave := @LinkMouseLeaveHandler;
|
||||
end;
|
||||
with TButton.Create(self) do begin
|
||||
Caption := 'Close';
|
||||
Parent := Self;
|
||||
Left := (Self.Width - Width) div 2;
|
||||
Top := Self.Height - 16 - Height;
|
||||
ModalResult := mrOK;
|
||||
Default := true;
|
||||
Cancel := true;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TAboutForm.LinkClickHandler(Sender: TObject);
|
||||
begin
|
||||
OpenURL((Sender as TLabel).Caption);
|
||||
end;
|
||||
|
||||
procedure TAboutForm.LinkMouseEnterHandler(Sender: TObject);
|
||||
begin
|
||||
FIconLink.Font.Style := [fsUnderline];
|
||||
end;
|
||||
|
||||
procedure TAboutForm.LinkMouseLeaveHandler(Sender: TObject);
|
||||
begin
|
||||
FIconLink.Font.Style := [];
|
||||
end;
|
||||
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.AboutHandler(Sender: TObject);
|
||||
var
|
||||
F: TForm;
|
||||
begin
|
||||
F := TAboutForm.CreateNew(nil);
|
||||
try
|
||||
F.ShowModal;
|
||||
finally
|
||||
F.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.FileOpenHandler(Sender: TObject);
|
||||
begin
|
||||
Statusbar1.SimpleText := '"File" / "Open" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.FileSaveHandler(Sender: TObject);
|
||||
begin
|
||||
Statusbar1.SimpleText := '"File" / "Save" clicked';
|
||||
end;
|
||||
|
||||
procedure TForm1.FileQuitHandler(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TForm1.HorizontalGridLinesHandler(Sender: TObject);
|
||||
begin
|
||||
if CbHorizGrid.Checked then
|
||||
StringGrid1.Options := StringGrid1.Options + [goHorzLine]
|
||||
else
|
||||
StringGrid1.Options := StringGrid1.Options - [goHorzLine];
|
||||
end;
|
||||
|
||||
procedure TForm1.VerticalGridLinesHandler(Sender: TObject);
|
||||
begin
|
||||
if CbVertGrid.Checked then
|
||||
StringGrid1.Options := StringGrid1.Options + [goVertLine]
|
||||
else
|
||||
StringGrid1.Options := StringGrid1.Options - [goVertLine];
|
||||
end;
|
||||
|
||||
procedure TForm1.RowSelectHandler(Sender: TObject);
|
||||
begin
|
||||
if CbRowSelect.Checked then
|
||||
StringGrid1.Options := StringGrid1.Options + [goRowSelect]
|
||||
else
|
||||
StringGrid1.Options := StringGrid1.Options - [goRowSelect];
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
SpkToolbar := TSpkToolbar.Create(self);
|
||||
|
||||
with SpkToolbar do begin
|
||||
Parent := self;
|
||||
Appearance.Pane.CaptionFont.Style := [fsBold, fsItalic];
|
||||
Color := clSkyBlue;
|
||||
Images := ImageList;
|
||||
LargeImages := LargeImageList;
|
||||
ShowHint := true;
|
||||
|
||||
with Tabs.Add do begin
|
||||
Caption := 'File';
|
||||
with Panes.Add do begin
|
||||
Caption := 'File commands';
|
||||
with Items.AddLargeButton do begin
|
||||
Caption := 'Open file';
|
||||
ButtonKind := bkButtonDropdown;
|
||||
DropdownMenu := RecentFilesPopupMenu;
|
||||
LargeImageIndex := 1;
|
||||
Hint := 'Open a file';
|
||||
OnClick := @FileOpenHandler;
|
||||
end;
|
||||
with Items.AddLargeButton do begin
|
||||
Caption := 'Save file';
|
||||
LargeImageIndex := 2;
|
||||
Hint := 'Save file';
|
||||
OnClick := @FileSaveHandler;
|
||||
end;
|
||||
with Items.AddLargeButton do begin
|
||||
Caption := 'Quit program';
|
||||
LargeImageIndex := 0;
|
||||
Hint := 'Close application';
|
||||
OnClick := @FileQuitHandler;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
with Tabs.Add do begin
|
||||
Caption := 'Edit';
|
||||
with Panes.Add do begin
|
||||
Caption := 'Edit commands';
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Cut';
|
||||
HideFrameWhenIdle := true;
|
||||
TableBehaviour := tbBeginsRow;
|
||||
ImageIndex := 3;
|
||||
Hint := 'Cut to clipboard';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Copy';
|
||||
HideFrameWhenIdle := true;
|
||||
TableBehaviour := tbBeginsRow;
|
||||
ImageIndex := 4;
|
||||
Hint := 'Copy to clipboard';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Paste';
|
||||
HideFrameWhenIdle := true;
|
||||
TableBehaviour := tbBeginsColumn;
|
||||
ImageIndex := 5;
|
||||
Hint := 'Paste from clipboard';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
with Tabs.Add do begin
|
||||
Caption := 'Format';
|
||||
with Panes.Add do begin
|
||||
Caption := 'Format Settings';
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Bold';
|
||||
ButtonKind := bkToggle;
|
||||
GroupBehaviour := gbBeginsGroup;
|
||||
TableBehaviour := tbBeginsRow;
|
||||
ImageIndex := 6;
|
||||
ShowCaption := false;
|
||||
AllowAllUp := true;
|
||||
Hint := 'Bold';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Italic';
|
||||
ButtonKind := bkToggle;
|
||||
TableBehaviour := tbContinuesRow;
|
||||
GroupBehaviour := gbContinuesGroup;
|
||||
ImageIndex := 7;
|
||||
ShowCaption := false;
|
||||
AllowAllUp := true;
|
||||
Hint := 'Italic';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Underline';
|
||||
ButtonKind := bkToggle;
|
||||
TableBehaviour := tbContinuesRow;
|
||||
GroupBehaviour := gbEndsGroup;
|
||||
ImageIndex := 8;
|
||||
ShowCaption := false;
|
||||
AllowAllUp := true;
|
||||
Hint := 'Underlined';
|
||||
end;
|
||||
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Left-aligned';
|
||||
ButtonKind := bkToggle;
|
||||
GroupBehaviour := gbBeginsGroup;
|
||||
TableBehaviour := tbBeginsRow;
|
||||
ImageIndex := 11;
|
||||
ShowCaption := false;
|
||||
GroupIndex := 2;
|
||||
Checked := true;
|
||||
Hint := 'Left-aligned';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Centered';
|
||||
ButtonKind := bkToggle;
|
||||
TableBehaviour := tbContinuesRow;
|
||||
GroupBehaviour := gbContinuesGroup;
|
||||
ImageIndex := 12;
|
||||
ShowCaption := false;
|
||||
GroupIndex := 2;
|
||||
Checked := false;
|
||||
Hint := 'Centered';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Right-aligned';
|
||||
ButtonKind := bkToggle;
|
||||
TableBehaviour := tbContinuesRow;
|
||||
GroupBehaviour := gbContinuesGroup;
|
||||
ImageIndex := 13;
|
||||
ShowCaption := false;
|
||||
GroupIndex := 2;
|
||||
Hint := 'Right-aligned';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Block';
|
||||
ButtonKind := bkToggle;
|
||||
TableBehaviour := tbContinuesRow;
|
||||
GroupBehaviour := gbEndsGroup;
|
||||
ImageIndex := 14;
|
||||
ShowCaption := false;
|
||||
GroupIndex := 2;
|
||||
Hint := 'Block';
|
||||
end;
|
||||
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Subscript';
|
||||
ButtonKind := bkToggle;
|
||||
TableBehaviour := tbBeginsColumn;
|
||||
GroupBehaviour := gbBeginsGroup;
|
||||
ImageIndex := 9;
|
||||
ShowCaption := false;
|
||||
AllowAllUp := true;
|
||||
GroupIndex := 1;
|
||||
Hint := 'Subscript';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Superscript';
|
||||
ButtonKind := bkToggle;
|
||||
TableBehaviour := tbContinuesRow;
|
||||
GroupBehaviour := gbEndsGroup;
|
||||
ImageIndex := 10;
|
||||
ShowCaption := false;
|
||||
AllowAllUp := true;
|
||||
GroupIndex := 1;
|
||||
Hint := 'Superscript';
|
||||
end;
|
||||
|
||||
With Items.AddSmallButton do begin
|
||||
Enabled := false;
|
||||
TableBehaviour := tbBeginsRow;
|
||||
HideFrameWhenIdle := true;
|
||||
Caption := '';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
with Tabs.Add do begin
|
||||
Caption := 'Options';
|
||||
with Panes.Add do begin
|
||||
Caption := 'Grid settings';
|
||||
CbHorizGrid := Items.AddCheckbox;
|
||||
with CbHorizGrid do begin
|
||||
Caption := 'Horizontal grid lines';
|
||||
TableBehaviour := tbBeginsRow;
|
||||
Checked := true;
|
||||
Hint := 'Show/hide horizontal grid lines';
|
||||
OnClick := @HorizontalGridLinesHandler;
|
||||
end;
|
||||
CbVertGrid := Items.AddCheckbox;
|
||||
with CbVertGrid do begin
|
||||
Caption := 'Vertical grid lines';
|
||||
Hint := 'Show/hide vertical grid lines';
|
||||
TableBehaviour := tbBeginsRow;
|
||||
Checked := true;
|
||||
OnClick := @VerticalGridLinesHandler;
|
||||
end;
|
||||
CbRowSelect := Items.AddCheckbox;
|
||||
with CbRowSelect do begin
|
||||
Caption := 'Row select';
|
||||
TableBehaviour := tbBeginsRow;
|
||||
Checked := false;
|
||||
Hint := 'Select entire row';
|
||||
OnClick := @RowSelectHandler;
|
||||
end;
|
||||
end;
|
||||
with Panes.Add do begin
|
||||
Caption := 'Themes';
|
||||
with Items.AddLargeButton do begin
|
||||
Caption := 'Change style';
|
||||
Hint := 'Change theme';
|
||||
ButtonKind := bkDropdown;
|
||||
DropdownMenu := StylePopupMenu;
|
||||
LargeImageIndex := 7;
|
||||
end;
|
||||
end;
|
||||
with Panes.Add do begin
|
||||
Caption := 'Save settings';
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Save now';
|
||||
Hint := 'Save settings now';
|
||||
ImageIndex := 2;
|
||||
end;
|
||||
with Items.AddCheckbox do begin
|
||||
Caption := 'Auto-save settings';
|
||||
Checked := true;
|
||||
Hint := 'Automatically save settings when program closes';
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
with Tabs.Add do begin
|
||||
Caption := 'Help';
|
||||
with Panes.Add do begin
|
||||
Caption := 'Help commands';
|
||||
with Items.AddLargeButton do begin
|
||||
Caption := 'About...';
|
||||
LargeImageIndex := 6;
|
||||
Hint := 'About this program';
|
||||
OnClick := @AboutHandler;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.StyleChangeHandler(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
for i:=0 to StylePopupMenu.Items.Count-1 do
|
||||
StylePopupMenu.Items[i].Checked := StylePopupMenu.Items[i] = TMenuItem(Sender);
|
||||
SpkToolbar.Style := TSpkStyle((Sender as TMenuItem).Tag);
|
||||
case SpkToolbar.Style of
|
||||
spkOffice2007Blue : SpkToolbar.Color := clSkyBlue;
|
||||
spkOffice2007Silver : SpkToolbar.Color := clWhite;
|
||||
spkOffice2007SilverTurquoise : SpkToolbar.Color := clWhite;
|
||||
spkMetroLight : SpkToolbar.Color := clSilver;
|
||||
spkMetroDark : SpkToolbar.Color := $080808;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
82
spktoolbar/demos/styles/project1.lpi
Normal file
82
spktoolbar/demos/styles/project1.lpi
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<Scaled Value="True"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
</General>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="2">
|
||||
<Item1>
|
||||
<PackageName Value="SpkToolbarPackage"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Debugging>
|
||||
<UseExternalDbgSyms Value="True"/>
|
||||
</Debugging>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
24
spktoolbar/demos/styles/project1.lpr
Normal file
24
spktoolbar/demos/styles/project1.lpr
Normal file
@@ -0,0 +1,24 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
LCLVersion, Forms, Unit1
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
{$IF lcl_fullversion >= 1080000}
|
||||
Application.Scaled := True;
|
||||
{$ENDIF}
|
||||
RequireDerivedFormResource := True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
2217
spktoolbar/demos/styles/unit1.lfm
Normal file
2217
spktoolbar/demos/styles/unit1.lfm
Normal file
File diff suppressed because it is too large
Load Diff
162
spktoolbar/demos/styles/unit1.pas
Normal file
162
spktoolbar/demos/styles/unit1.pas
Normal file
@@ -0,0 +1,162 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||
spktoolbar, spkt_Tab, spkt_Pane, spkt_Buttons, spkt_Checkboxes;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
LargeImages: TImageList;
|
||||
Panel1: TPanel;
|
||||
Panel2: TPanel;
|
||||
Panel3: TPanel;
|
||||
Panel4: TPanel;
|
||||
ScrollBox1: TScrollBox;
|
||||
SmallImages: TImageList;
|
||||
SpkCheckbox1: TSpkCheckbox;
|
||||
SpkCheckbox2: TSpkCheckbox;
|
||||
SpkCheckbox3: TSpkCheckbox;
|
||||
SpkCheckbox4: TSpkCheckbox;
|
||||
SpkCheckbox5: TSpkCheckbox;
|
||||
SpkLargeButton1: TSpkLargeButton;
|
||||
SpkLargeButton10: TSpkLargeButton;
|
||||
SpkLargeButton11: TSpkLargeButton;
|
||||
SpkLargeButton12: TSpkLargeButton;
|
||||
SpkLargeButton13: TSpkLargeButton;
|
||||
SpkLargeButton14: TSpkLargeButton;
|
||||
SpkLargeButton15: TSpkLargeButton;
|
||||
SpkLargeButton2: TSpkLargeButton;
|
||||
SpkLargeButton3: TSpkLargeButton;
|
||||
SpkLargeButton4: TSpkLargeButton;
|
||||
SpkLargeButton5: TSpkLargeButton;
|
||||
SpkLargeButton6: TSpkLargeButton;
|
||||
SpkLargeButton7: TSpkLargeButton;
|
||||
SpkLargeButton8: TSpkLargeButton;
|
||||
SpkLargeButton9: TSpkLargeButton;
|
||||
SpkPane1: TSpkPane;
|
||||
SpkPane10: TSpkPane;
|
||||
SpkPane11: TSpkPane;
|
||||
SpkPane12: TSpkPane;
|
||||
SpkPane13: TSpkPane;
|
||||
SpkPane14: TSpkPane;
|
||||
SpkPane15: TSpkPane;
|
||||
SpkPane16: TSpkPane;
|
||||
SpkPane17: TSpkPane;
|
||||
SpkPane18: TSpkPane;
|
||||
SpkPane19: TSpkPane;
|
||||
SpkPane2: TSpkPane;
|
||||
SpkPane20: TSpkPane;
|
||||
SpkPane3: TSpkPane;
|
||||
SpkPane4: TSpkPane;
|
||||
SpkPane5: TSpkPane;
|
||||
SpkPane6: TSpkPane;
|
||||
SpkPane7: TSpkPane;
|
||||
SpkPane8: TSpkPane;
|
||||
SpkPane9: TSpkPane;
|
||||
SpkSmallButton1: TSpkSmallButton;
|
||||
SpkSmallButton10: TSpkSmallButton;
|
||||
SpkSmallButton11: TSpkSmallButton;
|
||||
SpkSmallButton12: TSpkSmallButton;
|
||||
SpkSmallButton13: TSpkSmallButton;
|
||||
SpkSmallButton14: TSpkSmallButton;
|
||||
SpkSmallButton15: TSpkSmallButton;
|
||||
SpkSmallButton16: TSpkSmallButton;
|
||||
SpkSmallButton17: TSpkSmallButton;
|
||||
SpkSmallButton18: TSpkSmallButton;
|
||||
SpkSmallButton19: TSpkSmallButton;
|
||||
SpkSmallButton2: TSpkSmallButton;
|
||||
SpkSmallButton20: TSpkSmallButton;
|
||||
SpkSmallButton21: TSpkSmallButton;
|
||||
SpkSmallButton22: TSpkSmallButton;
|
||||
SpkSmallButton23: TSpkSmallButton;
|
||||
SpkSmallButton24: TSpkSmallButton;
|
||||
SpkSmallButton25: TSpkSmallButton;
|
||||
SpkSmallButton26: TSpkSmallButton;
|
||||
SpkSmallButton27: TSpkSmallButton;
|
||||
SpkSmallButton28: TSpkSmallButton;
|
||||
SpkSmallButton29: TSpkSmallButton;
|
||||
SpkSmallButton3: TSpkSmallButton;
|
||||
SpkSmallButton30: TSpkSmallButton;
|
||||
SpkSmallButton31: TSpkSmallButton;
|
||||
SpkSmallButton32: TSpkSmallButton;
|
||||
SpkSmallButton33: TSpkSmallButton;
|
||||
SpkSmallButton34: TSpkSmallButton;
|
||||
SpkSmallButton35: TSpkSmallButton;
|
||||
SpkSmallButton36: TSpkSmallButton;
|
||||
SpkSmallButton37: TSpkSmallButton;
|
||||
SpkSmallButton38: TSpkSmallButton;
|
||||
SpkSmallButton39: TSpkSmallButton;
|
||||
SpkSmallButton4: TSpkSmallButton;
|
||||
SpkSmallButton40: TSpkSmallButton;
|
||||
SpkSmallButton41: TSpkSmallButton;
|
||||
SpkSmallButton42: TSpkSmallButton;
|
||||
SpkSmallButton43: TSpkSmallButton;
|
||||
SpkSmallButton44: TSpkSmallButton;
|
||||
SpkSmallButton45: TSpkSmallButton;
|
||||
SpkSmallButton46: TSpkSmallButton;
|
||||
SpkSmallButton47: TSpkSmallButton;
|
||||
SpkSmallButton48: TSpkSmallButton;
|
||||
SpkSmallButton49: TSpkSmallButton;
|
||||
SpkSmallButton5: TSpkSmallButton;
|
||||
SpkSmallButton50: TSpkSmallButton;
|
||||
SpkSmallButton51: TSpkSmallButton;
|
||||
SpkSmallButton52: TSpkSmallButton;
|
||||
SpkSmallButton53: TSpkSmallButton;
|
||||
SpkSmallButton54: TSpkSmallButton;
|
||||
SpkSmallButton55: TSpkSmallButton;
|
||||
SpkSmallButton56: TSpkSmallButton;
|
||||
SpkSmallButton57: TSpkSmallButton;
|
||||
SpkSmallButton58: TSpkSmallButton;
|
||||
SpkSmallButton59: TSpkSmallButton;
|
||||
SpkSmallButton6: TSpkSmallButton;
|
||||
SpkSmallButton60: TSpkSmallButton;
|
||||
SpkSmallButton61: TSpkSmallButton;
|
||||
SpkSmallButton62: TSpkSmallButton;
|
||||
SpkSmallButton63: TSpkSmallButton;
|
||||
SpkSmallButton64: TSpkSmallButton;
|
||||
SpkSmallButton65: TSpkSmallButton;
|
||||
SpkSmallButton66: TSpkSmallButton;
|
||||
SpkSmallButton67: TSpkSmallButton;
|
||||
SpkSmallButton68: TSpkSmallButton;
|
||||
SpkSmallButton69: TSpkSmallButton;
|
||||
SpkSmallButton7: TSpkSmallButton;
|
||||
SpkSmallButton70: TSpkSmallButton;
|
||||
SpkSmallButton71: TSpkSmallButton;
|
||||
SpkSmallButton72: TSpkSmallButton;
|
||||
SpkSmallButton73: TSpkSmallButton;
|
||||
SpkSmallButton74: TSpkSmallButton;
|
||||
SpkSmallButton75: TSpkSmallButton;
|
||||
SpkSmallButton8: TSpkSmallButton;
|
||||
SpkSmallButton9: TSpkSmallButton;
|
||||
SpkTab1: TSpkTab;
|
||||
SpkTab2: TSpkTab;
|
||||
SpkTab4: TSpkTab;
|
||||
SpkTab5: TSpkTab;
|
||||
SpkTab6: TSpkTab;
|
||||
SpkToolbar1: TSpkToolbar;
|
||||
SpkToolbar2: TSpkToolbar;
|
||||
SpkToolbar3: TSpkToolbar;
|
||||
SpkToolbar4: TSpkToolbar;
|
||||
SpkToolbar5: TSpkToolbar;
|
||||
private
|
||||
|
||||
public
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user