X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=ToolBarUtil.pas;h=2d161093b9f090902bc3641108e0600e86fbf631;hb=b0e061392b57a75421b19462fec340e81231b5f0;hp=a811ad1eb05b30d416decae54761da23c492ccfa;hpb=57eb2e77d851bd5b1f8f84de616c56ad2f77f5f2;p=gikonavigoeson%2Fgikonavi.git diff --git a/ToolBarUtil.pas b/ToolBarUtil.pas index a811ad1..2d16109 100644 --- a/ToolBarUtil.pas +++ b/ToolBarUtil.pas @@ -4,12 +4,11 @@ interface uses Windows, Messages, SysUtils, Classes, Controls, - StdCtrls, ExtCtrls, ComCtrls, ActnList, IniFiles, - GikoSystem; + StdCtrls, ExtCtrls, ComCtrls, ActnList; const //•W€ƒc[ƒ‹ƒo[ƒfƒtƒHƒ‹ƒg - 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'); //ƒŠƒXƒgƒc[ƒ‹ƒo[ƒfƒtƒHƒ‹ƒg - 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', @@ -38,7 +41,7 @@ const '', 'SelectReservAction'); //ƒuƒ‰ƒEƒUƒc[ƒ‹ƒo[ƒfƒtƒHƒ‹ƒg - DEF_BROWSER: array[0..17] of string = ('BrowserMaxAction', + DEF_BROWSER: array[0..16] of string = ('BrowserMaxAction', 'BrowserMinAction', '', 'ScrollTopAction', @@ -46,9 +49,8 @@ const 'ScrollNewAction', 'ScrollKokoAction', '', - 'AllResAction', 'SelectResAction', - 'OnlyAHundredRes', + 'ResRangeAction', '', 'EditorAction', '', @@ -60,11 +62,14 @@ const /// ƒ{ƒ^ƒ“ƒXƒ^ƒCƒ‹‚ª"tbsCheck"ƒ{ƒ^ƒ“‚̃AƒNƒVƒ‡ƒ“ - 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', @@ -92,17 +97,19 @@ const 'ListNumberVisibleAction', 'AllResAction', 'SelectResAction', - 'OnlyAHundredRes', + 'OnlyAHundredResAction', 'OnlyKokoResAction', - 'OnlyNewResAction' + 'OnlyNewResAction', + 'BeLogInOutAction' ); /// ƒ{ƒ^ƒ“‚̃Xƒ^ƒCƒ‹‚ª"tbsDropDown"ƒ{ƒ^ƒ“‚̃AƒNƒVƒ‡ƒ“ /// Giko.pas : SetToolBarPopup ‚àC³‚·‚鎖 - DROPDOWN_STYLE: array[0..3] of string = ('IconStyle', + DROPDOWN_STYLE: array[0..4] of string = ('IconStyle', 'IEAction', 'CabinetBBSAction', - 'ResRangeAction'); + 'ResRangeAction', + 'ThreadRangeAction'); INI_FILENAME: string = 'ToolBar.ini'; @@ -115,10 +122,24 @@ 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 + + // ‹Œ [ÅV100ƒŒƒX‚Ì‚Ý•\Ž¦] ‚ð [ƒŒƒX‚Ì•\Ž¦”͈͂ðÝ’è] ‚É’uŠ· + if setting = 'OnlyAHundredRes' then + Result := 'ResRangeAction' + else + Result := setting; + +end; + procedure ReadToolBarSetting(ActionList: TActionList; ToolBar: TToolBar); var FileName: string; @@ -131,13 +152,14 @@ 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 i := 0; while True do begin s := ini.ReadString(ToolBar.Name, 'Button' + IntToStr(i), ''); + s := ConvertToolButton( s ); if s = '-' then begin ToolButton := TToolButton.Create(ToolBar); ToolButton.Style := tbsSeparator; @@ -149,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); @@ -175,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—p‚̃_ƒ~[‚Í•Û‘¶‚µ‚È‚¢ + 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; @@ -244,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;