mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 23:39:08 +02:00
editor toolbar: conforming to IDE theme (issue #12182) from Graeme
* Arrow buttons changed from TBitBtn to TSpeedButton * Arrow images are loaded from Lazarus Resources * Fixed bug in treeview. When you selected a node, the node image disappeared. git-svn-id: trunk@16647 -
This commit is contained in:
parent
1cfaa04b5c
commit
5482e9dde7
@ -3,18 +3,19 @@ object EdtTbConfigForm: TEdtTbConfigForm
|
|||||||
Height = 330
|
Height = 330
|
||||||
Top = 200
|
Top = 200
|
||||||
Width = 651
|
Width = 651
|
||||||
HorzScrollBar.Page = 650
|
|
||||||
VertScrollBar.Page = 329
|
|
||||||
ActiveControl = btnOK
|
ActiveControl = btnOK
|
||||||
Caption = 'EdtTbConfigForm'
|
Caption = 'EdtTbConfigForm'
|
||||||
|
ClientHeight = 330
|
||||||
|
ClientWidth = 651
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
|
ParentFont = False
|
||||||
|
LCLVersion = '0.9.25'
|
||||||
object lblMenuTree: TLabel
|
object lblMenuTree: TLabel
|
||||||
Left = 16
|
Left = 16
|
||||||
Height = 17
|
Height = 17
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 89
|
Width = 89
|
||||||
Caption = 'lblMenuTree'
|
Caption = 'lblMenuTree'
|
||||||
Color = clNone
|
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
object lblToolbar: TLabel
|
object lblToolbar: TLabel
|
||||||
@ -23,15 +24,52 @@ object EdtTbConfigForm: TEdtTbConfigForm
|
|||||||
Top = 10
|
Top = 10
|
||||||
Width = 70
|
Width = 70
|
||||||
Caption = 'lblToolbar'
|
Caption = 'lblToolbar'
|
||||||
Color = clNone
|
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
end
|
end
|
||||||
|
object btnRemove: TSpeedButton
|
||||||
|
Left = 432
|
||||||
|
Height = 26
|
||||||
|
Top = 74
|
||||||
|
Width = 22
|
||||||
|
Color = clBtnFace
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = btnRemoveClick
|
||||||
|
end
|
||||||
|
object btnAdd: TSpeedButton
|
||||||
|
Left = 432
|
||||||
|
Height = 26
|
||||||
|
Top = 99
|
||||||
|
Width = 22
|
||||||
|
Color = clBtnFace
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = btnAddClick
|
||||||
|
end
|
||||||
|
object btnMoveUp: TSpeedButton
|
||||||
|
Left = 432
|
||||||
|
Height = 26
|
||||||
|
Top = 157
|
||||||
|
Width = 22
|
||||||
|
Color = clBtnFace
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = btnMoveUpClick
|
||||||
|
end
|
||||||
|
object btnMoveDown: TSpeedButton
|
||||||
|
Left = 432
|
||||||
|
Height = 26
|
||||||
|
Top = 182
|
||||||
|
Width = 22
|
||||||
|
Color = clBtnFace
|
||||||
|
NumGlyphs = 0
|
||||||
|
OnClick = btnMoveDownClick
|
||||||
|
end
|
||||||
object pnlButtons: TPanel
|
object pnlButtons: TPanel
|
||||||
Height = 42
|
Height = 42
|
||||||
Top = 288
|
Top = 288
|
||||||
Width = 651
|
Width = 651
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
|
ClientHeight = 42
|
||||||
|
ClientWidth = 651
|
||||||
Color = clGreen
|
Color = clGreen
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
@ -107,49 +145,14 @@ object EdtTbConfigForm: TEdtTbConfigForm
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
TopIndex = -1
|
TopIndex = -1
|
||||||
end
|
end
|
||||||
object btnRemove: TBitBtn
|
|
||||||
Left = 432
|
|
||||||
Height = 26
|
|
||||||
Top = 74
|
|
||||||
Width = 22
|
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = btnRemoveClick
|
|
||||||
TabOrder = 3
|
|
||||||
end
|
|
||||||
object btnAdd: TBitBtn
|
|
||||||
Left = 432
|
|
||||||
Height = 26
|
|
||||||
Top = 99
|
|
||||||
Width = 22
|
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = btnAddClick
|
|
||||||
TabOrder = 4
|
|
||||||
end
|
|
||||||
object btnMoveUp: TBitBtn
|
|
||||||
Left = 432
|
|
||||||
Height = 26
|
|
||||||
Top = 157
|
|
||||||
Width = 22
|
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = btnMoveUpClick
|
|
||||||
TabOrder = 5
|
|
||||||
end
|
|
||||||
object btnMoveDown: TBitBtn
|
|
||||||
Left = 432
|
|
||||||
Height = 26
|
|
||||||
Top = 182
|
|
||||||
Width = 22
|
|
||||||
NumGlyphs = 0
|
|
||||||
OnClick = btnMoveDownClick
|
|
||||||
TabOrder = 6
|
|
||||||
end
|
|
||||||
object TV: TTreeView
|
object TV: TTreeView
|
||||||
Left = 16
|
Left = 16
|
||||||
Height = 253
|
Height = 253
|
||||||
Top = 28
|
Top = 28
|
||||||
Width = 392
|
Width = 392
|
||||||
DefaultItemHeight = 18
|
DefaultItemHeight = 18
|
||||||
TabOrder = 7
|
ScrollBars = ssAutoBoth
|
||||||
|
TabOrder = 3
|
||||||
OnChange = TVChange
|
OnChange = TVChange
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,44 +1,48 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
LazarusResources.Add('TEdtTbConfigForm','FORMDATA',[
|
LazarusResources.Add('TEdtTbConfigForm','FORMDATA',[
|
||||||
'TPF0'#16'TEdtTbConfigForm'#15'EdtTbConfigForm'#4'Left'#3'w'#1#6'Height'#3'J'
|
'TPF0'#16'TEdtTbConfigForm'#15'EdtTbConfigForm'#4'Left'#3'w'#1#6'Height'#3'J'
|
||||||
+#1#3'Top'#3#200#0#5'Width'#3#139#2#18'HorzScrollBar.Page'#3#138#2#18'VertScr'
|
+#1#3'Top'#3#200#0#5'Width'#3#139#2#13'ActiveControl'#7#5'btnOK'#7'Caption'#6
|
||||||
+'ollBar.Page'#3'I'#1#13'ActiveControl'#7#5'btnOK'#7'Caption'#6#15'EdtTbConfi'
|
+#15'EdtTbConfigForm'#12'ClientHeight'#3'J'#1#11'ClientWidth'#3#139#2#8'OnCre'
|
||||||
+'gForm'#8'OnCreate'#7#10'FormCreate'#0#6'TLabel'#11'lblMenuTree'#4'Left'#2#16
|
+'ate'#7#10'FormCreate'#10'ParentFont'#8#10'LCLVersion'#6#6'0.9.25'#0#6'TLabe'
|
||||||
+#6'Height'#2#17#3'Top'#2#10#5'Width'#2'Y'#7'Caption'#6#11'lblMenuTree'#5'Col'
|
+'l'#11'lblMenuTree'#4'Left'#2#16#6'Height'#2#17#3'Top'#2#10#5'Width'#2'Y'#7
|
||||||
+'or'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLabel'#10'lblToolbar'#4'Left'#3#200
|
+'Caption'#6#11'lblMenuTree'#11'ParentColor'#8#0#0#6'TLabel'#10'lblToolbar'#4
|
||||||
+#1#6'Height'#2#17#3'Top'#2#10#5'Width'#2'F'#7'Caption'#6#10'lblToolbar'#5'Co'
|
+'Left'#3#200#1#6'Height'#2#17#3'Top'#2#10#5'Width'#2'F'#7'Caption'#6#10'lblT'
|
||||||
+'lor'#7#6'clNone'#11'ParentColor'#8#0#0#6'TPanel'#10'pnlButtons'#6'Height'#2
|
+'oolbar'#11'ParentColor'#8#0#0#12'TSpeedButton'#9'btnRemove'#4'Left'#3#176#1
|
||||||
+'*'#3'Top'#3' '#1#5'Width'#3#139#2#5'Align'#7#8'alBottom'#10'BevelOuter'#7#6
|
+#6'Height'#2#26#3'Top'#2'J'#5'Width'#2#22#5'Color'#7#9'clBtnFace'#9'NumGlyph'
|
||||||
+'bvNone'#5'Color'#7#7'clGreen'#11'ParentColor'#8#8'TabOrder'#2#0#0#6'TBevel'
|
+'s'#2#0#7'OnClick'#7#14'btnRemoveClick'#0#0#12'TSpeedButton'#6'btnAdd'#4'Lef'
|
||||||
+#6'Bevel1'#6'Height'#2#2#5'Width'#3#139#2#5'Align'#7#5'alTop'#0#0#7'TButton'
|
+'t'#3#176#1#6'Height'#2#26#3'Top'#2'c'#5'Width'#2#22#5'Color'#7#9'clBtnFace'
|
||||||
+#5'btnOK'#23'AnchorSideRight.Control'#7#9'btnCancel'#24'AnchorSideBottom.Con'
|
+#9'NumGlyphs'#2#0#7'OnClick'#7#11'btnAddClick'#0#0#12'TSpeedButton'#9'btnMov'
|
||||||
+'trol'#7#10'pnlButtons'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3
|
+'eUp'#4'Left'#3#176#1#6'Height'#2#26#3'Top'#3#157#0#5'Width'#2#22#5'Color'#7
|
||||||
+#221#1#6'Height'#2#25#3'Top'#2#11#5'Width'#2'K'#7'Anchors'#11#7'akRight'#8'a'
|
+#9'clBtnFace'#9'NumGlyphs'#2#0#7'OnClick'#7#14'btnMoveUpClick'#0#0#12'TSpeed'
|
||||||
+'kBottom'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Botto'
|
+'Button'#11'btnMoveDown'#4'Left'#3#176#1#6'Height'#2#26#3'Top'#3#182#0#5'Wid'
|
||||||
+'m'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#5'btnOK'#21'Constrain'
|
+'th'#2#22#5'Color'#7#9'clBtnFace'#9'NumGlyphs'#2#0#7'OnClick'#7#16'btnMoveDo'
|
||||||
+'ts.MaxHeight'#2#25#21'Constraints.MinHeight'#2#25#20'Constraints.MinWidth'#2
|
+'wnClick'#0#0#6'TPanel'#10'pnlButtons'#6'Height'#2'*'#3'Top'#3' '#1#5'Width'
|
||||||
+'K'#11'ModalResult'#2#1#7'OnClick'#7#10'btnOKClick'#8'TabOrder'#2#0#0#0#7'TB'
|
+#3#139#2#5'Align'#7#8'alBottom'#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2
|
||||||
+'utton'#9'btnCancel'#23'AnchorSideRight.Control'#7#10'pnlButtons'#20'AnchorS'
|
+'*'#11'ClientWidth'#3#139#2#5'Color'#7#7'clGreen'#11'ParentColor'#8#8'TabOrd'
|
||||||
+'ideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7#10'pnlButtons'
|
+'er'#2#0#0#6'TBevel'#6'Bevel1'#6'Height'#2#2#5'Width'#3#139#2#5'Align'#7#5'a'
|
||||||
+#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'.'#2#6'Height'#2#25#3'To'
|
+'lTop'#0#0#7'TButton'#5'btnOK'#23'AnchorSideRight.Control'#7#9'btnCancel'#24
|
||||||
+'p'#2#11#5'Width'#2'W'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9
|
+'AnchorSideBottom.Control'#7#10'pnlButtons'#21'AnchorSideBottom.Side'#7#9'as'
|
||||||
+#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Bottom'#2#6#25'BorderSpacing.I'
|
+'rBottom'#4'Left'#3#221#1#6'Height'#2#25#3'Top'#2#11#5'Width'#2'K'#7'Anchors'
|
||||||
+'nnerBorder'#2#4#6'Cancel'#9#7'Caption'#6#9'btnCancel'#21'Constraints.MaxHei'
|
+#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#6#20'Bo'
|
||||||
+'ght'#2#25#21'Constraints.MinHeight'#2#25#20'Constraints.MinWidth'#2'K'#11'M'
|
+'rderSpacing.Bottom'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#5'bt'
|
||||||
+'odalResult'#2#2#8'TabOrder'#2#1#0#0#0#7'TButton'#13'btnAddDivider'#4'Left'#3
|
+'nOK'#21'Constraints.MaxHeight'#2#25#21'Constraints.MinHeight'#2#25#20'Const'
|
||||||
+#236#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2's'#7'Anchors'#11#7'akRight'#8
|
+'raints.MinWidth'#2'K'#11'ModalResult'#2#1#7'OnClick'#7#10'btnOKClick'#8'Tab'
|
||||||
+'akBottom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#13
|
+'Order'#2#0#0#0#7'TButton'#9'btnCancel'#23'AnchorSideRight.Control'#7#10'pnl'
|
||||||
+'btnAddDivider'#21'Constraints.MaxHeight'#2#25#21'Constraints.MinHeight'#2#25
|
+'Buttons'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Contro'
|
||||||
+#20'Constraints.MinWidth'#2'K'#7'OnClick'#7#18'btnAddDividerClick'#8'TabOrde'
|
+'l'#7#10'pnlButtons'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'.'#2
|
||||||
+'r'#2#1#0#0#8'TListBox'#9'lbToolbar'#4'Left'#3#200#1#6'Height'#3#225#0#3'Top'
|
+#6'Height'#2#25#3'Top'#2#11#5'Width'#2'W'#7'Anchors'#11#7'akRight'#8'akBotto'
|
||||||
+#2#28#5'Width'#3#183#0#8'TabOrder'#2#2#8'TopIndex'#2#255#0#0#7'TBitBtn'#9'bt'
|
+'m'#0#8'AutoSize'#9#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Bottom'#2#6
|
||||||
+'nRemove'#4'Left'#3#176#1#6'Height'#2#26#3'Top'#2'J'#5'Width'#2#22#9'NumGlyp'
|
+#25'BorderSpacing.InnerBorder'#2#4#6'Cancel'#9#7'Caption'#6#9'btnCancel'#21
|
||||||
+'hs'#2#0#7'OnClick'#7#14'btnRemoveClick'#8'TabOrder'#2#3#0#0#7'TBitBtn'#6'bt'
|
+'Constraints.MaxHeight'#2#25#21'Constraints.MinHeight'#2#25#20'Constraints.M'
|
||||||
+'nAdd'#4'Left'#3#176#1#6'Height'#2#26#3'Top'#2'c'#5'Width'#2#22#9'NumGlyphs'
|
+'inWidth'#2'K'#11'ModalResult'#2#2#8'TabOrder'#2#1#0#0#0#7'TButton'#13'btnAd'
|
||||||
+#2#0#7'OnClick'#7#11'btnAddClick'#8'TabOrder'#2#4#0#0#7'TBitBtn'#9'btnMoveUp'
|
+'dDivider'#4'Left'#3#236#1#6'Height'#2#25#3'Top'#3#0#1#5'Width'#2's'#7'Ancho'
|
||||||
+#4'Left'#3#176#1#6'Height'#2#26#3'Top'#3#157#0#5'Width'#2#22#9'NumGlyphs'#2#0
|
+'rs'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#25'BorderSpacing.InnerBorder'
|
||||||
+#7'OnClick'#7#14'btnMoveUpClick'#8'TabOrder'#2#5#0#0#7'TBitBtn'#11'btnMoveDo'
|
+#2#4#7'Caption'#6#13'btnAddDivider'#21'Constraints.MaxHeight'#2#25#21'Constr'
|
||||||
+'wn'#4'Left'#3#176#1#6'Height'#2#26#3'Top'#3#182#0#5'Width'#2#22#9'NumGlyphs'
|
+'aints.MinHeight'#2#25#20'Constraints.MinWidth'#2'K'#7'OnClick'#7#18'btnAddD'
|
||||||
+#2#0#7'OnClick'#7#16'btnMoveDownClick'#8'TabOrder'#2#6#0#0#9'TTreeView'#2'TV'
|
+'ividerClick'#8'TabOrder'#2#1#0#0#8'TListBox'#9'lbToolbar'#4'Left'#3#200#1#6
|
||||||
+#4'Left'#2#16#6'Height'#3#253#0#3'Top'#2#28#5'Width'#3#136#1#17'DefaultItemH'
|
+'Height'#3#225#0#3'Top'#2#28#5'Width'#3#183#0#8'TabOrder'#2#2#8'TopIndex'#2
|
||||||
+'eight'#2#18#8'TabOrder'#2#7#8'OnChange'#7#8'TVChange'#0#0#0
|
+#255#0#0#9'TTreeView'#2'TV'#4'Left'#2#16#6'Height'#3#253#0#3'Top'#2#28#5'Wid'
|
||||||
|
+'th'#3#136#1#17'DefaultItemHeight'#2#18#10'ScrollBars'#7#10'ssAutoBoth'#8'Ta'
|
||||||
|
+'bOrder'#2#3#8'OnChange'#7#8'TVChange'#0#0#0
|
||||||
]);
|
]);
|
||||||
|
@ -29,13 +29,13 @@ uses
|
|||||||
type
|
type
|
||||||
TEdtTbConfigForm = class(TForm)
|
TEdtTbConfigForm = class(TForm)
|
||||||
Bevel1: TBevel;
|
Bevel1: TBevel;
|
||||||
btnRemove: TBitBtn;
|
btnAdd: TSpeedButton;
|
||||||
btnAdd: TBitBtn;
|
btnMoveDown: TSpeedButton;
|
||||||
btnMoveUp: TBitBtn;
|
btnMoveUp: TSpeedButton;
|
||||||
btnMoveDown: TBitBtn;
|
|
||||||
btnOK: TButton;
|
btnOK: TButton;
|
||||||
btnCancel: TButton;
|
btnCancel: TButton;
|
||||||
btnAddDivider: TButton;
|
btnAddDivider: TButton;
|
||||||
|
btnRemove: TSpeedButton;
|
||||||
lblMenuTree: TLabel;
|
lblMenuTree: TLabel;
|
||||||
lblToolbar: TLabel;
|
lblToolbar: TLabel;
|
||||||
lbToolbar: TListBox;
|
lbToolbar: TListBox;
|
||||||
@ -83,24 +83,15 @@ resourcestring
|
|||||||
{ TEdtTbConfigForm }
|
{ TEdtTbConfigForm }
|
||||||
|
|
||||||
procedure TEdtTbConfigForm.FormCreate(Sender: TObject);
|
procedure TEdtTbConfigForm.FormCreate(Sender: TObject);
|
||||||
|
|
||||||
procedure LoadImageToBtn(ImageName: String; Btn: TBitBtn); inline;
|
|
||||||
var
|
|
||||||
B: TCustomBitmap;
|
|
||||||
begin
|
|
||||||
B := CreateBitmapFromLazarusResource(ImageName);
|
|
||||||
Btn.Glyph.Assign(B);
|
|
||||||
B.Free;
|
|
||||||
end;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
pnlButtons.Color := clBtnFace;
|
pnlButtons.Color := clBtnFace;
|
||||||
|
|
||||||
// load button images
|
// load button images
|
||||||
LoadImageToBtn('arrowleft_blue16', btnRemove);
|
btnRemove.LoadGlyphFromLazarusResource('arrow_left');
|
||||||
LoadImageToBtn('arrowright_blue16', btnAdd);
|
btnAdd.LoadGlyphFromLazarusResource('arrow_right');
|
||||||
LoadImageToBtn('arrowup_blue16', btnMoveUp);
|
btnMoveUp.LoadGlyphFromLazarusResource('arrow_up');
|
||||||
LoadImageToBtn('arrowdown_blue16', btnMoveDown);
|
btnMoveDown.LoadGlyphFromLazarusResource('arrow_down');
|
||||||
|
|
||||||
TV.Images := IDEImages.Images_16;
|
TV.Images := IDEImages.Images_16;
|
||||||
SetupCaptions;
|
SetupCaptions;
|
||||||
@ -254,6 +245,7 @@ var
|
|||||||
begin
|
begin
|
||||||
n := TV.Items.AddChild(ParentNode, Format('%s', [Item.Caption]));
|
n := TV.Items.AddChild(ParentNode, Format('%s', [Item.Caption]));
|
||||||
n.ImageIndex := Item.ImageIndex;
|
n.ImageIndex := Item.ImageIndex;
|
||||||
|
n.SelectedIndex := Item.ImageIndex;
|
||||||
n.Data := Item;
|
n.Data := Item;
|
||||||
if Item is TIDEMenuSection then
|
if Item is TIDEMenuSection then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user