You've already forked lazarus-ccr
RFPC:fix rxtoolbar store state
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6785 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -364,3 +364,4 @@ msgstr "Интерфейс : "
|
|||||||
#: rxconst.swindowsicofiles
|
#: rxconst.swindowsicofiles
|
||||||
msgid "Windows Ico files (*.ico)|*.ico|All files (*.*)|*.*"
|
msgid "Windows Ico files (*.ico)|*.ico|All files (*.*)|*.*"
|
||||||
msgstr "Файлы иконок Windows (*.ico)|*.ico|Все файлы (*.*)|*.*"
|
msgstr "Файлы иконок Windows (*.ico)|*.ico|Все файлы (*.*)|*.*"
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.1.0.0'
|
||||||
object PageControl1: TPageControl
|
object PageControl1: TPageControl
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 433
|
Height = 429
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 657
|
Width = 657
|
||||||
ActivePage = TabSheet1
|
ActivePage = TabSheet1
|
||||||
@ -22,16 +22,16 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object TabSheet1: TTabSheet
|
object TabSheet1: TTabSheet
|
||||||
Caption = 'Visible buttons'
|
Caption = 'Visible buttons'
|
||||||
ClientHeight = 400
|
ClientHeight = 398
|
||||||
ClientWidth = 647
|
ClientWidth = 647
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
AnchorSideLeft.Control = btnLeft2
|
AnchorSideLeft.Control = btnLeft2
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = TabSheet1
|
AnchorSideTop.Control = TabSheet1
|
||||||
Left = 337
|
Left = 339
|
||||||
Height = 19
|
Height = 17
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 113
|
Width = 105
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'Avaliable buttons'
|
Caption = 'Avaliable buttons'
|
||||||
FocusControl = ListBtnAvaliable
|
FocusControl = ListBtnAvaliable
|
||||||
@ -40,9 +40,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
object Label2: TLabel
|
object Label2: TLabel
|
||||||
AnchorSideTop.Control = TabSheet1
|
AnchorSideTop.Control = TabSheet1
|
||||||
Left = 8
|
Left = 8
|
||||||
Height = 19
|
Height = 17
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 96
|
Width = 90
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'Visible buttons'
|
Caption = 'Visible buttons'
|
||||||
FocusControl = ListBtnVisible
|
FocusControl = ListBtnVisible
|
||||||
@ -54,10 +54,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = btnRight2
|
AnchorSideRight.Control = btnRight2
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 315
|
Left = 313
|
||||||
Height = 30
|
Height = 30
|
||||||
Top = 119
|
Top = 125
|
||||||
Width = 16
|
Width = 20
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
BorderSpacing.InnerBorder = 2
|
BorderSpacing.InnerBorder = 2
|
||||||
@ -70,10 +70,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = btnRight2
|
AnchorSideRight.Control = btnRight2
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 315
|
Left = 313
|
||||||
Height = 16
|
Height = 20
|
||||||
Top = 97
|
Top = 99
|
||||||
Width = 16
|
Width = 20
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
@ -87,10 +87,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = btnRight2
|
AnchorSideRight.Control = btnRight2
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 315
|
Left = 313
|
||||||
Height = 38
|
Height = 38
|
||||||
Top = 53
|
Top = 55
|
||||||
Width = 16
|
Width = 20
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 6
|
||||||
BorderSpacing.InnerBorder = 2
|
BorderSpacing.InnerBorder = 2
|
||||||
@ -101,10 +101,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideLeft.Control = TabSheet1
|
AnchorSideLeft.Control = TabSheet1
|
||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = ListBtnAvaliable
|
AnchorSideTop.Control = ListBtnAvaliable
|
||||||
Left = 315
|
Left = 313
|
||||||
Height = 16
|
Height = 20
|
||||||
Top = 31
|
Top = 29
|
||||||
Width = 16
|
Width = 20
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.InnerBorder = 2
|
BorderSpacing.InnerBorder = 2
|
||||||
OnClick = btnRight2Click
|
OnClick = btnRight2Click
|
||||||
@ -118,10 +118,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideRight.Control = TabSheet1
|
AnchorSideRight.Control = TabSheet1
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = cbShowCaption
|
AnchorSideBottom.Control = cbShowCaption
|
||||||
Left = 337
|
Left = 339
|
||||||
Height = 266
|
Height = 266
|
||||||
Top = 31
|
Top = 29
|
||||||
Width = 304
|
Width = 302
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
IntegralHeight = True
|
IntegralHeight = True
|
||||||
@ -138,7 +138,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
OnClick = ListBtnAvaliableClick
|
OnClick = ListBtnAvaliableClick
|
||||||
OnDblClick = ListBtnVisibleDblClick
|
OnDblClick = ListBtnVisibleDblClick
|
||||||
OnDrawItem = ListBox1DrawItem
|
OnDrawItem = ListBox1DrawItem
|
||||||
ScrollWidth = 302
|
ScrollWidth = 300
|
||||||
Style = lbOwnerDrawFixed
|
Style = lbOwnerDrawFixed
|
||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
@ -149,17 +149,20 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideRight.Control = btnRight2
|
AnchorSideRight.Control = btnRight2
|
||||||
AnchorSideBottom.Control = cbShowCaption
|
AnchorSideBottom.Control = cbShowCaption
|
||||||
Left = 28
|
Left = 32
|
||||||
Height = 266
|
Height = 266
|
||||||
Top = 31
|
Top = 29
|
||||||
Width = 281
|
Width = 275
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
|
DragMode = dmAutomatic
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnClick = ListBtnAvaliableClick
|
OnClick = ListBtnAvaliableClick
|
||||||
OnDblClick = ListBtnVisibleDblClick
|
OnDblClick = ListBtnVisibleDblClick
|
||||||
|
OnDragDrop = ListBtnVisibleDragDrop
|
||||||
|
OnDragOver = ListBtnVisibleDragOver
|
||||||
OnDrawItem = ListBox1DrawItem
|
OnDrawItem = ListBox1DrawItem
|
||||||
ScrollWidth = 279
|
ScrollWidth = 273
|
||||||
Style = lbOwnerDrawFixed
|
Style = lbOwnerDrawFixed
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
@ -169,7 +172,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 3
|
Left = 3
|
||||||
Height = 62
|
Height = 62
|
||||||
Top = 332
|
Top = 330
|
||||||
Width = 635
|
Width = 635
|
||||||
Alignment = taLeftJustify
|
Alignment = taLeftJustify
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
@ -183,8 +186,8 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideBottom.Control = Panel1
|
AnchorSideBottom.Control = Panel1
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 303
|
Top = 301
|
||||||
Width = 114
|
Width = 108
|
||||||
Anchors = [akLeft, akBottom]
|
Anchors = [akLeft, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
Caption = 'Show caption'
|
Caption = 'Show caption'
|
||||||
@ -199,9 +202,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideRight.Control = btnRight2
|
AnchorSideRight.Control = btnRight2
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 16
|
Height = 20
|
||||||
Top = 31
|
Top = 29
|
||||||
Width = 16
|
Width = 20
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.InnerBorder = 2
|
BorderSpacing.InnerBorder = 2
|
||||||
@ -216,9 +219,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
AnchorSideRight.Control = btnRight2
|
AnchorSideRight.Control = btnRight2
|
||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 16
|
Height = 20
|
||||||
Top = 53
|
Top = 55
|
||||||
Width = 16
|
Width = 20
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
BorderSpacing.InnerBorder = 2
|
BorderSpacing.InnerBorder = 2
|
||||||
@ -228,7 +231,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
end
|
end
|
||||||
object TabSheet2: TTabSheet
|
object TabSheet2: TTabSheet
|
||||||
Caption = 'Options'
|
Caption = 'Options'
|
||||||
ClientHeight = 400
|
ClientHeight = 398
|
||||||
ClientWidth = 647
|
ClientWidth = 647
|
||||||
object cbShowHint: TCheckBox
|
object cbShowHint: TCheckBox
|
||||||
AnchorSideLeft.Control = TabSheet2
|
AnchorSideLeft.Control = TabSheet2
|
||||||
@ -287,7 +290,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
ChildSizing.ControlsPerLine = 1
|
ChildSizing.ControlsPerLine = 1
|
||||||
ClientHeight = 79
|
ClientHeight = 81
|
||||||
ClientWidth = 308
|
ClientWidth = 308
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'None'
|
'None'
|
||||||
@ -318,7 +321,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||||
ChildSizing.ControlsPerLine = 1
|
ChildSizing.ControlsPerLine = 1
|
||||||
ClientHeight = 79
|
ClientHeight = 81
|
||||||
ClientWidth = 308
|
ClientWidth = 308
|
||||||
Items.Strings = (
|
Items.Strings = (
|
||||||
'Standart'
|
'Standart'
|
||||||
@ -346,8 +349,8 @@ object ToolPanelSetupForm: TToolPanelSetupForm
|
|||||||
end
|
end
|
||||||
object ButtonPanel1: TButtonPanel
|
object ButtonPanel1: TButtonPanel
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 42
|
Height = 46
|
||||||
Top = 439
|
Top = 435
|
||||||
Width = 645
|
Width = 645
|
||||||
OKButton.Name = 'OKButton'
|
OKButton.Name = 'OKButton'
|
||||||
OKButton.DefaultCaption = True
|
OKButton.DefaultCaption = True
|
||||||
|
@ -79,6 +79,9 @@ type
|
|||||||
procedure ListBtnAvaliableClick(Sender: TObject);
|
procedure ListBtnAvaliableClick(Sender: TObject);
|
||||||
procedure cbShowCaptionChange(Sender: TObject);
|
procedure cbShowCaptionChange(Sender: TObject);
|
||||||
procedure ListBtnVisibleDblClick(Sender: TObject);
|
procedure ListBtnVisibleDblClick(Sender: TObject);
|
||||||
|
procedure ListBtnVisibleDragDrop(Sender, Source: TObject; X, Y: Integer);
|
||||||
|
procedure ListBtnVisibleDragOver(Sender, Source: TObject; X, Y: Integer;
|
||||||
|
State: TDragState; var Accept: Boolean);
|
||||||
private
|
private
|
||||||
procedure FillItems(List:TStrings; AVisible:boolean);
|
procedure FillItems(List:TStrings; AVisible:boolean);
|
||||||
procedure UpdateStates;
|
procedure UpdateStates;
|
||||||
@ -215,13 +218,60 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TToolPanelSetupForm.ListBtnVisibleDragDrop(Sender, Source: TObject;
|
||||||
|
X, Y: Integer);
|
||||||
|
var
|
||||||
|
I1, I2: Integer;
|
||||||
|
P: TObject;
|
||||||
|
S: String;
|
||||||
|
begin
|
||||||
|
I1:=ListBtnVisible.ItemIndex;
|
||||||
|
I2:=ListBtnVisible.TopIndex + Y div ListBtnVisible.ItemHeight;
|
||||||
|
|
||||||
|
if (I1 > -1) and (I2 < ListBtnVisible.Items.Count) and (I1<>I2)then
|
||||||
|
begin
|
||||||
|
P:=ListBtnVisible.Items.Objects[I1];
|
||||||
|
S:=ListBtnVisible.Items[I1];
|
||||||
|
ListBtnVisible.Items.Delete(I1);
|
||||||
|
ListBtnVisible.Items.InsertObject(I2, S, P);
|
||||||
|
ListBtnVisible.ItemIndex:=I2;
|
||||||
|
|
||||||
|
//ListBtnVisible.Items.Exchange(I1,I2);
|
||||||
|
//FToolPanel.VisibleItems.Exchange(I1, I2);
|
||||||
|
FToolPanel.VisibleItems.Delete(I1);
|
||||||
|
FToolPanel.VisibleItems.Insert(I2, P);
|
||||||
|
FToolPanel.ReAlign;
|
||||||
|
UpdateStates;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TToolPanelSetupForm.ListBtnVisibleDragOver(Sender, Source: TObject;
|
||||||
|
X, Y: Integer; State: TDragState; var Accept: Boolean);
|
||||||
|
begin
|
||||||
|
Accept:=Source = ListBtnVisible;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TToolPanelSetupForm.FillItems(List: TStrings; AVisible: boolean);
|
procedure TToolPanelSetupForm.FillItems(List: TStrings; AVisible: boolean);
|
||||||
var
|
var
|
||||||
TI: TToolbarItem;
|
TI: TToolbarItem;
|
||||||
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
List.Clear;
|
List.Clear;
|
||||||
|
if AVisible then
|
||||||
|
begin
|
||||||
|
for i:=0 to FToolPanel.VisibleItems.Count-1 do
|
||||||
|
begin
|
||||||
|
TI:=TToolbarItem(FToolPanel.VisibleItems[i]);
|
||||||
|
if Assigned(TI.Action) then
|
||||||
|
List.AddObject(TI.Action.Name, TI)
|
||||||
|
else
|
||||||
|
List.AddObject('Separator', TI);
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
for TI in FToolPanel.Items do
|
for TI in FToolPanel.Items do
|
||||||
if (TI.Visible = AVisible) then
|
//if (TI.Visible = AVisible) then
|
||||||
|
if FToolPanel.VisibleItems.IndexOf(TI)<0 then
|
||||||
if Assigned(TI.Action) then
|
if Assigned(TI.Action) then
|
||||||
List.AddObject(TI.Action.Name, TI)
|
List.AddObject(TI.Action.Name, TI)
|
||||||
else
|
else
|
||||||
@ -387,6 +437,7 @@ var
|
|||||||
begin
|
begin
|
||||||
I:=ListBtnVisible.ItemIndex;
|
I:=ListBtnVisible.ItemIndex;
|
||||||
J:=I + TComponent(Sender).Tag;
|
J:=I + TComponent(Sender).Tag;
|
||||||
|
ListBtnVisible.Items.Exchange(I, J);
|
||||||
ListBtnVisible.ItemIndex:=J;
|
ListBtnVisible.ItemIndex:=J;
|
||||||
|
|
||||||
UpdateStates;
|
UpdateStates;
|
||||||
|
@ -937,6 +937,22 @@ begin
|
|||||||
FPropertyStorageLink.Storage.WriteString(S+sButtonAllign, GetEnumProp(Self, 'ButtonAllign'));
|
FPropertyStorageLink.Storage.WriteString(S+sButtonAllign, GetEnumProp(Self, 'ButtonAllign'));
|
||||||
|
|
||||||
I:=0;
|
I:=0;
|
||||||
|
for i:=0 to FVisibleItems.Count-1 do
|
||||||
|
begin
|
||||||
|
IT:=TToolbarItem(FVisibleItems[i]);
|
||||||
|
S1:=S + sItem + IntToStr(i);
|
||||||
|
FPropertyStorageLink.Storage.WriteString(S1+sOptions, GetEnumProp(IT, 'ButtonStyle'));
|
||||||
|
FPropertyStorageLink.Storage.WriteInteger(S1+sIndex, IT.Index);
|
||||||
|
if Assigned(IT.Action) then
|
||||||
|
begin
|
||||||
|
FPropertyStorageLink.Storage.WriteString(S1+sAction, IT.Action.Name);
|
||||||
|
FPropertyStorageLink.Storage.WriteInteger(S1+sShowCaption, ord(IT.ShowCaption));
|
||||||
|
if FCustomizeShortCut then
|
||||||
|
FPropertyStorageLink.Storage.WriteString(S1+sShortCut, ShortCutToText(TCustomAction(IT.Action).ShortCut));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
FPropertyStorageLink.Storage.WriteInteger(S+sCount, FVisibleItems.Count);
|
||||||
|
(*
|
||||||
for IT in Items do
|
for IT in Items do
|
||||||
if IT.Visible then
|
if IT.Visible then
|
||||||
begin
|
begin
|
||||||
@ -953,6 +969,8 @@ begin
|
|||||||
Inc(i);
|
Inc(i);
|
||||||
end;
|
end;
|
||||||
FPropertyStorageLink.Storage.WriteInteger(S+sCount, i);
|
FPropertyStorageLink.Storage.WriteInteger(S+sCount, i);
|
||||||
|
|
||||||
|
*)
|
||||||
(* for i:=0 to FToolbarItems.Count-1 do
|
(* for i:=0 to FToolbarItems.Count-1 do
|
||||||
begin
|
begin
|
||||||
IT:=FToolbarItems[i];
|
IT:=FToolbarItems[i];
|
||||||
@ -1000,6 +1018,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
St.AddObject('%0.5d-%s', [FPropertyStorageLink.Storage.ReadInteger(S1+sLeft, -1), AActionName], P);
|
St.AddObject('%0.5d-%s', [FPropertyStorageLink.Storage.ReadInteger(S1+sLeft, -1), AActionName], P);
|
||||||
P.Visible:=true;
|
P.Visible:=true;
|
||||||
|
FVisibleItems.Add(P);
|
||||||
|
|
||||||
if FCustomizeShortCut and Assigned(P.Action) then
|
if FCustomizeShortCut and Assigned(P.Action) then
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user