RxToolbar - in config dialog show shrotcut

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4420 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2016-01-14 07:28:02 +00:00
parent 48c2e71437
commit 91a51d1759
9 changed files with 95 additions and 88 deletions

View File

@ -7,12 +7,12 @@ object AboutForm: TAboutForm
Caption = 'About...'
ClientHeight = 300
ClientWidth = 400
LCLVersion = '1.3'
Visible = False
object BitBtn1: TBitBtn
Left = 181
Height = 37
Top = 257
Width = 36
Left = 169
Height = 30
Top = 264
Width = 60
Anchors = [akBottom]
AutoSize = True
BorderSpacing.InnerBorder = 2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -18,8 +18,8 @@
</General>
<VersionInfo>
<UseVersionInfo Value="True"/>
<MajorVersionNr Value="1"/>
<MinorVersionNr Value="1"/>
<MajorVersionNr Value="2"/>
<MinorVersionNr Value="2"/>
<StringTable ProductVersion="0.0.0.0"/>
</VersionInfo>
<BuildModes Count="1">
@ -50,7 +50,7 @@
<MinVersion Major="1" Valid="True"/>
</Item3>
</RequiredPackages>
<Units Count="3">
<Units Count="2">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
@ -63,14 +63,6 @@
<ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/>
</Unit1>
<Unit2>
<Filename Value="aboutunit.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="AboutForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="AboutUnit"/>
</Unit2>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -5,8 +5,7 @@ program project1;
uses
Interfaces, // this includes the LCL widgetset
Forms,
Unit1,
AboutUnit;
Unit1;
{$R *.res}

View File

@ -2,6 +2,6 @@
<CONFIG>
<TApplication>
<Form1 Form1_Top="255" Form1_Left="310" Form1_Width="592" Form1_Height="289" Form1.ToolPanel1.Count="7" Form1.ToolPanel1.Options="tpFlatBtns,tpCustomizable,tpGlyphPopup,tpCaptionPopup" Form1.ToolPanel1.Version="1" Form1.ToolPanel1.ShowHint="1" Form1.ToolPanel1.Item0.Top="4" Form1.ToolPanel1.Item1.Top="4" Form1.ToolPanel1.Item2.Top="4" Form1.ToolPanel1.Item3.Top="4" Form1.ToolPanel1.Item4.Top="4" Form1.ToolPanel1.Item5.Top="4" Form1.ToolPanel1.Item6.Top="4" Form1.ToolPanel1.Item0.Left="8" Form1.ToolPanel1.Item1.Left="328" Form1.ToolPanel1.Item2.Left="152" Form1.ToolPanel1.Item3.Left="96" Form1.ToolPanel1.Item4.Left="504" Form1.ToolPanel1.Item5.Left="216" Form1.ToolPanel1.Item6.Left="328" Form1.ToolPanel1.Item0.Width="49" Form1.ToolPanel1.Item1.Width="64" Form1.ToolPanel1.Item2.Width="24" Form1.ToolPanel1.Item3.Width="50" Form1.ToolPanel1.Item4.Width="46" Form1.ToolPanel1.Item5.Width="85" Form1.ToolPanel1.Item6.Width="64" Form1.ToolPanel1.Item0.Action="actNew" Form1.ToolPanel1.Item1.Action="actCustom" Form1.ToolPanel1.Item2.Action="actNext" Form1.ToolPanel1.Item3.Action="actPrior" Form1.ToolPanel1.Item4.Action="actExit" Form1.ToolPanel1.Item5.Action="actDemo" Form1.ToolPanel1.Item6.Action="actCustom" Form1.ToolPanel1.ToolBarStyle="tbsStandart" Form1.ToolPanel1.Item0.Visible="1" Form1.ToolPanel1.Item1.Visible="1" Form1.ToolPanel1.Item2.Visible="1" Form1.ToolPanel1.Item3.Visible="1" Form1.ToolPanel1.Item4.Visible="1" Form1.ToolPanel1.Item5.Visible="1" Form1.ToolPanel1.Item6.Visible="1" Form1.ToolPanel1.Item0.ShowCaption="1" Form1.ToolPanel1.Item1.ShowCaption="1" Form1.ToolPanel1.Item2.ShowCaption="0" Form1.ToolPanel1.Item3.ShowCaption="1" Form1.ToolPanel1.Item4.ShowCaption="1" Form1.ToolPanel1.Item5.ShowCaption="1" Form1.ToolPanel1.Item6.ShowCaption="1"/>
<MainForm MainForm_Top="364" MainForm_Left="541" MainForm_Width="838" MainForm_Height="352" MainForm.ToolPanel1.Count="7" MainForm.ToolPanel1.Options="tpFlatBtns,tpCustomizable,tpGlyphPopup,tpCaptionPopup" MainForm.ToolPanel1.Version="4" MainForm.ToolPanel1.ShowHint="1" MainForm.ToolPanel1.Item0.Top="2" MainForm.ToolPanel1.Item1.Top="1" MainForm.ToolPanel1.Item2.Top="2" MainForm.ToolPanel1.Item3.Top="2" MainForm.ToolPanel1.Item4.Top="2" MainForm.ToolPanel1.Item5.Top="2" MainForm.ToolPanel1.Item6.Top="2" MainForm.ToolPanel1.Item0.Left="55" MainForm.ToolPanel1.Item1.Left="61" MainForm.ToolPanel1.Item2.Left="114" MainForm.ToolPanel1.Item3.Left="153" MainForm.ToolPanel1.Item4.Left="2" MainForm.ToolPanel1.Item5.Left="211" MainForm.ToolPanel1.Item6.Left="289" MainForm.ToolPanel1.Item0.Width="59" MainForm.ToolPanel1.Item1.Width="79" MainForm.ToolPanel1.Item2.Width="39" MainForm.ToolPanel1.Item3.Width="58" MainForm.ToolPanel1.Item4.Width="53" MainForm.ToolPanel1.Item5.Width="78" MainForm.ToolPanel1.Item6.Width="67" MainForm.ToolPanel1.ButtonAllign="tbaLeft" MainForm.ToolPanel1.Item0.Action="actNew" MainForm.ToolPanel1.Item1.Action="actCustom" MainForm.ToolPanel1.Item2.Action="actNext" MainForm.ToolPanel1.Item3.Action="actPrior" MainForm.ToolPanel1.Item4.Action="actExit" MainForm.ToolPanel1.Item5.Action="actSysMenu" MainForm.ToolPanel1.Item6.Action="sysAbout" MainForm.ToolPanel1.ToolBarStyle="tbsNative" MainForm.ToolPanel1.Item0.Visible="1" MainForm.ToolPanel1.Item1.Visible="0" MainForm.ToolPanel1.Item2.Visible="1" MainForm.ToolPanel1.Item3.Visible="1" MainForm.ToolPanel1.Item4.Visible="1" MainForm.ToolPanel1.Item5.Visible="1" MainForm.ToolPanel1.Item6.Visible="1" MainForm.ToolPanel1.Item0.ShowCaption="1" MainForm.ToolPanel1.Item1.ShowCaption="1" MainForm.ToolPanel1.Item2.ShowCaption="0" MainForm.ToolPanel1.Item3.ShowCaption="1" MainForm.ToolPanel1.Item4.ShowCaption="1" MainForm.ToolPanel1.Item5.ShowCaption="1" MainForm.ToolPanel1.Item6.ShowCaption="1"/>
<MainForm MainForm_Top="345" MainForm_Left="533" MainForm_Width="838" MainForm_Height="352" MainForm.ToolPanel1.Count="7" MainForm.ToolPanel1.Options="tpFlatBtns,tpCustomizable,tpGlyphPopup,tpCaptionPopup" MainForm.ToolPanel1.Version="4" MainForm.ToolPanel1.ShowHint="1" MainForm.ToolPanel1.Item0.Top="2" MainForm.ToolPanel1.Item1.Top="1" MainForm.ToolPanel1.Item2.Top="2" MainForm.ToolPanel1.Item3.Top="2" MainForm.ToolPanel1.Item4.Top="2" MainForm.ToolPanel1.Item5.Top="2" MainForm.ToolPanel1.Item6.Top="2" MainForm.ToolPanel1.Item0.Left="48" MainForm.ToolPanel1.Item1.Left="61" MainForm.ToolPanel1.Item2.Left="100" MainForm.ToolPanel1.Item3.Left="139" MainForm.ToolPanel1.Item4.Left="2" MainForm.ToolPanel1.Item5.Left="192" MainForm.ToolPanel1.Item6.Left="258" MainForm.ToolPanel1.Item0.Width="52" MainForm.ToolPanel1.Item1.Width="70" MainForm.ToolPanel1.Item2.Width="39" MainForm.ToolPanel1.Item3.Width="53" MainForm.ToolPanel1.Item4.Width="46" MainForm.ToolPanel1.Item5.Width="66" MainForm.ToolPanel1.Item6.Width="61" MainForm.ToolPanel1.ButtonAllign="tbaLeft" MainForm.ToolPanel1.Item0.Action="actNew" MainForm.ToolPanel1.Item1.Action="actCustom" MainForm.ToolPanel1.Item2.Action="actNext" MainForm.ToolPanel1.Item3.Action="actPrior" MainForm.ToolPanel1.Item4.Action="actExit" MainForm.ToolPanel1.Item5.Action="actSysMenu" MainForm.ToolPanel1.Item6.Action="sysAbout" MainForm.ToolPanel1.ToolBarStyle="tbsNative" MainForm.ToolPanel1.Item0.Visible="1" MainForm.ToolPanel1.Item1.Visible="0" MainForm.ToolPanel1.Item2.Visible="1" MainForm.ToolPanel1.Item3.Visible="1" MainForm.ToolPanel1.Item4.Visible="1" MainForm.ToolPanel1.Item5.Visible="1" MainForm.ToolPanel1.Item6.Visible="1" MainForm.ToolPanel1.Item0.ShowCaption="1" MainForm.ToolPanel1.Item1.ShowCaption="1" MainForm.ToolPanel1.Item2.ShowCaption="0" MainForm.ToolPanel1.Item3.ShowCaption="1" MainForm.ToolPanel1.Item4.ShowCaption="1" MainForm.ToolPanel1.Item5.ShowCaption="1" MainForm.ToolPanel1.Item6.ShowCaption="1"/>
</TApplication>
</CONFIG>

View File

@ -10,7 +10,7 @@ object MainForm: TMainForm
Position = poDesktopCenter
SessionProperties = 'Width;Height;Left;Top'
ShowHint = True
LCLVersion = '1.3'
Visible = False
object ToolPanel1: TToolPanel
Left = 0
Height = 32
@ -23,7 +23,7 @@ object MainForm: TMainForm
Left = 5
Height = 22
Top = 5
Width = 59
Width = 52
DropDownMenu = PopupMenu1
ShowCaption = True
ButtonStyle = tbrDropDown
@ -31,16 +31,16 @@ object MainForm: TMainForm
item
Action = actCustom
Visible = True
Left = 142
Left = 123
Height = 22
Top = 5
Width = 79
Width = 70
ShowCaption = True
end
item
Action = actNext
Visible = True
Left = 279
Left = 246
Height = 22
Top = 5
Width = 39
@ -51,29 +51,29 @@ object MainForm: TMainForm
item
Action = actPrior
Visible = True
Left = 221
Left = 193
Height = 22
Top = 5
Width = 58
Width = 53
DropDownMenu = PopupMenu2
ShowCaption = True
end
item
Action = actExit
Visible = True
Left = 318
Left = 285
Height = 22
Top = 5
Width = 53
Width = 46
ShowCaption = True
end
item
Action = actSysMenu
Visible = True
Left = 64
Left = 57
Height = 22
Top = 5
Width = 78
Width = 66
DropDownMenu = PopupMenu1
ShowCaption = True
ButtonStyle = tbrDropDown
@ -81,14 +81,14 @@ object MainForm: TMainForm
item
Action = sysAbout
Visible = True
Left = 371
Left = 331
Height = 22
Top = 5
Width = 67
Width = 61
ShowCaption = True
end>
ImageList = ImageList1
PropertyStorage = XMLPropStorage1
PropertyStorage = RxIniPropStorage1
BtnWidth = 23
BtnHeight = 32
ToolBarStyle = tbsWindowsXP
@ -103,9 +103,9 @@ object MainForm: TMainForm
end
object SpeedButton1: TSpeedButton
Left = 440
Height = 22
Height = 24
Top = 88
Width = 22
Width = 50
AutoSize = True
Caption = 'Test'
Glyph.Data = {
@ -156,10 +156,10 @@ object MainForm: TMainForm
Margin = 3
end
object BitBtn1: TBitBtn
Left = 449
Height = 33
Top = 134
Width = 84
Left = 440
Height = 28
Top = 128
Width = 86
AutoSize = True
Caption = 'BitBtn1'
Glyph.Data = {
@ -448,18 +448,21 @@ object MainForm: TMainForm
Caption = 'New'
Hint = 'Action N 1'
ImageIndex = 3
ShortCut = 45
end
object actNext: TAction
Caption = 'Next'
Hint = 'Action N 2'
ImageIndex = 2
OnExecute = Action1Execute
ShortCut = 16423
end
object actPrior: TAction
Caption = 'Prior'
Hint = 'Prior action'
ImageIndex = 1
OnExecute = Action1Execute
ShortCut = 16421
end
object actCustom: TAction
Caption = 'Custom'
@ -478,6 +481,7 @@ object MainForm: TMainForm
Tag = 4
Caption = 'System'
ImageIndex = 4
ShortCut = 16461
end
object sysAbout: TAction
Category = 'System'
@ -486,12 +490,6 @@ object MainForm: TMainForm
OnExecute = sysAboutExecute
end
end
object XMLPropStorage1: TXMLPropStorage
StoredValues = <>
FileName = 'toolbardemo.cfg'
left = 216
top = 88
end
object PopupMenu1: TPopupMenu
Images = ImageList1
left = 16
@ -762,4 +760,16 @@ object MainForm: TMainForm
Caption = 'Item 4'
end
end
object RxIniPropStorage1: TRxIniPropStorage
StoredValues = <>
SeparateFiles = True
left = 168
top = 156
end
object RxAboutDialog1: TRxAboutDialog
Options = [radShowImageLogo]
Caption = 'О системе'
left = 360
top = 72
end
end

View File

@ -6,7 +6,8 @@ interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls,
Buttons, StdCtrls, rxtoolbar, ActnList, XMLPropStorage, Menus;
Buttons, rxtoolbar, RxIniPropStorage, RxAboutDialog, ActnList,
Menus;
type
@ -23,6 +24,8 @@ type
MenuItem6: TMenuItem;
MenuItem7: TMenuItem;
PopupMenu2: TPopupMenu;
RxAboutDialog1: TRxAboutDialog;
RxIniPropStorage1: TRxIniPropStorage;
SpeedButton1: TSpeedButton;
sysAbout: TAction;
actNew: TAction;
@ -40,7 +43,6 @@ type
MenuItem9: TMenuItem;
PopupMenu1: TPopupMenu;
ToolPanel1: TToolPanel;
XMLPropStorage1: TXMLPropStorage;
procedure Action1Execute(Sender: TObject);
procedure actCustomExecute(Sender: TObject);
procedure actExitExecute(Sender: TObject);
@ -56,7 +58,6 @@ var
implementation
uses AboutUnit;
{$R *.lfm}
@ -80,9 +81,7 @@ end;
procedure TMainForm.sysAboutExecute(Sender: TObject);
begin
AboutForm:=TAboutForm.Create(Application);
AboutForm.ShowModal;
AboutForm.Free;
RxAboutDialog1.Execute;
end;
end.

View File

@ -12,10 +12,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
OnDestroy = FormDestroy
OnResize = FormResize
Position = poScreenCenter
LCLVersion = '1.1'
Visible = False
object PageControl1: TPageControl
Left = 0
Height = 433
Height = 441
Top = 0
Width = 657
ActivePage = TabSheet1
@ -24,16 +24,16 @@ object ToolPanelSetupForm: TToolPanelSetupForm
TabOrder = 0
object TabSheet1: TTabSheet
Caption = 'Visible buttons'
ClientHeight = 400
ClientWidth = 651
ClientHeight = 413
ClientWidth = 649
object Label1: TLabel
AnchorSideLeft.Control = BitBtn3
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = TabSheet1
Left = 349
Left = 353
Height = 15
Top = 6
Width = 102
Width = 92
BorderSpacing.Around = 6
Caption = 'Avaliable buttons'
FocusControl = ListBtnAvaliable
@ -44,7 +44,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 8
Height = 15
Top = 6
Width = 89
Width = 78
BorderSpacing.Around = 6
Caption = 'Visible buttons'
FocusControl = ListBtnVisible
@ -56,10 +56,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BitBtn6
AnchorSideRight.Side = asrBottom
Left = 307
Left = 301
Height = 30
Top = 145
Width = 36
Top = 141
Width = 46
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 2
@ -73,10 +73,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BitBtn6
AnchorSideRight.Side = asrBottom
Left = 307
Height = 31
Top = 108
Width = 36
Left = 301
Height = 29
Top = 106
Width = 46
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Top = 6
@ -91,10 +91,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BitBtn6
AnchorSideRight.Side = asrBottom
Left = 307
Left = 301
Height = 38
Top = 64
Width = 36
Top = 62
Width = 46
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 2
@ -106,10 +106,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideLeft.Control = TabSheet1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ListBtnAvaliable
Left = 307
Height = 31
Left = 301
Height = 29
Top = 27
Width = 36
Width = 46
AutoSize = True
BorderSpacing.InnerBorder = 2
Caption = '>>'
@ -124,10 +124,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideRight.Control = TabSheet1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = cbShowCaption
Left = 349
Height = 271
Left = 353
Height = 287
Top = 27
Width = 296
Width = 290
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
IntegralHeight = True
@ -154,9 +154,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideRight.Control = BitBtn6
AnchorSideBottom.Control = cbShowCaption
Left = 14
Height = 271
Height = 287
Top = 27
Width = 287
Width = 281
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
@ -165,15 +165,14 @@ object ToolPanelSetupForm: TToolPanelSetupForm
ScrollWidth = 285
Style = lbOwnerDrawFixed
TabOrder = 5
TopIndex = -1
end
object Panel1: TPanel
AnchorSideBottom.Control = TabSheet1
AnchorSideBottom.Side = asrBottom
Left = 3
Height = 62
Top = 332
Width = 639
Top = 345
Width = 637
Alignment = taLeftJustify
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Around = 6
@ -185,9 +184,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideLeft.Control = TabSheet1
AnchorSideBottom.Control = Panel1
Left = 6
Height = 22
Top = 304
Width = 105
Height = 19
Top = 320
Width = 92
Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6
Caption = 'Show caption'
@ -256,7 +255,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 78
ClientHeight = 75
ClientWidth = 308
Items.Strings = (
'None'
@ -287,7 +286,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 78
ClientHeight = 75
ClientWidth = 308
Items.Strings = (
'Standart'
@ -315,8 +314,8 @@ object ToolPanelSetupForm: TToolPanelSetupForm
end
object ButtonPanel1: TButtonPanel
Left = 6
Height = 42
Top = 439
Height = 34
Top = 447
Width = 645
OKButton.Name = 'OKButton'
OKButton.DefaultCaption = True

View File

@ -89,7 +89,7 @@ var
ToolPanelSetupForm: TToolPanelSetupForm;
implementation
uses vclutils, ActnList, boxprocs, rxconst;
uses vclutils, ActnList, boxprocs, rxconst, LCLProc;
{$R *.lfm}
@ -122,6 +122,7 @@ var
BtnRect:TRect;
Cnv:TCanvas;
C: TColor;
S: String;
begin
Cnv:=(Control as TListBox).Canvas;
C:=Cnv.Brush.Color;
@ -150,7 +151,14 @@ begin
end;
Offset := Offset + 6;
Cnv.Brush.Color:=C;
Cnv.TextOut(ARect.Left + Offset, (ARect.Top + ARect.Bottom - Cnv.TextHeight('W')) div 2, TCustomAction(P.Action).Caption); { display the text }
Cnv.TextOut(ARect.Left + Offset, (ARect.Top + ARect.Bottom - Cnv.TextHeight('Wg')) div 2, TCustomAction(P.Action).Caption); { display the text }
if (P.Action is TAction) then
if TAction(P.Action).ShortCut <> 0 then
begin
S:=ShortCutToText(TAction(P.Action).ShortCut);
if S<> '' then
Cnv.TextOut(ARect.Right - Cnv.TextWidth(S) - 2, (ARect.Top + ARect.Bottom - Cnv.TextHeight('Wg')) div 2, S); { display the shortut caption }
end;
end;
end;
end;