OSDN Git Service

タブの追加位置に、現在タブの右/左を追加
[gikonavigoeson/gikonavi.git] / Option.pas
index 6358db5..54f5fad 100644 (file)
@@ -13,7 +13,7 @@ uses
        SHDocVw_TLB,
        MSHTML_TLB,
 {$IFEND}
-       BoardGroup;
+       BoardGroup, BrowserRecord;
 
 type
        TOptionDialog = class(TForm)
@@ -44,13 +44,13 @@ type
                 WriteProxyCheck: TCheckBox;
                 WriteProxyAddressEdit: TEdit;
                 WritePortEdit: TEdit;
-                WriteProxyUserIDEdit: TEdit;
-                WriteProxyPasswordEdit: TEdit;
+                               WriteProxyUserIDEdit: TEdit;
+                               WriteProxyPasswordEdit: TEdit;
                 Font1Sheet: TTabSheet;
                 Bevel1: TBevel;
                 Bevel2: TBevel;
                 Label19: TLabel;
-                Bevel5: TBevel;
+                               Bevel5: TBevel;
                 Label20: TLabel;
                 Label21: TLabel;
                 Label22: TLabel;
@@ -193,8 +193,24 @@ type
                 Label7: TLabel;
                 BeUserIDEdit: TEdit;
                 Label8: TLabel;
-                BePasswordEdit: TEdit;
+    BeCodeEdit: TEdit;
                 BeAutoLoginCheckBox: TCheckBox;
+    GroupBox19: TGroupBox;
+    Label17: TLabel;
+    MaxRecordCountEdit: TEdit;
+    Label18: TLabel;
+    UnFocusedBoldCheckBox: TCheckBox;
+    IgnoreKanaCheckBox: TCheckBox;
+    UseKatjuTypeSkinCheckBox: TCheckBox;
+    GroupBox20: TGroupBox;
+    AutoSortCheckBox: TCheckBox;
+    Label24: TLabel;
+    GroupBox21: TGroupBox;
+    StoredTaskTrayCB: TCheckBox;
+    GroupBox22: TGroupBox;
+    LoopBrowserTabsCB: TCheckBox;
+    GroupBox23: TGroupBox;
+    IgnoreContextCheckBox: TCheckBox;
                procedure FormCreate(Sender: TObject);
                procedure FormDestroy(Sender: TObject);
                procedure ApplyButtonClick(Sender: TObject);
@@ -243,6 +259,7 @@ type
                 procedure OddResNumCheckBoxClick(Sender: TObject);
                 procedure ResRangeHoldCheckBoxClick(Sender: TObject);
                 procedure CroutOptionClick(Sender: TObject);
+    procedure MaxRecordCountEditExit(Sender: TObject);
        private
                { Private \90é\8c¾ }
                FClose: Boolean;
@@ -260,6 +277,10 @@ type
                procedure SetAbonpropertys;
                procedure CSSSetContent(Content: string);
                procedure CSSPreview;
+               //! CSS\83v\83\8c\83r\83\85\81[\97pHTMLBody\90\90¬
+               function CreatePreviewBody(Res: array of TResRec): string;
+               //! CSS/SKIN\83v\83\8c\83r\83\85\81[\97pStyle\95\8e\9a\97ñ\8eæ\93¾
+               function GetPreviewUserStyle(): string;
        public
                { Public \90é\8c¾ }
        end;
@@ -270,7 +291,7 @@ var
 implementation
 
 uses
-       Giko, Editor, Setting, ActnList, KuroutSetting;
+       Giko, Editor, Setting, ActnList, KuroutSetting, Math, HTMLCreate;
 
 const
        FONT_TEXT: string = '%s %d pt';
@@ -284,6 +305,7 @@ const
        DEFAULT_TABFONT_NAME: string = '\82l\82\82o\83S\83V\83b\83N';
        DEFAULT_TABFONT_SIZE: Integer = 9;
        URL_TORA3: WideString = 'http://2ch.tora3.net/';
+       DEFAULT_CSS_FILENAME = 'default.css';
 
 {$R *.DFM}
 
@@ -338,13 +360,14 @@ begin
        ReadPortEditExit(Sender);
        WritePortEditExit(Sender);
        AddressHistoryCountEditExit(Sender);
+    MaxRecordCountEditExit(Sender);
        PreviewWaitEditExit(Sender);
 
        if not CheckFolder then begin
                FClose := False;
                Exit;
        end;
-        SetAbonpropertys;
+               SetAbonpropertys;
        SaveSetting;
        SettingApply;
 
@@ -355,6 +378,7 @@ begin
        ReadPortEditExit(Sender);
        WritePortEditExit(Sender);
        AddressHistoryCountEditExit(Sender);
+       MaxRecordCountEditExit(Sender);
        PreviewWaitEditExit(Sender);
 
        if not CheckFolder then begin
@@ -583,6 +607,8 @@ begin
        OddResNumCheckBox.Checked := GikoSys.Setting.UseOddColorOddResNum;
        OddResNumColorBox.Selected := GikoSys.Setting.OddColor;
        OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
+       UnFocusedBoldCheckBox.Checked := GikoSys.Setting.UnFocusedBold;
+       UnFocusedBoldCheckBox.Enabled := OddResNumCheckBox.Checked;
 
        //\83u\83\89\83E\83U\83|\83b\83v\83A\83b\83v\83t\83H\83\93\83g
        HintMemo.Font.Name := GikoSys.Setting.HintFontName;
@@ -604,6 +630,8 @@ begin
        EditorMemo.Color := GikoSys.Setting.EditorBackColor;
        //CSS\95\\8e¦
        CSSCheckBox.Checked := GikoSys.Setting.UseCSS;
+       //\82©\82¿\82ã\83X\83L\83\93\8eg\97p
+       UseKatjuTypeSkinCheckBox.Checked := GikoSys.Setting.UseKatjushaType;
        if FCSSFont <> nil then
                FCSSFont.Free;
        FCSSFont := TFont.Create;
@@ -635,15 +663,16 @@ begin
        //\83X\83^\83C\83\8b\83V\81[\83g\83t\83@\83C\83\8b\96¼\88ê\97\97
        FileList := TStringList.Create;
        try
+        FileList.BeginUpdate;
                GikoSys.GetFileList(GikoSys.GetStyleSheetDir, '*.css', FileList, True, True);
-
+        FileList.EndUpdate;
                Idx := Length(GikoSys.GetStyleSheetDir);
                for i := 0 to FileList.Count - 1 do
                        FileList[i] := Copy(FileList[i], Idx + 1, Length(FileList[i]));
                FileList.Sort;
                for i := 0 to FileList.Count - 1 do begin
                        //s := ExtractFileName(FileList[i]);
-                       if LowerCase(FileList[i]) = 'default.css' then
+                       if LowerCase(FileList[i]) = DEFAULT_CSS_FILENAME then
                                Item := CSSListView.Items.Insert(0)
                        else
                                Item := CSSListView.Items.Add;
@@ -660,29 +689,18 @@ begin
                FCSSStrings.Clear;
        FCSSStrings := TStringList.Create;
        try
-               //GikoSys.GetDirectoryList(GikoSys.GetSkinDir, '*', FileList, False);
                GikoSys.GetDirectoryList(GikoSys.GetSkinDir, '*', FCSSStrings, False);
 
                Idx := Length(GikoSys.GetSkinDir);
-               //FileList.Sort;
                FCSSStrings.Sort;
-               //for i := 0 to FileList.Count - 1 do begin
                for i := 0 to FCSSStrings.Count - 1 do begin
-                       //s := ExtractFileName(FileList[i]);
                        Item := CSSListView.Items.Add;
-                       {Item.Data := PChar( FileList[i] );
-                       Item.Caption := Copy( FileList[i], Idx + 1, Length(FileList[i]) );
-                       if LowerCase(FileList[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
-                               Item.Selected := True;
-                       }
                        Item.Data := PChar( FCSSStrings[i] );
                        Item.Caption := Copy( FCSSStrings[i], Idx + 1, Length(FCSSStrings[i]) );
                        if LowerCase(FCSSStrings[i]) = LowerCase(GikoSys.Setting.CSSFileName) then
                                Item.Selected := True;
                end;
        finally
-               // Item.Data \82É\83|\83C\83\93\83^\93Ë\82Á\8d\9e\82ñ\82Å\82é\82©\82ç\8aJ\95ú\82Å\82«\82È\82¢\82æ\82§\81`
-               //FileList.Free;
        end;
 
        if (CSSListView.ItemIndex = -1) and (CSSListView.Items.Count > 0) then
@@ -817,14 +835,16 @@ begin
        else
                DatOchiSortCombo.ItemIndex := 0;
        end;
-
-        //\82 \82Ú\81`\82ñ
-        RloCheckBox.Checked := GikoSys.Setting.AbonDeleterlo;
-        ReplaceulCheckBox.Checked := GikoSys.Setting.AbonReplaceul;
-                               PopUpAbonCheckBox.Checked := GikoSys.Setting.PopUpAbon;
-                               ShowNGLineCheckBox.Checked := GikoSys.Setting.ShowNGLinesNum;
-                               AddResAnchorCheckBox.Checked := GikoSys.Setting.AddResAnchor;
+       AutoSortCheckBox.Checked := GikoSys.Setting.AutoSortThreadList;
+       
+       //\82 \82Ú\81`\82ñ
+       RloCheckBox.Checked := GikoSys.Setting.AbonDeleterlo;
+       ReplaceulCheckBox.Checked := GikoSys.Setting.AbonReplaceul;
+       PopUpAbonCheckBox.Checked := GikoSys.Setting.PopUpAbon;
+       ShowNGLineCheckBox.Checked := GikoSys.Setting.ShowNGLinesNum;
+       AddResAnchorCheckBox.Checked := GikoSys.Setting.AddResAnchor;
        DeleteSyriaCheckBox.Checked := GikoSys.Setting.DeleteSyria;
+       IgnoreKanaCheckBox.Checked := GikoSys.Setting.IgnoreKana;
 {$IFDEF SPAM_FILTER_ENABLED}
        // \83X\83p\83\80\83t\83B\83\8b\83^\82Ì\90Ý\92è\82ð\95\\8e¦\82·\82é
        SpamFilterGroupBox.Visible := True;
@@ -846,8 +866,16 @@ begin
 
        //Be2ch\94F\8fØ
        BeUserIDEdit.Text := GikoSys.Setting.BeUserID;
-       BePasswordEdit.Text := GikoSys.Setting.BePassword;
+       BeCodeEdit.Text := GikoSys.Setting.BeCode;
        BeAutoLoginCheckBox.Checked := GikoSys.Setting.BeAutoLogin;
+       //\97\9a\97ð\82Ì\8dÅ\91å\95Û\91\90\94
+       MaxRecordCountEdit.Text := IntToStr(GikoSys.Setting.MaxRecordCount);
+    // \8dÅ\8f¬\89»\8e\9e\82É\83^\83X\83N\83g\83\8c\83C\82É\8ai\94[\82·\82é\82©
+    StoredTaskTrayCB.Checked := GikoSys.Setting.StoredTaskTray;
+    // \83u\83\89\83E\83U\83^\83u\82Ì\88Ú\93®\82Å\83\8b\81[\83v\82ð\8b\96\89Â\82·\82é\82©
+    LoopBrowserTabsCB.Checked := GikoSys.Setting.LoopBrowserTabs;
+    //
+    IgnoreContextCheckBox.Checked := GikoSys.Setting.GestureIgnoreContext;
 end;
 
 procedure TOptionDialog.SaveSetting;
@@ -885,6 +913,8 @@ begin
        GikoSys.Setting.ListBackColor := ListMemo.Color;
        GikoSys.Setting.UseOddColorOddResNum := OddResNumCheckBox.Checked;
        GikoSys.Setting.OddColor := OddResNumColorBox.Selected;
+       GikoSys.Setting.UnFocusedBold := (UnFocusedBoldCheckBox.Enabled) and
+                                                                               (UnFocusedBoldCheckBox.Checked);
 
        GikoSys.Setting.HintFontName := HintMemo.Font.Name;
        GikoSys.Setting.HintFontSize := HintMemo.Font.Size;
@@ -906,9 +936,10 @@ begin
        //CSS\95\\8e¦
        if GikoSys.Setting.UseCSS <> CSSCheckBox.Checked then FRepaintThread := true;
        GikoSys.Setting.UseCSS := CSSCheckBox.Checked;
+       GikoSys.Setting.UseKatjushaType := UseKatjuTypeSkinCheckBox.Checked;
        //CSS\83t\83@\83C\83\8b\96¼
        tmp := GikoSys.Setting.CSSFileName;
-       GikoSys.Setting.CSSFileName := 'default.css';
+       GikoSys.Setting.CSSFileName := DEFAULT_CSS_FILENAME;
        if CSSListView.Items.Count > 0 then begin
                try
                        if CSSListView.Items[CSSListView.ItemIndex].Data <> nil then
@@ -1088,6 +1119,7 @@ begin
                        GikoSys.Setting.DatOchiSortIndex := Ord( gbcLastModified );{gbcLastModified}
                        end;
        end;
+       GikoSys.Setting.AutoSortThreadList := AutoSortCheckBox.Checked;
 
        GikoSys.Setting.WriteSystemSettingFile;
        GikoSys.Setting.WriteBoardURLSettingFile;
@@ -1111,7 +1143,9 @@ begin
        GikoSys.Setting.PopUpAbon := PopUpAbonCheckBox.Checked;
        GikoSys.Setting.ShowNGLinesNum := ShowNGLineCheckBox.Checked;
        GikoSys.Setting.AddResAnchor := AddResAnchorCheckBox.Checked;
-                               GikoSys.Setting.DeleteSyria := DeleteSyriaCheckBox.Checked;
+       GikoSys.Setting.DeleteSyria := DeleteSyriaCheckBox.Checked;
+       GikoSys.Setting.IgnoreKana := IgnoreKanaCheckBox.Checked;
+       GikoSys.FAbon.IgnoreKana := GikoSys.Setting.IgnoreKana;
        // \8eg\97p\82·\82é\83X\83p\83\80\83t\83B\83\8b\83^
        if GikoSys.Setting.SpamFilterAlgorithm <> TGikoSpamFilterAlgorithm(
                SpamFilterAlgorithmComboBox.ItemIndex ) then begin
@@ -1125,8 +1159,14 @@ begin
        GikoSys.Setting.UseUndecided := UseUndecidedCheckBox.Checked;
         //Be2ch
         GikoSys.Setting.BeUserID := BeUserIDEdit.Text;
-        GikoSys.Setting.BePassword := BePasswordEdit.Text;
-        GikoSys.Setting.BeAutoLogin := BeAutoLoginCheckBox.Checked;
+        GikoSys.Setting.BeCode := BeCodeEdit.Text;
+               GikoSys.Setting.BeAutoLogin := BeAutoLoginCheckBox.Checked;
+       //\97\9a\97ð\82Ì\8dÅ\91å\95Û\91\90\94
+       GikoSys.Setting.MaxRecordCount := Max(StrToInt64Def(MaxRecordCountEdit.Text,100),1);
+    GikoSys.Setting.StoredTaskTray := StoredTaskTrayCB.Checked;
+    GikoSys.Setting.LoopBrowserTabs := LoopBrowserTabsCB.Checked;
+
+    GikoSys.Setting.GestureIgnoreContext := IgnoreContextCheckBox.Checked;
 end;
 
 procedure TOptionDialog.SettingApply;
@@ -1142,16 +1182,6 @@ begin
                GikoForm.TreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
                GikoForm.TreeView.Color := GikoSys.Setting.CabinetBackColor;
 
-               {GikoForm.TreeView.Font.Style := [];
-               if GikoSys.Setting.CabinetFontBold then
-                       GikoForm.TreeView.Font.Style := [fsBold];
-               if GikoSys.Setting.CabinetFontItalic then
-                       GikoForm.TreeView.Font.Style := GikoForm.TreeView.Font.Style + [fsItalic];
-               }
-               {GikoForm.FavoriteTreeView.Font.Name := GikoSys.Setting.CabinetFontName;
-               GikoForm.FavoriteTreeView.Font.Size := GikoSys.Setting.CabinetFontSize;
-               GikoForm.FavoriteTreeView.Font.Color := GikoSys.Setting.CabinetFontColor;
-               }
                GikoForm.FavoriteTreeView.Font.Assign(GikoForm.TreeView.Font);
                GikoForm.FavoriteTreeView.Color := GikoSys.Setting.CabinetBackColor;
 
@@ -1166,8 +1196,10 @@ begin
 
                //GikoForm.ListView.Color := GikoSys.Setting.ListBackColor;
                GikoForm.ListViewBackGroundColor := GikoSys.Setting.ListBackColor;
-                GikoForm.UseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
-                GikoForm.OddColor := GikoSys.Setting.OddColor;
+               GikoForm.UseOddResOddColor := GikoSys.Setting.UseOddColorOddResNum;
+               GikoForm.OddColor := GikoSys.Setting.OddColor;
+               GikoSys.Setting.UnFocusedBold := (UnFocusedBoldCheckBox.Enabled) and
+                                                                                       (UnFocusedBoldCheckBox.Checked);
 
                GikoForm.BrowserTab.Font.Name := GikoSys.Setting.BrowserTabFontName;
                GikoForm.BrowserTab.Font.Size := GikoSys.Setting.BrowserTabFontSize;
@@ -1405,7 +1437,7 @@ begin
         GikoSys.FAbon.AbonPopupRes := PopUpAbonCheckBox.Checked;
        GikoSys.FAbon.ReturnNGwordLineNum := ShowNGLineCheckBox.Checked;
        GikoSys.FAbon.SetNGResAnchor := AddResAnchorCheckBox.Checked;
-        GikoSys.FAbon.DeleteSyria := DeleteSyriaCheckBox.Checked;
+               GikoSys.FAbon.DeleteSyria := DeleteSyriaCheckBox.Checked;
 end;
 procedure TOptionDialog.CSSFontButtonClick(Sender: TObject);
 begin
@@ -1470,14 +1502,12 @@ var
        ThreadItem: TThreadItem;
        html: string;
        Res: array [0..1] of TResRec;
-       UserOptionalStyle: string;
-       i: Integer;
        fileName: string;
 begin
 
        fileName := GikoSys.Setting.CSSFileName;
 
-       GikoSys.Setting.CSSFileName := 'default.css';
+       GikoSys.Setting.CSSFileName := DEFAULT_CSS_FILENAME;
        if CSSListView.Items.Count > 0 then begin
                try
                        if CSSListView.ItemIndex >= 0 then begin
@@ -1485,13 +1515,13 @@ begin
                                        GikoSys.Setting.CSSFileName := string( CSSListView.Items[CSSListView.ItemIndex].data )
                                else
                                        GikoSys.Setting.CSSFileName := CSSListView.Items[CSSListView.ItemIndex].Caption + '.css';
-                        end;
+                                               end;
                except
                end;
        end;
 
        Board := TBoard.Create( nil, 'about://sample/' );
-       ThreadItem := TThreadItem.Create( nil, 'about://sample/test/read.cgi/sample/' );
+       ThreadItem := TThreadItem.Create( nil, Board, 'about://sample/test/read.cgi/sample/' );
 
        try
                Board.Title := '\83T\83\93\83v\83\8b\94Â';
@@ -1510,66 +1540,27 @@ begin
                Res[1].FDateTime := 'ID:Sample';
                Res[1].FBody := '\83I\83}\83G\83\82\83i\81[';
 
-               // \83t\83H\83\93\83g\82â\83T\83C\83Y\82Ì\90Ý\92è
-               if CSSFontCheckBox.Checked then begin
-                       i := ColorToRGB( FCSSFont.Color );
-                       i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
-
-                       UserOptionalStyle := UserOptionalStyle +
-                               'font-family:"' + FCSSFont.Name + '";' +
-                               'font-size:' + IntToStr( FCSSFont.Size ) + 'pt;' +
-                               'color:#' + IntToHex( i, 6 ) + ';';
-                       if fsBold in FCSSFont.Style then
-                               UserOptionalStyle := UserOptionalStyle + 'font-weight:bold;'
-                       else
-                               UserOptionalStyle := UserOptionalStyle + 'font-weight:normal;';
-                       if fsItalic in FCSSFont.Style then
-                               UserOptionalStyle := UserOptionalStyle + 'font-style:italic;'
-                       else
-                               UserOptionalStyle := UserOptionalStyle + 'font-style:normal;';
-               end;
-               if CSSBackColorCheckBox.Checked then begin
-                       i := ColorToRGB( FCSSBackColor );
-                       i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
-
-                       UserOptionalStyle := UserOptionalStyle +
-                               'background-color:#' + IntToHex( i, 6 ) + ';';
-               end;
 
                if FileExists( GikoSys.GetSkinHeaderFileName ) then begin
                        html :=
-                               GikoSys.LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, 0 ) +
+                               HTMLCreater.LoadFromSkin( GikoSys.GetSkinHeaderFileName, ThreadItem, 0 ) +
                                '<a name="top"></a>' +
-                               GikoSys.SkinedRes( GikoSYs.LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, 0 ), Res[0], '1' ) +
-                               GikoSys.SkinedRes( GikoSYs.LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, 0 ), Res[1], '2' ) +
+                               HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinResFileName, ThreadItem, 0 ), @Res[0], '1' ) +
+                               HTMLCreater.SkinedRes( HTMLCreater.LoadFromSkin( GikoSys.GetSkinNewResFileName, ThreadItem, 0 ), @Res[1], '2' ) +
                                '<a name="bottom"></a>' +
-                               GikoSys.LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, 0 );
+                               HTMLCreater.LoadFromSkin( GikoSys.GetSkinFooterFileName, ThreadItem, 0 );
 
                        html := StringReplace( html, '</head>',
-                               '<style type="text/css">body {' + UserOptionalStyle + '}</style></head>', [rfReplaceAll] );
+                               '<style type="text/css">body {' + GetPreviewUserStyle + '}</style></head>', [rfReplaceAll] );
                end else begin
                        html :=
-                               '<html><head>' +
-                               '<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' +
+                               '<html><head><meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">' +
                                '<title>' + ThreadItem.Title + '</title>' +
                                '<link rel="stylesheet" href="' + GikoSys.GetStyleSheetDir + GikoSys.Setting.CSSFileName + '" type="text/css">' +
-                               '<style type="text/css">body {' + UserOptionalStyle + '}</style>' +
-                               '</head><body>' +
-                               '<div class="title">' + ThreadItem.Title + '</div>';
-
-                               for i := 0 to High( Res ) do
-                               begin
-                                       html := html +
-                                               '<div class="header"><span class="no">' + IntToStr( i + 1 ) + '</span>' +
-                                               '<span class="name_label"> \96¼\91O\81F </span>' +
-                                               '<a class="name_mail" href="mailto:' + Res[i].FMailTo + '">' +
-                                               '<b>' + Res[i].FName + '</b></a><span class="mail"> [' + Res[i].FMailTo + ']</span>' +
-                                               '<span class="date_label"> \93\8a\8de\93ú\81F</span>' +
-                                               '<span class="date"> ' + Res[i].FDateTime+ '</span></div>' +
-                                               '<div class="mes">' + Res[i].FBody + ' </div>';
-                               end;
-
-                               html := html + '</body></html>';
+                               '<style type="text/css">body {' + GetPreviewUserStyle + '}</style>' +
+                               '</head><body><div class="title">' + ThreadItem.Title + '</div>';
+
+                       html := html + CreatePreviewBody(Res) + '</body></html>';
                end;
 
                try
@@ -1584,7 +1575,57 @@ begin
        end;
 
 end;
+function TOptionDialog.CreatePreviewBody(Res: array of TResRec): string;
+var
+       i : Integer;
+begin
+       Result := '';
+       for i := 0 to High( Res ) do
+       begin
+               Result := Result +
+                       '<div class="header"><span class="no">' + IntToStr( i + 1 ) + '</span>' +
+                       '<span class="name_label"> \96¼\91O\81F </span>' +
+                       '<a class="name_mail" href="mailto:' + Res[i].FMailTo + '">' +
+                       '<b>' + Res[i].FName + '</b></a><span class="mail"> [' + Res[i].FMailTo + ']</span>' +
+                       '<span class="date_label"> \93\8a\8de\93ú\81F</span>' +
+                       '<span class="date"> ' + Res[i].FDateTime+ '</span></div>' +
+                       '<div class="mes">' + Res[i].FBody + ' </div>';
+       end;
+end;
 
+function TOptionDialog.GetPreviewUserStyle(): string;
+var
+       i : Integer;
+
+begin
+       Result := '';
+       // \83t\83H\83\93\83g\82â\83T\83C\83Y\82Ì\90Ý\92è
+       if CSSFontCheckBox.Checked then begin
+               i := ColorToRGB( FCSSFont.Color );
+               i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
+
+               Result := Result +
+                       'font-family:"' + FCSSFont.Name + '";' +
+                       'font-size:' + IntToStr( FCSSFont.Size ) + 'pt;' +
+                       'color:#' + IntToHex( i, 6 ) + ';';
+               if fsBold in FCSSFont.Style then
+                       Result := Result + 'font-weight:bold;'
+               else
+                       Result := Result + 'font-weight:normal;';
+               if fsItalic in FCSSFont.Style then
+                       Result := Result + 'font-style:italic;'
+               else
+                       Result := Result + 'font-style:normal;';
+       end;
+       if CSSBackColorCheckBox.Checked then begin
+               i := ColorToRGB( FCSSBackColor );
+               i := (i shr 16) or (i and $ff00) or ((i and $ff) shl 16);
+
+               Result := Result +
+                       'background-color:#' + IntToHex( i, 6 ) + ';';
+       end;
+
+end;
 procedure TOptionDialog.CSSListViewChange(Sender: TObject; Item: TListItem;
        Change: TItemChange);
 begin
@@ -1608,6 +1649,7 @@ end;
 procedure TOptionDialog.OddResNumCheckBoxClick(Sender: TObject);
 begin
        OddResNumColorBox.Enabled := OddResNumCheckBox.Checked;
+       UnFocusedBoldCheckBox.Enabled := OddResNumCheckBox.Checked;
 end;
 
 procedure TOptionDialog.ResRangeHoldCheckBoxClick(Sender: TObject);
@@ -1627,5 +1669,13 @@ begin
        end;
 end;
 
+procedure TOptionDialog.MaxRecordCountEditExit(Sender: TObject);
+begin
+       if not GikoSys.IsNumeric(MaxRecordCountEdit.Text) then
+               MaxRecordCountEdit.Text := '100'
+       else if StrToIntDef(MaxRecordCountEdit.Text, 100) <= 0 then
+        MaxRecordCountEdit.Text := '1';
+end;
+
 end.