X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=ToolBarUtil.pas;h=e743c734e4ea6abdda03e087f1eae993ac17228b;hb=8f27c64f74975fafd826e82e61818895d3e3bb2d;hp=02b08e3477fb7239064985c98023559480a4dcb4;hpb=4ecb6819daba0994793861018c00d1167f664ab0;p=gikonavigoeson%2Fgikonavi.git diff --git a/ToolBarUtil.pas b/ToolBarUtil.pas index 02b08e3..e743c73 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', '', @@ -59,12 +61,15 @@ const ); - //ƒ{ƒ^ƒ“ƒXƒ^ƒCƒ‹‚ª"tbsCheck"ƒ{ƒ^ƒ“‚̃AƒNƒVƒ‡ƒ“ - CHECK_STYLE: array[0..31] of string = ('CabinetVisibleAction', + /// ƒ{ƒ^ƒ“ƒXƒ^ƒCƒ‹‚ª"tbsCheck"ƒ{ƒ^ƒ“‚̃AƒNƒVƒ‡ƒ“ + CHECK_STYLE: array[0..37] of string = ('CabinetVisibleAction', + 'MuteAction', 'ArrangeAction', 'AllItemAction', 'LogItemAction', 'NewItemAction', + 'LiveItemAction', + 'ArchiveItemAction', 'SelectItemAction', 'StdToolBarVisibleAction', @@ -92,13 +97,19 @@ const 'ListNumberVisibleAction', 'AllResAction', 'SelectResAction', - 'OnlyAHundredRes' + 'OnlyAHundredResAction', + 'OnlyKokoResAction', + 'OnlyNewResAction', + 'BeLogInOutAction' ); - //ƒ{ƒ^ƒ“‚̃Xƒ^ƒCƒ‹‚ª"tbsDropDown"ƒ{ƒ^ƒ“‚̃AƒNƒVƒ‡ƒ“ - DROPDOWN_STYLE: array[0..2] of string = ('IconStyle', + /// ƒ{ƒ^ƒ“‚̃Xƒ^ƒCƒ‹‚ª"tbsDropDown"ƒ{ƒ^ƒ“‚̃AƒNƒVƒ‡ƒ“ + /// Giko.pas : SetToolBarPopup ‚àC³‚·‚鎖 + DROPDOWN_STYLE: array[0..4] of string = ('IconStyle', 'IEAction', - 'CabinetBBSAction'); + 'CabinetBBSAction', + 'ResRangeAction', + 'ThreadRangeAction'); INI_FILENAME: string = 'ToolBar.ini'; @@ -111,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; @@ -134,6 +159,7 @@ begin 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; @@ -145,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); @@ -171,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; @@ -240,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;