OSDN Git Service

100レス表示で、先頭表示レス数を設定できるように変更。
authorh677 <h677>
Sun, 27 Aug 2006 16:30:02 +0000 (16:30 +0000)
committerh677 <h677>
Sun, 27 Aug 2006 16:30:02 +0000 (16:30 +0000)
HTMLCreate.pas
KuroutSetting.dfm
KuroutSetting.pas
Option.dfm
Setting.pas

index ff690d9..2917c2e 100644 (file)
@@ -67,7 +67,7 @@ type
              dat : boolean;    var s : String) : string;
         function getNumberString(const str: String;var index :Integer; var dbCharlen: Boolean;
              sLen :Integer): String;
-
+        function isOutsideRange(item: TThreadItem; index: Integer ): Boolean;
        public
                { Public \90é\8c¾ }
                procedure AddAnchorTag(PRes: PResRec);
@@ -637,7 +637,6 @@ begin
        PRes.FBody := PRes.FBody + res;
 
 end;
-
 //Plugin\82ð\97\98\97p\82·\82éBoard\82Ì\83X\83\8c\83b\83h\82ÌHTML\82ð\8dì\90¬\82µ\82Ädoc\82É\8f\91\82«\8d\9e\82Þ
 procedure THTMLCreate.CreateUsePluginHTML(html:TBufferedWebBrowser; ThreadItem: TThreadItem; var sTitle: string);
 var
@@ -660,17 +659,9 @@ begin
                // 1 \82Í\95K\82¸\95\\8e¦
                if i <> 0 then begin
                        // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                       case GikoSys.ResRange of
-                       Ord( grrKoko ):
-                               if ThreadItem.Kokomade > (i + 1) then
-                                       Continue;
-                       Ord( grrNew ):
-                               if NewReceiveNo > (i + 1) then
-                                       Continue;
-                       10..65535:
-                               if (threadItem.Count - i) > GikoSys.ResRange then
-                                       Continue;
-                       end;
+            if (isOutsideRange(ThreadItem, i)) then begin
+                Continue;
+            end;
                end;
 
                // \90V\92\85\83}\81[\83N
@@ -765,17 +756,9 @@ begin
                // 1 \82Í\95K\82¸\95\\8e¦
                if i <> 0 then begin
                        // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                       case GikoSys.ResRange of
-                       Ord( grrKoko ):
-                               if ThreadItem.Kokomade > (i + 1) then
-                                       Continue;
-                       Ord( grrNew ):
-                               if NewReceiveNo > (i + 1) then
-                                       Continue;
-                       10..65535:
-                               if (threadItem.Count - i) > GikoSys.ResRange then
-                                       Continue;
-                       end;
+            if (isOutsideRange(ThreadItem, i)) then begin
+                Continue;
+            end;
                end;
 
                // \90V\92\85\83}\81[\83N
@@ -862,18 +845,10 @@ begin
                for i := 0 to ReadList.Count - 1 do begin
                        // 1 \82Í\95K\82¸\95\\8e¦
                        if i <> 0 then begin
-                               // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                               case GikoSys.ResRange of
-                               Ord( grrKoko ):
-                                       if ThreadItem.Kokomade > (i + 1) then
-                                               Continue;
-                               Ord( grrNew ):
-                                       if NewReceiveNo > (i + 1) then
-                                               Continue;
-                               10..65535:
-                                       if (threadItem.Count - i) > GikoSys.ResRange then
-                                               Continue;
-                               end;
+                       // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
+                if (isOutsideRange(ThreadItem, i)) then begin
+                    Continue;
+                end;
                        end;
 
                        if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
@@ -932,17 +907,9 @@ begin
                // 1 \82Í\95K\82¸\95\\8e¦
                if i <> 0 then begin
                        // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
-                       case GikoSys.ResRange of
-                       Ord( grrKoko ):
-                               if ThreadItem.Kokomade > (i + 1) then
-                                       Continue;
-                       Ord( grrNew ):
-                               if NewReceiveNo > (i + 1) then
-                                       Continue;
-                       10..65535:
-                               if (threadItem.Count - i) > GikoSys.ResRange then
-                                       Continue;
-                       end;
+            if (isOutsideRange(ThreadItem, i)) then begin
+                Continue;
+            end;
                end;
 
                if (NewReceiveNo = (i + 1)) or ((NewReceiveNo = 0) and (i = 0)) then begin
@@ -1617,6 +1584,31 @@ begin
        Result := Result + '</BODY></HTML>';
 
 end;
+{
+\brief  \95\\8e¦\94Í\88Í\8aO\83\8c\83X\94Ô\8d\86\94»\92è\8f\88\97\9d
+\param  item    \95\\8e¦\83X\83\8c\83b\83h
+\param  index   \83\8c\83X\94Ô\8d\86
+\return ture:\95\\8e¦\94Í\88Í\8aO false:\95\\8e¦\94Í\88Í\93à
+}
+function THTMLCreate.isOutsideRange( item: TThreadItem; index: Integer ): Boolean;
+begin
+    Result := False;
+    // \95\\8e¦\94Í\88Í\82ð\8cÀ\92è
+    case GikoSys.ResRange of
+    Ord( grrKoko ):
+        if item.Kokomade > (index + 1) then
+            Result := True;
+    Ord( grrNew ):
+        if item.NewReceive > (index + 1) then
+            Result := True;
+    10..65535:
+        if (GikoSys.Setting.HeadResCount) < (index + 1)  then begin
+            if (item.Count - index) > GikoSys.ResRange then begin
+                Result := True;
+            end;
+        end;
+    end;
+end;
 constructor TBufferedWebBrowser.Create(Browser: TWebBrowser; BuffSize: Integer);
 begin
        inherited Create;
index f46be37..52a9913 100644 (file)
@@ -1,6 +1,6 @@
 object KuroutOption: TKuroutOption
-  Left = 285
-  Top = 132
+  Left = 319
+  Top = 169
   Width = 525
   Height = 457
   Caption = #35443#32048#35373#23450
@@ -21,8 +21,8 @@ object KuroutOption: TKuroutOption
     Top = 0
     Width = 517
     Height = 393
-    ActivePage = TabSheet1
-    TabIndex = 0
+    ActivePage = KakikomiTabSheet
+    TabIndex = 2
     TabOrder = 0
     object TabSheet1: TTabSheet
       Caption = #35443#32048#35373#23450#65297
@@ -422,6 +422,40 @@ object KuroutOption: TKuroutOption
           Width = 105
           Height = 20
           TabOrder = 0
+          OnExit = MoveHistoryMaxEditExit
+        end
+      end
+      object AHandredGroupBox: TGroupBox
+        Left = 16
+        Top = 192
+        Width = 465
+        Height = 65
+        Caption = '100'#12524#12473#34920#31034#35373#23450
+        TabOrder = 2
+        object AHandredLabeledEdit: TLabeledEdit
+          Left = 96
+          Top = 24
+          Width = 73
+          Height = 20
+          EditLabel.Width = 81
+          EditLabel.Height = 12
+          EditLabel.Caption = #20808#38957#34920#31034#12524#12473#25968
+          LabelPosition = lpLeft
+          LabelSpacing = 3
+          TabOrder = 0
+          Text = '1'
+          OnExit = AHandredLabeledEditExit
+        end
+        object UpDown1: TUpDown
+          Left = 169
+          Top = 24
+          Width = 15
+          Height = 20
+          Associate = AHandredLabeledEdit
+          Min = 1
+          Position = 1
+          TabOrder = 1
+          Wrap = False
         end
       end
     end
index 156cf66..93bbaf4 100644 (file)
@@ -4,7 +4,7 @@ interface
 
 uses
   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
-  Dialogs, StdCtrls, ComCtrls, GikoSystem, GikoUtil;
+  Dialogs, StdCtrls, ComCtrls, GikoSystem, GikoUtil, ExtCtrls;
 
 type
   TKuroutOption = class(TForm)
@@ -65,6 +65,9 @@ type
     Label10: TLabel;
     MoveHistoryMaxEdit: TEdit;
     Label11: TLabel;
+    AHandredGroupBox: TGroupBox;
+    AHandredLabeledEdit: TLabeledEdit;
+    UpDown1: TUpDown;
        procedure OkBottonClick(Sender: TObject);
        procedure FormCreate(Sender: TObject);
        procedure CDeleteButtonClick(Sender: TObject);
@@ -75,6 +78,8 @@ type
     procedure CDownButtonClick(Sender: TObject);
     procedure BUpButtonClick(Sender: TObject);
     procedure BDownButtonClick(Sender: TObject);
+    procedure MoveHistoryMaxEditExit(Sender: TObject);
+    procedure AHandredLabeledEditExit(Sender: TObject);
   private
        { Private \90é\8c¾ }
        procedure SetValue;
@@ -129,6 +134,8 @@ begin
     FixedCookieEdit.Text := GikoSys.Setting.FixedCookie;
     // \83\8a\83\93\83N\88Ú\93®\97\9a\97ð
     MoveHistoryMaxEdit.Text := IntToStr( GikoSys.Setting.MoveHistorySize );
+    //\81@\90æ\93ª\95\\8e¦\83\8c\83X\90\94
+    AHandredLabeledEdit.Text := IntToStr( GikoSys.Setting.HeadResCount );
 end;
 
 procedure TKuroutOption.SaveSetting;
@@ -160,6 +167,10 @@ begin
     GikoSys.Setting.MoveHistorySize :=
         StrToIntDef( MoveHistoryMaxEdit.Text, 20 );
 
+    //\81@\90æ\93ª\95\\8e¦\83\8c\83X\90\94
+    GikoSys.Setting.HeadResCount :=
+        StrToIntDef( AHandredLabeledEdit.Text , 1);
+
        GikoSys.Setting.KuroutSettingTabIndex := PageControl1.ActivePageIndex;
 end;
 
@@ -189,7 +200,9 @@ procedure TKuroutOption.OkBottonClick(Sender: TObject);
 begin
        RecvBufferSizeExit(Sender);
        PostTimeEditExit(Sender);
-        PostColumnData();
+    MoveHistoryMaxEditExit(Sender);
+    AHandredLabeledEditExit(Sender);
+    PostColumnData();
        SaveSetting;
 end;
 
@@ -385,5 +398,22 @@ begin
        //\83X\83\8c\88ê\97\97\82Ì\95`\89æ\82Ì\8dX\90V
        GikoForm.SetActiveList(GikoForm.ActiveList);
 end;
+// \83\8a\83\93\83N\88Ú\93®\97\9a\97ð\82Ì\95Ò\8fW\8cã\82Ì\90Ý\92è\95\8e\9a\97ñ\83`\83F\83b\83N
+procedure TKuroutOption.MoveHistoryMaxEditExit(Sender: TObject);
+begin
+       if not GikoSys.IsNumeric(MoveHistoryMaxEdit.Text) then
+               MoveHistoryMaxEdit.Text := '20';
+    if StrToInt(MoveHistoryMaxEdit.Text) < 1 then
+        MoveHistoryMaxEdit.Text := '1';
+end;
+// \90æ\93ª\95\\8e¦\83\8c\83X\90\94\82Ì\95Ò\8fW\8cã\82Ì\90Ý\92è\95\8e\9a\97ñ\83`\83F\83b\83N
+procedure TKuroutOption.AHandredLabeledEditExit(Sender: TObject);
+begin
+       if not GikoSys.IsNumeric(AHandredLabeledEdit.Text) then
+               AHandredLabeledEdit.Text := '1';
+    if StrToInt(AHandredLabeledEdit.Text) < 1 then
+        AHandredLabeledEdit.Text := '1';
+
+end;
 
 end.
index 337ccae..808d2fd 100644 (file)
@@ -61,9 +61,9 @@ object OptionDialog: TOptionDialog
     Top = 4
     Width = 509
     Height = 389
-    ActivePage = TabSheet4
+    ActivePage = CSSTabSheet
     MultiLine = True
-    TabIndex = 7
+    TabIndex = 2
     TabOrder = 3
     OnChange = OptionTabChange
     object ConnectSheet: TTabSheet
@@ -253,7 +253,7 @@ object OptionDialog: TOptionDialog
           Top = 43
           Width = 417
           Height = 20
-          ItemHeight = 12
+          ItemHeight = 0
           TabOrder = 0
           Text = 'BoardURLComboBox'
         end
index f766753..4465ab3 100644 (file)
@@ -438,6 +438,8 @@ type
         FStoredTaskTray : Boolean;
         //! \83^\83u\82Ì\88Ú\93®\82Å\83\8b\81[\83v\82ð\8b\96\89Â\82·\82é
         FLoopBrowserTabs : Boolean;
+        //! 100\83\8c\83X\95\\8e¦\82Ì\90æ\93ª\95\\8e¦\83\8c\83X\90\94
+        FHeadResCount : Integer;
                function GetMainCoolSet(Index: Integer): TCoolSet;
                function GetBoardCoolSet(Index: Integer): TCoolSet;
                function GetBrowserCoolSet(Index: Integer): TCoolSet;
@@ -784,6 +786,8 @@ type
         property StoredTaskTray : Boolean read FStoredTaskTray write FStoredTaskTray;
         //! \83u\83\89\83E\83U\83^\83u\82Ì\83\8b\81[\83v\82ð\8b\96\89Â\82·\82é
         property LoopBrowserTabs : Boolean read FLoopBrowserTabs write FLoopBrowserTabs;
+        //! 100\83\8c\83X\95\\8e¦\82Ì\90æ\93ª\95\\8e¦\83\8c\83X\90\94
+        property HeadResCount : Integer read FHeadResCount write FHeadResCount;
 end;
 
 
@@ -1082,6 +1086,7 @@ begin
                else
                        FResRange := ini.ReadInteger( 'Thread', 'ResRange', Ord( grrAll ) );
                FResRangeHold := ini.ReadBool( 'Thread', 'ResRangeHold', False );
+        FHeadResCount := ini.ReadInteger('Thread', 'HeadResCount', 1);
                // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
                FThreadRange := TGikoThreadRange( ini.ReadInteger('ThreadList', 'ThreadRange', Ord( gtrAll )) );
                //\94ñ\83A\83N\83e\83B\83u\8e\9e\83\8c\83X\83|\83b\83v\83A\83b\83v\95\\8e¦
@@ -1255,7 +1260,7 @@ begin
 
         FStoredTaskTray := ini.ReadBool('Function', 'StroedTaskTray', false);
         FLoopBrowserTabs := ini.ReadBool('Function', 'LoopBrowserTabs', false);
-        
+
                ini.UpdateFile;
        finally
                ini.Free;
@@ -1444,6 +1449,7 @@ begin
                ini.DeleteKey( 'Thread', 'OnlyAHundredRes' );   // \8cÃ\82¢\90Ý\92è\82Ì\8dí\8f\9c
                ini.WriteInteger('Thread', 'ResRange', FResRange);
                ini.WriteBool('Thread', 'ResRangeHold', FResRangeHold);
+        ini.WriteInteger('Thread', 'HeadResCount', FHeadResCount);
                // \83X\83\8c\83b\83h\88ê\97\97\95\\8e¦\94Í\88Í
                ini.WriteInteger('ThreadList', 'ThreadRange', Ord( FThreadRange ));
                //\83\8d\83O\8dí\8f\9c\8am\94F