From 363e7c6b3c400056217c607f5c90eff5e385fb0a Mon Sep 17 00:00:00 2001 From: h677 Date: Sun, 6 Aug 2006 03:17:02 +0000 Subject: [PATCH 1/1] =?utf8?q?=E3=83=AA=E3=83=B3=E3=82=AF=E7=A7=BB?= =?utf8?q?=E5=8B=95=E5=B1=A5=E6=AD=B4=E3=81=AE=E4=BF=9D=E6=8C=81=E6=95=B0?= =?utf8?q?=E3=82=92=E8=A8=AD=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KuroutSetting.dfm | 29 +++++++++++++++++++++++++++++ KuroutSetting.pas | 9 +++++++++ MoveHistoryItem.pas | 42 +++++++++++++++++++++++++++++++++++------- Setting.pas | 24 ++++++++++++++++++++++-- 4 files changed, 95 insertions(+), 9 deletions(-) diff --git a/KuroutSetting.dfm b/KuroutSetting.dfm index af703b7..f46be37 100644 --- a/KuroutSetting.dfm +++ b/KuroutSetting.dfm @@ -395,6 +395,35 @@ object KuroutOption: TKuroutOption TabOrder = 0 end end + object GroupBox3: TGroupBox + Left = 16 + Top = 126 + Width = 473 + Height = 51 + Caption = #12522#12531#12463#31227#21205#23653#27508 + TabOrder = 1 + object Label10: TLabel + Left = 8 + Top = 20 + Width = 84 + Height = 12 + Caption = #23653#27508#26368#22823#20445#25345#25968 + end + object Label11: TLabel + Left = 227 + Top = 20 + Width = 158 + Height = 12 + Caption = #65288#12487#12501#12457#12523#12488'=20 '#20877#36215#21205#24460#26377#21177#65289 + end + object MoveHistoryMaxEdit: TEdit + Left = 112 + Top = 16 + Width = 105 + Height = 20 + TabOrder = 0 + end + end end end object OkBotton: TButton diff --git a/KuroutSetting.pas b/KuroutSetting.pas index bc2d32a..156cf66 100644 --- a/KuroutSetting.pas +++ b/KuroutSetting.pas @@ -61,6 +61,10 @@ type Label8: TLabel; FixedCookieEdit: TEdit; Label9: TLabel; + GroupBox3: TGroupBox; + Label10: TLabel; + MoveHistoryMaxEdit: TEdit; + Label11: TLabel; procedure OkBottonClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure CDeleteButtonClick(Sender: TObject); @@ -123,6 +127,8 @@ begin RemoteTrapAtt.Checked := GikoSys.Setting.RemoteTrapAtt; // Cookie FixedCookieEdit.Text := GikoSys.Setting.FixedCookie; + // ƒŠƒ“ƒNˆÚ“®—š—ð + MoveHistoryMaxEdit.Text := IntToStr( GikoSys.Setting.MoveHistorySize ); end; procedure TKuroutOption.SaveSetting; @@ -150,6 +156,9 @@ begin // Cookie GikoSys.Setting.FixedCookie := FixedCookieEdit.Text; + // ƒŠƒ“ƒNˆÚ“®—š—ð + GikoSys.Setting.MoveHistorySize := + StrToIntDef( MoveHistoryMaxEdit.Text, 20 ); GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex; end; diff --git a/MoveHistoryItem.pas b/MoveHistoryItem.pas index 7682c5c..bbfa6c0 100644 --- a/MoveHistoryItem.pas +++ b/MoveHistoryItem.pas @@ -27,6 +27,16 @@ type private FHistoryMax : Integer; FIndex : Integer; + { + \brief ƒŠƒ“ƒNˆÚ“®—š—ðÅ‘å•ÛŽ”‚ðÝ’è‚·‚éB + \param AVal •ÛŽ” + } + procedure SetHistoryMax(AVal: Integer); + { + \brief ƒŠƒ“ƒNˆÚ“®—š—ðÅ‘å•ÛŽ”‚ðŽæ“¾‚·‚éB + \return •ÛŽ”( > 0 ) + } + function GetHistoryMax: Integer; public constructor Create( max : Integer ); overload; function pushItem( item: TMoveHistoryItem): Integer; overload; @@ -34,7 +44,7 @@ type function getPrevItem( item: TBrowserRecord): TMoveHistoryItem; function getNextItem: TMoveHistoryItem; procedure clear; override; - property HistoryMax : Integer read FHistoryMax write FHistoryMax; + property HistoryMax : Integer read GetHistoryMax write SetHistoryMax; property HisotryIndex: Integer read FIndex; end; @@ -43,16 +53,18 @@ var implementation +uses + GikoSystem; + + //! ƒRƒ“ƒXƒgƒ‰ƒNƒ^ constructor TMoveHistory.Create( max : Integer ); begin inherited Create; FIndex := 0; - FHistoryMax := max; - if (FHistoryMax < 0) then begin - FHistoryMax := 20; - end; + + SetHistoryMax( GikoSys.Setting.MoveHistorySize ); end; //! ˆÚ“®—š—ð‚̃AƒCƒeƒ€’ljÁ function TMoveHistory.pushItem( item: TMoveHistoryItem): Integer; @@ -130,7 +142,7 @@ procedure TMoveHistory.clear; var i : Integer; begin - // FIndex‚æ‚èŒã‚ë‚̃AƒCƒeƒ€‚ðíœ‚·‚é + // ƒAƒCƒeƒ€‚ðíœ‚·‚é for i := Self.Count - 1 downto 0 do begin if (Self.Items [i] <> nil) then begin TMoveHistoryItem( Self.Items[i] ).Free; @@ -138,10 +150,26 @@ begin Self.Delete(i); end; Self.Capacity := 0; - + FIndex := 0; inherited; end; +procedure TMoveHistory.SetHistoryMax(AVal: Integer); +begin + // —š—ð‚̃TƒCƒY‚Í0‚æ‚è‘å‚«‚­‚È‚¢‚Æ‚¢‚¯‚È‚¢ + if ( AVal > 0 ) then begin + if ((AVal + 1) <> FHistoryMax) then begin + Self.clear; + // ˆÚ“®‚µ‚½Û‚ɁA–߂郊ƒ“ƒN‚ð1‚‘«‚·‚Ì‚Å + FHistoryMax := AVal + 1; + end; + end; +end; +function TMoveHistory.GetHistoryMax: Integer; +begin + // ˆÚ“®‚µ‚½Û‚ɁA–߂郊ƒ“ƒN‚ð1‚‘«‚·‚Ì‚Å + Result := FHistoryMax - 1; +end; initialization MoveHisotryManager := TMoveHistory.Create( 20 ); diff --git a/Setting.pas b/Setting.pas index fa1a9d9..c657607 100644 --- a/Setting.pas +++ b/Setting.pas @@ -430,8 +430,10 @@ type FInputAssistFormWidth: Integer; FInputAssistFormHeight: Integer; - // Cookie‚É•t‰Á‚·‚éŒÅ’èƒR[ƒh + //! Cookie‚É•t‰Á‚·‚éŒÅ’èƒR[ƒh FFixedCookie: String; + //! ƒŠƒ“ƒNˆÚ“®—š—ð‚Ì•ÛŽ” + FMoveHistorySize : Integer; function GetMainCoolSet(Index: Integer): TCoolSet; function GetBoardCoolSet(Index: Integer): TCoolSet; @@ -503,6 +505,11 @@ type function GetEditorKeyFileName: String; procedure WriteLogFolder(AVal : String); function GetInputAssistFileName : String; + { + \brief ƒŠƒ“ƒN—š—ð‚Ì•ÛŽƒTƒCƒY‚Ìsetter + \param AVal Ý’è‚·‚éƒTƒCƒY( >0) + } + procedure SetMoveHistorySize(AVal : Integer); //ŽóMƒoƒbƒtƒ@ƒTƒCƒY property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize; //HTTP1.1Žg—p @@ -758,6 +765,8 @@ type property InputAssistFormHeight: Integer read FInputAssistFormHeight write FInputAssistFormHeight; //! Cookie‚É•t‰Á‚·‚éŒÅ’èƒR[ƒh property FixedCookie: String read FFixedCookie write FFixedCookie; + // ƒŠƒ“ƒNˆÚ“®—š—ð‚Ì•ÛŽ” + property MoveHistorySize : Integer read FMoveHistorySize write SetMoveHistorySize; end; @@ -1381,6 +1390,9 @@ begin // Cookie‚É•t‰Á‚·‚éŒÅ’èƒR[ƒh FFixedCookie := ini.ReadString('Cookie', 'fixedString', FIXED_COOKIE); + // ƒŠƒ“ƒNˆÚ“®—š—ð‚̍őå•ÛŽ” + FMoveHistorySize := ini.ReadInteger('MoveHisotry', 'Max', 20); + ini.UpdateFile; finally ini.Free; @@ -1752,6 +1764,9 @@ begin // ŒÅ’è‚ÌCookie•¶Žš—ñ ini.WriteString('Cookie', 'fixedString', FFixedCookie); + // ƒŠƒ“ƒNˆÚ“®—š—ð‚̍őå•ÛŽ” + ini.WriteInteger('MoveHisotry', 'Max', FMoveHistorySize); + ini.UpdateFile; finally ini.Free; @@ -2225,7 +2240,12 @@ function TSetting.GetInputAssistFileName : String; begin Result := GetConfigDir + INPUTASSIST_FILE_NAME; end; - +procedure TSetting.SetMoveHistorySize(AVal : Integer); +begin + if (AVal > 0) then begin + FMoveHistorySize := AVal; + end; +end; end. -- 2.11.0