OSDN Git Service

1.60.2.794
[gikonavigoeson/gikonavi.git] / ToolBarUtil.pas
index bfa2e96..2d16109 100644 (file)
@@ -4,12 +4,11 @@ interface
 
 uses
        Windows, Messages, SysUtils, Classes, Controls,
-       StdCtrls, ExtCtrls, ComCtrls, ActnList, IniFiles,
-       GikoSystem, MojuUtils;
+       StdCtrls, ExtCtrls, ComCtrls, ActnList;
 
 const
        //\95W\8f\80\83c\81[\83\8b\83o\81[\83f\83t\83H\83\8b\83g
-       DEF_STANDARD: array[0..9]       of string = ('RoundAction',
+       DEF_STANDARD: array[0..11]      of string = ('RoundAction',
                                                                                                                                                                        '',
                                                                                                                                                                        'ArrangeAction',
                                                                                                                                                                        '',
@@ -18,15 +17,19 @@ const
                                                                                                                                                                        '',
                                                                                                                                                                        'CabinetBBSAction',
                                                                                                                                                                        'CabinetHistoryAction',
-                                                                                                                                                                       'CabinetFavoriteAction');
+                                                                                                                                                                       'CabinetFavoriteAction',
+                                                                                                                                                                       'MuteAction',
+                                                                                    'BeLogInOutAction');
        //\83\8a\83X\83g\83c\81[\83\8b\83o\81[\83f\83t\83H\83\8b\83g
-       DEF_LIST:       array[0..16] of string = ('ListNumberVisibleAction',
+       DEF_LIST:       array[0..18] of string = ('ListNumberVisibleAction',
                                                                                                                                                                        'IconStyle',
                                                                                                                                                                        'UpFolderAction',
                                                                                                                                                                        '',
                                                                                                                                                                        'AllItemAction',
                                                                                                                                                                        'LogItemAction',
                                                                                                                                                                        'NewItemAction',
+                                                                                                                                                                       'LiveItemAction',
+                                                                                                                                                                       'ArchiveItemAction',
                                                                                                                                                                        'SelectItemAction',
                                                                                                                                                                        '',
                                                                                                                                                                        'ThreadEditorAction',
@@ -59,11 +62,14 @@ const
 
 
        /// \83{\83^\83\93\83X\83^\83C\83\8b\82ª"tbsCheck"\83{\83^\83\93\82Ì\83A\83N\83V\83\87\83\93
-       CHECK_STYLE:   array[0..33] of string = ('CabinetVisibleAction',
+       CHECK_STYLE:   array[0..37] of string = ('CabinetVisibleAction',
+                                                                                    'MuteAction',
                                                                                                                                                                        'ArrangeAction',
                                                                                                                                                                        'AllItemAction',
                                                                                                                                                                        'LogItemAction',
                                                                                                                                                                        'NewItemAction',
+                                                                                                                                                                       'LiveItemAction',
+                                                                                                                                                                       'ArchiveItemAction',
                                                                                                                                                                        'SelectItemAction',
 
                                                                                                                                                                        'StdToolBarVisibleAction',
@@ -93,7 +99,8 @@ const
                                                                                                                                                                        'SelectResAction',
                                                                                                                                                                        'OnlyAHundredResAction',
                                                                                                                                                                        'OnlyKokoResAction',
-                                                                                                                                                                       'OnlyNewResAction'
+                                                                                                                                                                       'OnlyNewResAction',
+                                                                                    'BeLogInOutAction'
                                                                                                                                                                        );
 
        /// \83{\83^\83\93\82Ì\83X\83^\83C\83\8b\82ª"tbsDropDown"\83{\83^\83\93\82Ì\83A\83N\83V\83\87\83\93
@@ -115,10 +122,13 @@ const
        function GetActionItem(ActionList: TActionList; ActionName: string): TCustomAction;
        procedure ReadToolBarSetting(ActionList: TActionList; ToolBar: TToolBar);
        procedure SaveToolBarSetting(ToolBar: TToolBar);
-    procedure KeepDefaultToolButton(ToolBar: TToolBar; TmpToolBar: TToolBar);
-    procedure MakeDefaultINIFile();
+       procedure MakeDefaultINIFile();
+
 implementation
 
+uses
+       IniFiles,       GikoSystem, MojuUtils;
+
 function ConvertToolButton( setting : string ) : string;
 begin
 
@@ -142,7 +152,7 @@ begin
        FileName := GikoSys.GetConfigDir + INI_FILENAME;
        if FileExists(FileName) then begin
                for i := ToolBar.ButtonCount - 1 downto 0 do begin
-                       ToolBar.RemoveControl(ToolBar.Buttons[i]);
+                       ToolBar.Buttons[i].HostDockSite := nil;
                end;
                ini := TMemIniFile.Create(FileName);
                try
@@ -161,6 +171,9 @@ begin
                                        if Action <> nil then begin
                                                ToolButton := TToolButton.Create(ToolBar);
                                                ToolButton.Action := Action;
+                                               if ToolButton.ImageIndex = -1 then
+                                                       ToolButton.ImageIndex := 51;
+
                                                ToolButton.Left := 10000;
                                                SetButtonStyle(Action, ToolButton);
                                                ToolBar.InsertControl(ToolButton);
@@ -187,12 +200,15 @@ begin
                ini.EraseSection(ToolBar.Name);
                for i := 0 to ToolBar.ButtonCount - 1 do begin
                        if ToolBar.Buttons[i].Style = tbsSeparator then begin
-                                ini.WriteString(ToolBar.Name, 'Button' + IntToStr(j), '-');
-                                Inc( j );
+                //SelectComboBox\97p\82Ì\83_\83~\81[\82Í\95Û\91\82µ\82È\82¢
+                               if not (ToolBar.Buttons[i].Name = 'SelectComboBoxDummy') then begin
+                                       ini.WriteString(ToolBar.Name, 'Button' + IntToStr(j), '-');
+                                       Inc( j );
+                               end;
                        end else begin
                                Action := ToolBar.Buttons[i].Action;
                                if Action <> nil then
-                                begin
+                                                               begin
                                        ini.WriteString(ToolBar.Name, 'Button' + IntToStr(j), Action.Name);
                                         Inc( j );
                                 end;
@@ -256,14 +272,7 @@ begin
        end;
        Result := False;
 end;
-procedure KeepDefaultToolButton(ToolBar: TToolBar; TmpToolBar: TToolBar);
-var
-       i: Integer;
-begin
-       for i := ToolBar.ButtonCount - 1 downto 0 do begin
-       ToolBar.Buttons[i].Parent := TmpToolBar;
-    end;
-end;
+
 procedure MakeDefaultINIFile();
 var
        ini: TMemIniFile;