6 Windows, Messages, SysUtils, Classes, Controls,
7 StdCtrls, ExtCtrls, ComCtrls, ActnList, Menus,
8 IniFiles, GikoSystem, MojuUtils, Giko;
10 procedure ReadSetting(ActionList: TActionList; PopupMenu: TPopupMenu);
11 function GetActionItem(ActionList: TActionList; ActionName: string): TCustomAction;
12 function GetMenuItem(Section: string; PopupMenu: TPopupMenu; ActionList: TActionList; MenuName: string): TMenuItem;
13 function checkActionName(Section: string ; ActionName: string): Boolean;
15 //!
\90Ý
\92è
\83t
\83@
\83C
\83\8b\96¼
16 INI_FILENAME: string = 'popupmenu.ini';
17 //!
\83u
\83\89\83E
\83U
\83^
\83u
\83Z
\83N
\83V
\83\87\83\93\96¼
18 BROWSER_TAB: string = 'BrowserTab';
19 //!
\83Z
\83N
\83V
\83\87\83\93\82Ì
\88ê
\97\97
20 SECTIONS : array[0..0] of string =( 'BrowserTab' ) ;
22 //!
\83u
\83\89\83E
\83U
\83^
\83u
\83|
\83b
\83v
\83A
\83b
\83v
\82É
\90Ý
\92è
\89Â
\94\
\82È
\83\81\83j
\83\85\81[
\96¼
23 ACK_BROWSER: array[0..7] of string = (
26 'BrowserTabCloseAction',
27 'NotSelectTabCloseAction',
29 'RightTabCloseAction',
30 'ActiveLogDeleteAction',
34 procedure ReadSetting(ActionList: TActionList; PopupMenu: TPopupMenu);
36 //
\93Á
\8eê
\83A
\83N
\83V
\83\87\83\93\96¼
37 //
\8f\84\89ñ
\83A
\83C
\83e
\83\80
38 ROUNDITEM = 'RoundItem';
39 //
\93¯
\88ê
\94Â
\83X
\83\8c\83b
\83h
\88ê
\97\97\97p
40 SAMPETHREAD='SameBoardThreadItem';
43 mkeys, skeys : TStringList;
45 value, subValue : String;
46 item, subItem : TMenuItem;
48 if (FileExists(GikoSys.Setting.GetConfigDir + INI_FILENAME)) Then begin
49 ini := TMemIniFile.Create(GikoSys.Setting.GetConfigDir + INI_FILENAME);
50 mkeys := TStringList.Create;
52 skeys := TStringList.Create;
55 for idx := 0 to Length(SECTIONS) - 1 do begin
56 ini.ReadSection(SECTIONS[idx], mkeys);
57 // main
\91æ
\88ê
\8aK
\91w sub
\91æ
\93ñ
\8aK
\91w
\82Ì
\95ª
\97£
58 for i := mkeys.Count - 1 downto 0 do begin
59 if (Pos('sub', mkeys[i]) = 1) then begin
64 //
\91æ
\88ê
\8aK
\91w
\82Ì
\8f\88\97\9d
65 PopupMenu.Items.Clear;
66 for i := 0 to mkeys.Count - 1 do begin
67 value := ini.ReadString(SECTIONS[idx], mkeys[i], '-');
68 item := GetMenuItem(SECTIONS[idx], PopupMenu, ActionList, value);
69 if (item <> nil) then begin
70 PopupMenu.Items.Add(item);
71 //
\83A
\83N
\83V
\83\87\83\93\82ª
\90Ý
\92è
\82³
\82ê
\82Ä
\82¢
\82é
\82à
\82Ì
\82É
\82Í
\91æ
\93ñ
\91w
\82Í
\82Â
\82¯
\82È
\82¢
72 if (item.Action = nil) then begin
73 //
\91æ
\93ñ
\8aK
\91w
\82Ì
\8f\88\97\9d(
\82 \82ê
\82Î)
74 for j := 0 to skeys.Count - 1 do begin
75 if (Pos('sub.' + mkeys[i], skeys[j]) = 1) then begin
76 subValue := ini.ReadString(SECTIONS[idx], skeys[j], '-');
77 subItem := GetMenuItem(SECTIONS[idx], PopupMenu, ActionList, subValue);
78 if (subItem <> nil) then begin
86 //
\82±
\82Ì
\83Z
\83N
\83V
\83\87\83\93\82Ì
\8f\88\97\9d\82ª
\8fI
\82í
\82Á
\82½
\82Ì
\82Å
\83N
\83\8a\83A
97 //!
\83\81\83j
\83\85\81[
\82ð
\95Ô
\82·
98 function GetMenuItem(Section: string; PopupMenu: TPopupMenu; ActionList: TActionList; MenuName: string): TMenuItem;
100 Action: TCustomAction;
103 //
\83_
\83u
\83\8b\83N
\83H
\81[
\83g
\82Å
\8en
\82Ü
\82é
\82Æ
\82«
\82Í
\83\89\83x
\83\8b
104 if (Pos('"', MenuName)=1) then begin
105 Result := TMenuItem.Create(PopupMenu);
106 Result.Caption := Copy(MenuName, 2, Length(MenuName));
107 end else if (MenuName = '-' ) then begin
109 Result := TMenuItem.Create(PopupMenu);
110 Result.Caption := '-';
112 if (BROWSER_TAB = Section) then begin
113 //
\83u
\83\89\83E
\83U
\83^
\83u
\82Ì
\93Á
\8eê
\91Î
\89\9e
114 if (MenuName = 'RoundItem' ) then begin
116 //
\8f\84\89ñ
\83\81\83j
\83\85\81[
\97p
\83_
\83~
\81[
117 Result := TMenuItem.Create(PopupMenu);
118 Result.Name := 'RoundItem';
119 Result.Caption := GikoForm.ItemReservPMenu.Caption;
120 Result.Hint := GikoForm.ItemReservPMenu.Hint;
122 //
\8aù
\82É
\8eg
\82í
\82ê
\82Ä
\82é
\82Æ
\82«
\82Í
\83G
\83\89\81[
\82É
\82È
\82é
126 end else if (MenuName = 'BoardThreadItem' ) then begin
128 //
\93¯
\88ê
\94Â
\83X
\83\8c\83b
\83h
\95\
\8e¦
\97p
\83_
\83~
\81[
129 Result := TMenuItem.Create(PopupMenu);
130 Result.Name := 'BoardThreadItem';
131 Result.Caption := '
\93¯
\94Â
\82Å
\95\
\8e¦
\82µ
\82Ä
\82¢
\82é
\83X
\83\8c\83b
\83h';
133 //
\8aù
\82É
\8eg
\82í
\82ê
\82Ä
\82é
\82Æ
\82«
\82Í
\83G
\83\89\81[
\82É
\82È
\82é
139 //
\83\81\83j
\83\85\81[
\82ª
\8c\88\82Ü
\82ç
\82¸
\82É
\81A
\8b\96\89Â
\82³
\82ê
\82½
\83A
\83N
\83V
\83\87\83\93\96¼
\82È
\82çAction
\82©
\82ç
\8dì
\90¬
140 if (Result = nil) and (checkActionName(Section, MenuName)) then begin
141 Action := GetActionItem(ActionList, MenuName);
142 if Action <> nil then begin
143 Result := TMenuItem.Create(PopupMenu);
144 Result.Action := Action;
149 //ActionName
\82ÌAction
\82ð
\95Ô
\82µ
\82Ü
\82·
150 function GetActionItem(ActionList: TActionList; ActionName: string): TCustomAction;
154 for i := 0 to ActionList.ActionCount - 1 do begin
155 if ActionList.Actions[i].Name = ActionName then begin
156 Result := TCustomAction(ActionList.Actions[i]);
163 function checkActionName(Section: string ; ActionName: string): Boolean;
168 if (BROWSER_TAB = Section) then begin
169 for i :=0 to Length(ACK_BROWSER) - 1 do begin
170 if (ACK_BROWSER[i] = ActionName) then begin