[Tween-svn] [1314] PostBrowser. IsMonospaceプロパティを実装。動くか確認なんてしてないし、これがどういうプロパティかも知らん。とにかく書いた。てゆーかコピペした。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 1月 5日 (水) 14:32:59 JST


Revision: 1314
          http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1314
Author:   anis774
Date:     2011-01-05 14:32:59 +0900 (Wed, 05 Jan 2011)

Log Message:
-----------
PostBrowser.IsMonospaceプロパティを実装。動くか確認なんてしてないし、これがどういうプロパティかも知らん。とにかく書いた。てゆーかコピペした。

Modified Paths:
--------------
    branches/OperationClean/Tween/PostBrowser.vb


-------------- next part --------------
Modified: branches/OperationClean/Tween/PostBrowser.vb
===================================================================
--- branches/OperationClean/Tween/PostBrowser.vb	2011-01-05 01:41:08 UTC (rev 1313)
+++ branches/OperationClean/Tween/PostBrowser.vb	2011-01-05 05:32:59 UTC (rev 1314)
@@ -1,31 +1,91 @@
 Public Class PostBrowser
+    Private Const detailHtmlFormatMono1 As String = "<html><head><style type=""text/css""><!-- pre {font-family: """
+    Private Const detailHtmlFormat2 As String = """, sans-serif; font-size: "
+    Private Const detailHtmlFormat3 As String = "pt; word-wrap: break-word; color:rgb("
+    Private Const detailHtmlFormat4 As String = ");} a:link, a:visited, a:active, a:hover {color:rgb("
+    Private Const detailHtmlFormat5 As String = "); } --></style></head><body style=""margin:0px; background-color:rgb("
+    Private Const detailHtmlFormatMono6 As String = ");""><pre>"
+    Private Const detailHtmlFormatMono7 As String = "</pre></body></html>"
+    Private Const detailHtmlFormat1 As String = "<html><head><style type=""text/css""><!-- p {font-family: """
+    Private Const detailHtmlFormat6 As String = ");""><p>"
+    Private Const detailHtmlFormat7 As String = "</p></body></html>"
+    Private detailHtmlFormatHeader As String
+    Private detailHtmlFormatFooter As String
+
     Private _post As PostClass
     Public Property Post As PostClass
+        Get
+            Return Me._post
+        End Get
         Set(ByVal value As PostClass)
             Me._post = value
         End Set
-        Get
-            Return Me._post
-        End Get
     End Property
 
     Private _isMonospace As Boolean
-    Public Property isMonospace As Boolean
+    Public Property IsMonospace As Boolean
+        Get
+            Return Me._isMonospace
+        End Get
         Set(ByVal value As Boolean)
             Me._isMonospace = value
+            If value Then
+                Me.detailHtmlFormatHeader = detailHtmlFormatMono1
+                Me.detailHtmlFormatFooter = detailHtmlFormatMono7
+            Else
+                Me.detailHtmlFormatHeader = detailHtmlFormat1
+                Me.detailHtmlFormatFooter = detailHtmlFormat7
+            End If
+
+            Me.detailHtmlFormatHeader += Me.Font.Name + detailHtmlFormat2 + Me.Font.Size.ToString() + detailHtmlFormat3 + Me.Color.R.ToString() + "," + Me.Color.G.ToString() + "," + _clDetail.B.ToString() + detailHtmlFormat4 + Me.LinkColor.R.ToString() + "," + Me.LinkColor.G.ToString() + "," + Me.LinkColor.B.ToString() + detailHtmlFormat5 + Me.BackColor.R.ToString() + "," + Me.BackColor.G.ToString() + "," + Me.BackColor.B.ToString()
+
+            If value Then
+                Me.detailHtmlFormatHeader += detailHtmlFormatMono6
+            Else
+                Me.detailHtmlFormatHeader += detailHtmlFormat6
+            End If
         End Set
-        Get
-            Return Me._isMonospace
-        End Get
     End Property
 
     Private _font As Font = MyBase.Font
     Public Overrides Property Font As Font
+        Get
+            Return Me._font
+        End Get
         Set(ByVal value As Font)
             Me._font = value
         End Set
+    End Property
+
+    Private _color As Color
+    Public Property Color As Color
         Get
-            Return Me._font
+            Return Me._color
         End Get
+        Set(ByVal value As Color)
+            Me._color = value
+        End Set
     End Property
+
+
+    Private _backColor As Color = MyBase.BackColor
+    Public Overrides Property BackColor As Color
+        Get
+            Return _backColor
+        End Get
+        Set(ByVal value As Color)
+            _backColor = value
+        End Set
+    End Property
+
+
+    Private _linkColor As Color
+    Public Property LinkColor As Color
+        Get
+            Return _linkColor
+        End Get
+        Set(ByVal value As Color)
+            _linkColor = value
+        End Set
+    End Property
 End Class



Tween-svn メーリングリストの案内
Back to archive index