You've already forked lazarus-ccr
SpkToolbar: Extend demos "actions" and "runtime" to show the new toggle buttons.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5387 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -9,6 +9,10 @@
|
||||
<Title Value="project1"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<XPManifest>
|
||||
<TextName Value="CompanyName.ProductName.AppName"/>
|
||||
<TextDesc Value="Your application description."/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
@ -34,7 +38,7 @@
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Units Count="3">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
@ -47,6 +51,14 @@
|
||||
<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>
|
||||
|
@ -7,7 +7,7 @@ uses
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, Unit1
|
||||
Forms, Unit1, Unit2
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -21,6 +21,13 @@ type
|
||||
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;
|
||||
@ -43,7 +50,17 @@ type
|
||||
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;
|
||||
@ -51,13 +68,23 @@ type
|
||||
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;
|
||||
SpkPane2: TSpkPane;
|
||||
SpkPane3: TSpkPane;
|
||||
SpkPane5: TSpkPane;
|
||||
SpkPane6: TSpkPane;
|
||||
@ -74,6 +101,12 @@ type
|
||||
SpkToolbar1: TSpkToolbar;
|
||||
ToolBar1: TToolBar;
|
||||
ToolButton1: TToolButton;
|
||||
ToolButton10: TToolButton;
|
||||
ToolButton11: TToolButton;
|
||||
ToolButton12: TToolButton;
|
||||
ToolButton13: TToolButton;
|
||||
ToolButton14: TToolButton;
|
||||
ToolButton15: TToolButton;
|
||||
ToolButton2: TToolButton;
|
||||
ToolButton3: TToolButton;
|
||||
ToolButton4: TToolButton;
|
||||
@ -81,16 +114,24 @@ type
|
||||
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);
|
||||
@ -98,6 +139,7 @@ type
|
||||
{ private declarations }
|
||||
procedure LoadFromIni;
|
||||
procedure SaveToIni;
|
||||
procedure SetStyle(AStyle: TSpkStyle);
|
||||
procedure SetUserInterface(Ribbon:boolean);
|
||||
public
|
||||
{ public declarations }
|
||||
@ -111,7 +153,7 @@ implementation
|
||||
{$R *.lfm}
|
||||
|
||||
uses
|
||||
inifiles;
|
||||
inifiles, unit2;
|
||||
|
||||
|
||||
{ TForm1 }
|
||||
@ -121,11 +163,33 @@ 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';
|
||||
@ -141,6 +205,16 @@ 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';
|
||||
@ -156,6 +230,11 @@ 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';
|
||||
@ -166,6 +245,11 @@ 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
|
||||
@ -193,14 +277,32 @@ begin
|
||||
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);
|
||||
// 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;
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<Version Value="10"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
@ -9,14 +9,14 @@
|
||||
<Title Value="project1"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
<XPManifest>
|
||||
<TextName Value="CompanyName.ProductName.AppName"/>
|
||||
<TextDesc Value="Your application description."/>
|
||||
</XPManifest>
|
||||
</General>
|
||||
<i18n>
|
||||
<EnableI18N LFM="False"/>
|
||||
</i18n>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
@ -42,7 +42,6 @@
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="project1"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
@ -81,12 +80,6 @@
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<CompilerMessages>
|
||||
<MsgFileName Value=""/>
|
||||
</CompilerMessages>
|
||||
<CompilerPath Value="$(CompPath)"/>
|
||||
</Other>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,8 +7,8 @@ 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, spkt_BaseItem,
|
||||
spkt_Buttons, spkt_Checkboxes;
|
||||
spkt_Tools, ImgList, ComCtrls, Menus, Grids, ExtCtrls, StdCtrls,
|
||||
spkt_BaseItem, spkt_Buttons, spkt_Checkboxes;
|
||||
|
||||
type
|
||||
|
||||
@ -20,17 +20,33 @@ type
|
||||
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);
|
||||
@ -48,8 +64,99 @@ 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';
|
||||
@ -92,6 +199,7 @@ end;
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
SpkToolbar := TSpkToolbar.Create(self);
|
||||
|
||||
with SpkToolbar do begin
|
||||
Parent := self;
|
||||
Appearance.Pane.CaptionFont.Style := [fsBold, fsItalic];
|
||||
@ -99,32 +207,34 @@ begin
|
||||
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';
|
||||
Caption := 'Open file';
|
||||
ButtonKind := bkButtonDropdown;
|
||||
DropdownMenu := RecentFilesPopupMenu;
|
||||
LargeImageIndex := 1;
|
||||
// Hint := 'Open a file';
|
||||
Hint := 'Open a file';
|
||||
OnClick := @FileOpenHandler;
|
||||
end;
|
||||
with Items.AddLargeButton do begin
|
||||
Caption := 'Save';
|
||||
Caption := 'Save file';
|
||||
LargeImageIndex := 2;
|
||||
// Hint := 'Save file';
|
||||
Hint := 'Save file';
|
||||
OnClick := @FileSaveHandler;
|
||||
end;
|
||||
with Items.AddLargeButton do begin
|
||||
Caption := 'Quit';
|
||||
Caption := 'Quit program';
|
||||
LargeImageIndex := 0;
|
||||
// Hint := 'Close application';
|
||||
Hint := 'Close application';
|
||||
OnClick := @FileQuitHandler;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
with Tabs.Add do begin
|
||||
Caption := 'Edit';
|
||||
with Panes.Add do begin
|
||||
@ -134,24 +244,135 @@ begin
|
||||
HideFrameWhenIdle := true;
|
||||
TableBehaviour := tbBeginsRow;
|
||||
ImageIndex := 3;
|
||||
// Hint := 'Cut to clipboard';
|
||||
Hint := 'Cut to clipboard';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Copy';
|
||||
HideFrameWhenIdle := true;
|
||||
TableBehaviour := tbBeginsRow;
|
||||
ImageIndex := 4;
|
||||
// Hint := 'Copy to clipboard';
|
||||
Hint := 'Copy to clipboard';
|
||||
end;
|
||||
with Items.AddSmallButton do begin
|
||||
Caption := 'Paste';
|
||||
HideFrameWhenIdle := true;
|
||||
TableBehaviour := tbBeginsColumn;
|
||||
ImageIndex := 5;
|
||||
// Hint := 'Paste from clipboard';
|
||||
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
|
||||
@ -161,13 +382,13 @@ begin
|
||||
Caption := 'Horizontal grid lines';
|
||||
TableBehaviour := tbBeginsRow;
|
||||
Checked := true;
|
||||
// Hint := 'Show/hide horizontal grid lines';
|
||||
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';
|
||||
Hint := 'Show/hide vertical grid lines';
|
||||
TableBehaviour := tbBeginsRow;
|
||||
Checked := true;
|
||||
OnClick := @VerticalGridLinesHandler;
|
||||
@ -177,27 +398,66 @@ begin
|
||||
Caption := 'Row select';
|
||||
TableBehaviour := tbBeginsRow;
|
||||
Checked := false;
|
||||
// Hint := 'Select entire row';
|
||||
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';
|
||||
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';
|
||||
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.
|
||||
|
||||
|
Reference in New Issue
Block a user