OSDN Git Service

・板一覧更新の処理メッセージを追加
[gikonavigoeson/gikonavi.git] / ToolBarSetting.pas
index 5f1196c..c0e8b2a 100644 (file)
@@ -111,7 +111,18 @@ end;
 
 //\83t\83H\81[\83\80\8dì\90¬
 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;
 
@@ -128,11 +139,10 @@ end;
 //\95\\8e¦\82µ\82½\82Æ\82«
 procedure TToolBarSettingDialog.FormShow(Sender: TObject);
 begin
-       ToolBarComboBox.ItemIndex := 0;
+       ToolBarComboBox.ItemIndex := FToolBarIndex;
        ToolBarComboBoxChange(Self);
        AllListViewChange(Sender, nil, ctState);
        CurrentListViewChange(Sender, nil, ctState);
-       ToolBarComboBox.ItemIndex := FToolBarIndex;
 end;
 
 //\82±\82Ì\83_\83C\83A\83\8d\83O\82Å\83J\83X\83^\83}\83C\83Y\82·\82é\83c\81[\83\8b\83o\81[\82ð\93o\98^\82·\82é
@@ -145,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;
@@ -177,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
@@ -189,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);