X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=ToolBarSetting.pas;h=c0e8b2a95336079d9a4e095347f2cc5c1e0696f6;hb=99f2be3a17dfec20c0edcaaa09e20c39a74d3af9;hp=6189da00512acef1b7ed1de816793acf5fadb654;hpb=50e18d9d1f64c5276d9b79f75a3cd49ced8a5d0c;p=gikonavigoeson%2Fgikonavi.git diff --git a/ToolBarSetting.pas b/ToolBarSetting.pas index 6189da0..c0e8b2a 100644 --- a/ToolBarSetting.pas +++ b/ToolBarSetting.pas @@ -60,6 +60,7 @@ type { Private éŒ¾ } FActionList: TActionList; FAllList: TList; + FToolBarIndex : Integer; // ‰Šú•\Ž¦‚·‚éƒc[ƒ‹ƒo[ procedure CreateListData(ToolBarItem: TToolBarItem); procedure MoveItem(Offset: Integer); procedure Sort; @@ -68,6 +69,7 @@ type { Public éŒ¾ } constructor Create(AOwner: TComponent; ActionList: TActionList); reintroduce; overload; virtual; procedure AddToolBar(ToolBar: TToolBar; ToolType: TGikoToolType); + property ToolBarIndex : Integer read FToolBarIndex write FToolBarIndex; end; var @@ -77,9 +79,9 @@ function CompareCategory(Item1, Item2: Pointer): Integer; implementation -const - //‹æØ‚蕶Žš - SEPARATOR_TEXT = '- ‹æØ‚è -'; +//const +// //‹æØ‚蕶Žš +// SEPARATOR_TEXT = '- ‹æØ‚è -'; {$R *.dfm} @@ -109,7 +111,18 @@ end; //ƒtƒH[ƒ€ì¬ procedure TToolBarSettingDialog.FormCreate(Sender: TObject); +var + CenterForm: TCustomForm; begin + CenterForm := TCustomForm(Owner); + if Assigned(CenterForm) then begin + Left := ((CenterForm.Width - Width) div 2) + CenterForm.Left; + Top := ((CenterForm.Height - Height) div 2) + CenterForm.Top; + end else begin + Left := (Screen.Width - Width) div 2; + Top := (Screen.Height - Height) div 2; + end; + FAllList := TList.Create; end; @@ -126,7 +139,7 @@ end; //•\Ž¦‚µ‚½‚Æ‚« procedure TToolBarSettingDialog.FormShow(Sender: TObject); begin - ToolBarComboBox.ItemIndex := 0; + ToolBarComboBox.ItemIndex := FToolBarIndex; ToolBarComboBoxChange(Self); AllListViewChange(Sender, nil, ctState); CurrentListViewChange(Sender, nil, ctState); @@ -142,7 +155,8 @@ begin ToolBarItem.ToolBar := ToolBar; ToolBarItem.ToolType := ToolType; for i := 0 to ToolBar.ControlCount - 1 do - if ToolBar.Controls[ i ] is TToolButton Then + if ToolBar.Controls[ i ] is TToolButton Then + if not (ToolBar.Controls[ i ].Name = 'SelectComboBoxDummy') Then ToolBarITem.ButtonActionList.Add(ToolBar.Controls[i].Action); ToolBarComboBox.Items.AddObject(ToolBar.Caption, ToolBarItem); end; @@ -174,7 +188,7 @@ begin ToolBarItem := TToolBarItem(ToolBarComboBox.Items.Objects[i]); for j := ToolBarItem.ToolBar.ButtonCount - 1 downto 0 do - ToolBarItem.ToolBar.RemoveControl(ToolBarItem.ToolBar.Buttons[j]); + ToolBarItem.ToolBar.Buttons[j].HostDockSite := nil; for j := 0 to ToolBarItem.ButtonActionList.Count - 1 do begin if ToolBarItem.ButtonActionList[j] = nil then begin @@ -186,6 +200,9 @@ begin end else if TObject(ToolBarItem.ButtonActionList[j]) is TCustomAction then begin ToolButton := TToolButton.Create(ToolBarItem.ToolBar); ToolButton.Action := TCustomAction(ToolBarItem.ButtonActionList[j]); + if ToolButton.ImageIndex = -1 then + ToolButton.ImageIndex := 51; + ToolButton.Left := 10000; SetButtonStyle(ToolBarItem.ButtonActionList[j], ToolButton); ToolBarItem.ToolBar.InsertControl(ToolButton);