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