OSDN Git Service

・ブラウザ(スレ表示)に関するスタイル設定の実装。現状 UI は無し。
authoryoffy <yoffy>
Thu, 25 Sep 2003 21:10:07 +0000 (21:10 +0000)
committeryoffy <yoffy>
Thu, 25 Sep 2003 21:10:07 +0000 (21:10 +0000)
GikoSystem.pas
Option.dfm
Setting.pas
gikoNavi.res

index bdd7daa..4a8fe53 100644 (file)
@@ -815,12 +815,15 @@ var
        FileName: string;
        NewReceiveNo: Integer;
        Res: TResRec;
+
+  UserOptionalStyle: string;
        SkinHeaderFileName: string;
        SkinNewResFileName: string;
        SkinResFileName: string;
        SkinFooterFileName: string;
        SkinBookmarkFileName: string;
   SkinNewmarkFileName: string;
+  SkinHeader: string;
        SkinNewRes: string;
        SkinRes: string;
        SizeByte: Integer;
@@ -932,6 +935,28 @@ begin
                        doc.open;
                        doc.charset := 'Shift_JIS';
 
+      // \83t\83H\83\93\83g\82â\83T\83C\83Y\82Ì\90Ý\92è
+      if Length( GikoSys.Setting.BrowserFontName ) > 0 then
+        UserOptionalStyle := UserOptionalStyle +
+          'font-family:' + GikoSys.Setting.BrowserFontName + ';';
+      if GikoSys.Setting.BrowserFontSize <> 0 then
+        UserOptionalStyle := UserOptionalStyle +
+          'font-size:' + IntToStr( GikoSys.Setting.BrowserFontSize ) + 'pt;';
+      if GikoSys.Setting.BrowserFontColor <> -1 then
+        UserOptionalStyle := UserOptionalStyle +
+          'color:#' + IntToHex( GikoSys.Setting.BrowserFontColor, 4 ) + ';';
+      if GikoSys.Setting.BrowserBackColor <> -1 then
+        UserOptionalStyle := UserOptionalStyle +
+          'background-color:#' + IntToHex( GikoSys.Setting.BrowserBackColor, 4 ) + ';';
+                       case GikoSys.Setting.BrowserFontBold of
+      -1: UserOptionalStyle := UserOptionalStyle + 'font-weight:normal;';
+      1: UserOptionalStyle := UserOptionalStyle + 'font-weight:bold;';
+      end;
+                       case GikoSys.Setting.BrowserFontItalic of
+      -1: UserOptionalStyle := UserOptionalStyle + 'font-style:normal;';
+      1: UserOptionalStyle := UserOptionalStyle + 'font-style:italic;';
+      end;
+
                        CSSFileName := GetStyleSheetDir + Setting.CSSFileName;
                        SkinHeaderFileName := Setting.CSSFileName + SKIN_HEADER_FILE_NAME;
                        SkinNewResFileName := Setting.CSSFileName + SKIN_NEWRES_FILE_NAME;
@@ -946,8 +971,18 @@ begin
 
                                // \83X\83L\83\93\82Ì\90Ý\92è
         try
-          SaveList.Add( LoadSkin( SkinHeaderFileName ) );
+               SkinHeader := LoadSkin( SkinHeaderFileName );
+          if Length( UserOptionalStyle ) > 0 then
+            SkinHeader := StringReplace( SkinHeader, '</head>',
+              '<style type="text/css">body {' + UserOptionalStyle + '}</style></head>', [rfReplaceAll] );
+          SaveList.Add( SkinHeader );
+        except
+        end;
+        try
           SkinNewRes := LoadSkin( SkinNewResFileName );
+        except
+        end;
+        try
           SkinRes := LoadSkin( SkinResFileName );
         except
         end;
@@ -1039,6 +1074,8 @@ begin
                                SaveList.Add('<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">');
                                SaveList.Add('<title>' + sTitle + '</title>');
                                SaveList.Add('<link rel="stylesheet" href="'+CSSFileName+'" type="text/css">');
+        if Length( UserOptionalStyle ) > 0 then
+                                       SaveList.Add('<style type="text/css">body {' + UserOptionalStyle + '}</style>');
                                SaveList.Add('</head>');
                                SaveList.Add('<body>');
                                SaveList.Add('<a name="top"></a>');
index 775ef32..a359a4b 100644 (file)
@@ -44,9 +44,9 @@ object OptionDialog: TOptionDialog
     Top = 4
     Width = 509
     Height = 389
-    ActivePage = TabSheet4
+    ActivePage = Font1Sheet
     MultiLine = True
-    TabIndex = 2
+    TabIndex = 1
     TabOrder = 0
     OnChange = OptionTabChange
     object ConnectSheet: TTabSheet
@@ -536,7 +536,7 @@ object OptionDialog: TOptionDialog
         object CSSListLabel: TLabel
           Left = 12
           Top = 48
-          Width = 205
+          Width = 191
           Height = 12
           Caption = #12473#12479#12452#12523#12471#12540#12488#12414#12383#12399#12473#12461#12531#12398#36984#25246'(&S)'
         end
index cbbceb5..c96c8bd 100644 (file)
@@ -71,9 +71,12 @@ type
                FListBackColor: TColor;
 
                //\83u\83\89\83E\83U
-               //FBrowserFontColor: TColor;
-               //FBrowserBackColor: TColor;
-               //FBrowserFontSize: Integer;
+               FBrowserFontName: string;                       // ''...default
+               FBrowserFontSize: Integer;              // 0...default
+               FBrowserFontBold: Integer;              // 0...default, -1...False, 1...True
+               FBrowserFontItalic: Integer;    // \8fã\82É\93¯\82
+               FBrowserFontColor: Integer;     // -1...default
+               FBrowserBackColor: Integer;     // \8fã\82É\93¯\82
 
                //\83G\83f\83B\83^
                FEditorFontName: string;
@@ -97,6 +100,7 @@ type
                FHintFontColor: TColor;
                FHintBackColor: TColor;
 
+
                //\83E\83B\83\93\83h\83E\83T\83C\83Y
                FWindowTop: Integer;
                FWindowLeft: Integer;
@@ -226,10 +230,10 @@ type
                FTimeAdjustSec: Integer;
                FTimeAdjust: Boolean;
 
-        //\82 \82Ú\81`\82ñ
-        FAbonDeleterlo : Boolean; //&rlo;\82ð\8dí\82é\82©
-        FAbonReplaceul : Boolean; //<ul>\83^\83O\82ð<br>\83^\83O\82É\92u\8a·\82·\82é\82©
-        FPopUpAbon     : Boolean; //\83\8c\83X\83|\83b\83v\83A\83b\83v\8e\9e\82Ì\82 \82Ú\81`\82ñ\97L\8cø
+    //\82 \82Ú\81`\82ñ
+    FAbonDeleterlo : Boolean; //&rlo;\82ð\8dí\82é\82©
+    FAbonReplaceul : Boolean; //<ul>\83^\83O\82ð<br>\83^\83O\82É\92u\8a·\82·\82é\82©
+    FPopUpAbon     : Boolean; //\83\8c\83X\83|\83b\83v\83A\83b\83v\8e\9e\82Ì\82 \82Ú\81`\82ñ\97L\8cø
 
     // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
     FSelectComboBoxWidth : Integer;
@@ -301,9 +305,12 @@ type
                property ListFontColor: TColor read FListFontColor write FListFontColor;
                property ListBackColor: TColor read FListBackColor write FListBackColor;
 
-//             property BrowserFontColor: TColor read FBrowserFontColor write FBrowserFontColor;
-//             property BrowserBackColor: TColor read FBrowserBackColor write FBrowserBackColor;
-//             property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
+               property BrowserFontName: string read FBrowserFontName write FBrowserFontName;
+               property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
+               property BrowserFontBold: Integer read FBrowserFontBold write FBrowserFontBold;
+               property BrowserFontItalic: Integer read FBrowserFontItalic write FBrowserFontItalic;
+               property BrowserFontColor: Integer read FBrowserFontColor write FBrowserFontColor;
+               property BrowserBackColor: Integer read FBrowserBackColor write FBrowserBackColor;
 
                property EditorFontName: string read FEditorFontName write FEditorFontName;
                property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
@@ -426,10 +433,10 @@ type
                property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
                property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
 
-        //\82 \82Ú\81`\82ñ
-        property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
-        property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
-        property PopUpAbon     : Boolean read FPopUpAbon write FPopUpAbon;
+    //\82 \82Ú\81`\82ñ
+    property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
+    property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
+    property PopUpAbon     : Boolean read FPopUpAbon write FPopUpAbon;
 
     // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
     property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
@@ -535,6 +542,13 @@ begin
                FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
                FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
 
+               FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', '');
+               FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0);
+               FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0);
+               FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0);
+               FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1);
+               FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1);
+
                FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
                FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
                FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
@@ -801,6 +815,14 @@ begin
                ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
                ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
 
+               ini.WriteString('Window', 'BrowserFontName', FBrowserFontName);
+               ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
+               ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
+               ini.WriteInteger('Window', 'BrowserFontBold', FBrowserFontBold);
+               ini.WriteInteger('Window', 'BrowserFontItalic', FBrowserFontItalic);
+               ini.WriteInteger('Window', 'BrowserFontColor', FBrowserFontColor);
+               ini.WriteInteger('Window', 'BrowserBackColor', FBrowserBackColor);
+
                ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
                ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
                ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
@@ -989,10 +1011,10 @@ begin
                        ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
                end;
 
-        //\82 \82Ú\81`\82ñ
-        ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
-        ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
-        ini.WriteBool('abon','Popup',FPopUpAbon);
+    //\82 \82Ú\81`\82ñ
+    ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
+    ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
+    ini.WriteBool('abon','Popup',FPopUpAbon);
 
                ini.UpdateFile;
        finally
index 9d013d7..2d1b881 100644 (file)
Binary files a/gikoNavi.res and b/gikoNavi.res differ