OSDN Git Service

・板一覧更新の処理メッセージを追加
[gikonavigoeson/gikonavi.git] / ToolBarSetting.pas
index 9d3467f..c0e8b2a 100644 (file)
@@ -60,6 +60,7 @@ type
                { Private \90é\8c¾ }
                FActionList: TActionList;
                FAllList: TList;
+               FToolBarIndex : Integer;        // \8f\89\8aú\95\\8e¦\82·\82é\83c\81[\83\8b\83o\81[
                procedure CreateListData(ToolBarItem: TToolBarItem);
                procedure MoveItem(Offset: Integer);
                procedure Sort;
@@ -68,6 +69,7 @@ type
                { Public \90é\8c¾ }
                constructor Create(AOwner: TComponent; ActionList: TActionList); reintroduce; overload; virtual;
                procedure AddToolBar(ToolBar: TToolBar; ToolType: TGikoToolType);
+               property        ToolBarIndex : Integer read FToolBarIndex write FToolBarIndex;
        end;
 
 var
@@ -109,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;
 
@@ -126,7 +139,7 @@ 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);
@@ -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);