• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonbathyscaphephpgamewindowsguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

デュアルディスプレイのセカンドモニターにPDFを表示。


コミットメタ情報

リビジョン52 (tree)
日時2018-12-20 17:59:09
作者bellyoshi

ログメッセージ

変更サマリ

差分

--- pdfsecondmonitor/frmOperation.Designer.vb (revision 51)
+++ pdfsecondmonitor/frmOperation.Designer.vb (revision 52)
@@ -29,12 +29,9 @@
2929 Me.GroupBox1 = New System.Windows.Forms.GroupBox()
3030 Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
3131 Me.tpMediaPlayer = New System.Windows.Forms.TabPage()
32- Me.CtlMovie1 = New pdfsecondmonitor.ctlMovie()
3332 Me.tbcFileOpes = New System.Windows.Forms.TabControl()
3433 Me.tpAdobePDF = New System.Windows.Forms.TabPage()
35- Me.CtlPdf1 = New pdfsecondmonitor.ctlPdf()
3634 Me.tpImage = New System.Windows.Forms.TabPage()
37- Me.CtlImage1 = New pdfsecondmonitor.CtlImage()
3835 Me.Label6 = New System.Windows.Forms.Label()
3936 Me.txtPDFFileName = New System.Windows.Forms.TextBox()
4037 Me.btnDelete = New System.Windows.Forms.Button()
@@ -41,7 +38,10 @@
4138 Me.lstPDFFiles = New System.Windows.Forms.ListBox()
4239 Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
4340 Me.btnUnSelect = New System.Windows.Forms.Button()
44- Me.Button2 = New System.Windows.Forms.Button()
41+ Me.btnFileAdd = New System.Windows.Forms.Button()
42+ Me.CtlPdf1 = New pdfsecondmonitor.ctlPdf()
43+ Me.CtlMovie1 = New pdfsecondmonitor.ctlMovie()
44+ Me.CtlImage1 = New pdfsecondmonitor.CtlImage()
4545 Me.GroupBox1.SuspendLayout()
4646 Me.tpMediaPlayer.SuspendLayout()
4747 Me.tbcFileOpes.SuspendLayout()
@@ -96,13 +96,6 @@
9696 Me.tpMediaPlayer.Text = "動画"
9797 Me.tpMediaPlayer.UseVisualStyleBackColor = True
9898 '
99- 'CtlMovie1
100- '
101- Me.CtlMovie1.Location = New System.Drawing.Point(37, 31)
102- Me.CtlMovie1.Name = "CtlMovie1"
103- Me.CtlMovie1.Size = New System.Drawing.Size(467, 166)
104- Me.CtlMovie1.TabIndex = 0
105- '
10699 'tbcFileOpes
107100 '
108101 Me.tbcFileOpes.Controls.Add(Me.tpAdobePDF)
@@ -125,13 +118,6 @@
125118 Me.tpAdobePDF.Text = "PDFの表示"
126119 Me.tpAdobePDF.UseVisualStyleBackColor = True
127120 '
128- 'CtlPdf1
129- '
130- Me.CtlPdf1.Location = New System.Drawing.Point(6, 31)
131- Me.CtlPdf1.Name = "CtlPdf1"
132- Me.CtlPdf1.Size = New System.Drawing.Size(705, 128)
133- Me.CtlPdf1.TabIndex = 0
134- '
135121 'tpImage
136122 '
137123 Me.tpImage.Controls.Add(Me.CtlImage1)
@@ -143,13 +129,6 @@
143129 Me.tpImage.Text = "画像"
144130 Me.tpImage.UseVisualStyleBackColor = True
145131 '
146- 'CtlImage1
147- '
148- Me.CtlImage1.Location = New System.Drawing.Point(28, 31)
149- Me.CtlImage1.Name = "CtlImage1"
150- Me.CtlImage1.Size = New System.Drawing.Size(600, 179)
151- Me.CtlImage1.TabIndex = 0
152- '
153132 'Label6
154133 '
155134 Me.Label6.AutoSize = True
@@ -195,15 +174,36 @@
195174 Me.btnUnSelect.Text = "選択解除"
196175 Me.btnUnSelect.UseVisualStyleBackColor = True
197176 '
198- 'Button2
177+ 'btnFileAdd
199178 '
200- Me.Button2.Location = New System.Drawing.Point(212, 536)
201- Me.Button2.Name = "Button2"
202- Me.Button2.Size = New System.Drawing.Size(130, 23)
203- Me.Button2.TabIndex = 21
204- Me.Button2.Text = "ファイルを追加する"
205- Me.Button2.UseVisualStyleBackColor = True
179+ Me.btnFileAdd.Location = New System.Drawing.Point(212, 536)
180+ Me.btnFileAdd.Name = "btnFileAdd"
181+ Me.btnFileAdd.Size = New System.Drawing.Size(130, 23)
182+ Me.btnFileAdd.TabIndex = 21
183+ Me.btnFileAdd.Text = "ファイルを追加する"
184+ Me.btnFileAdd.UseVisualStyleBackColor = True
206185 '
186+ 'CtlPdf1
187+ '
188+ Me.CtlPdf1.Location = New System.Drawing.Point(6, 31)
189+ Me.CtlPdf1.Name = "CtlPdf1"
190+ Me.CtlPdf1.Size = New System.Drawing.Size(705, 128)
191+ Me.CtlPdf1.TabIndex = 0
192+ '
193+ 'CtlMovie1
194+ '
195+ Me.CtlMovie1.Location = New System.Drawing.Point(37, 31)
196+ Me.CtlMovie1.Name = "CtlMovie1"
197+ Me.CtlMovie1.Size = New System.Drawing.Size(467, 166)
198+ Me.CtlMovie1.TabIndex = 0
199+ '
200+ 'CtlImage1
201+ '
202+ Me.CtlImage1.Location = New System.Drawing.Point(28, 31)
203+ Me.CtlImage1.Name = "CtlImage1"
204+ Me.CtlImage1.Size = New System.Drawing.Size(600, 179)
205+ Me.CtlImage1.TabIndex = 0
206+ '
207207 'frmOperation
208208 '
209209 Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!)
@@ -210,7 +210,7 @@
210210 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
211211 Me.ClientSize = New System.Drawing.Size(1168, 649)
212212 Me.Controls.Add(Me.Label6)
213- Me.Controls.Add(Me.Button2)
213+ Me.Controls.Add(Me.btnFileAdd)
214214 Me.Controls.Add(Me.btnUnSelect)
215215 Me.Controls.Add(Me.tbcFileOpes)
216216 Me.Controls.Add(Me.GroupBox1)
@@ -243,7 +243,7 @@
243243 Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker
244244 Friend WithEvents btnUnSelect As Button
245245 Friend WithEvents Label6 As Label
246- Friend WithEvents Button2 As Button
246+ Friend WithEvents btnFileAdd As Button
247247 Friend WithEvents tpImage As TabPage
248248 Friend WithEvents CtlPdf1 As ctlPdf
249249 Friend WithEvents CtlImage1 As CtlImage
--- pdfsecondmonitor/frmOperation.vb (revision 51)
+++ pdfsecondmonitor/frmOperation.vb (revision 52)
@@ -198,7 +198,7 @@
198198
199199 Private Function IsContain(ext As String, exts As String()) As Boolean
200200 For Each target In exts
201- If String.Compare(target, ext, True) = 0 Then
201+ If String.Compare($".{target}", ext, True) = 0 Then
202202 Return True
203203 End If
204204 Next
@@ -205,23 +205,44 @@
205205 Return False
206206 End Function
207207
208+ Private movieExts = {"avi", "mpeg", "mp4", "wmv"}
209+
210+ Private ImageExts = {"jpeg", "jpg", "bmp", "png", "gif", "tiff", "tif"}
208211 Private Function IsImageExt(ext) As Boolean
209- Return IsContain(ext, {".jpeg", ".jpg", ".bmp", ".png", "gif", "tiff"})
212+ Return IsContain(ext, ImageExts)
210213 End Function
211214
212215 Private Function IsMovieExt(ext) As Boolean
213- Return IsContain(ext, {".avi", ".mpeg", ".mp4", ".wmv"})
216+ Return IsContain(ext, movieExts)
214217 End Function
215218
219+ Private Function CreateFilter() As String
220+ Dim buf As New System.Text.StringBuilder
221+ buf.Append("画像、動画、PDFファイル")
222+ buf.Append("|")
223+ buf.Append("*.pdf")
224+ buf.Append(CreateExtsOfFilter(ImageExts))
225+ buf.Append(CreateExtsOfFilter(movieExts))
226+ buf.Append("|")
227+ buf.Append("All Files(*.*)")
228+ buf.Append("|")
229+ buf.Append("*.*")
230+ Return buf.ToString()
231+ End Function
216232
233+ Private Function CreateExtsOfFilter(ByVal exts As String()) As String
234+ Dim buf = New System.Text.StringBuilder
235+ For Each ext In exts
236+ buf.Append("*.")
237+ buf.Append(ext)
238+ buf.Append(";")
239+ Next
240+ Return buf.ToString()
241+ End Function
217242
218-
219-
220-
221-
222- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
243+ Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btnFileAdd.Click
223244 OpenFileDialog1.Multiselect = True
224- OpenFileDialog1.Filter = "画像、動画、PDFファイル|*.pdf;*.bmp;*.gif;*.png;*.jpeg;*jpg;|All Files(*.*)|*.*;"
245+ OpenFileDialog1.Filter = CreateFilter()
225246 OpenFileDialog1.FileName = txtPDFFileName.Text
226247 Dim ret = OpenFileDialog1.ShowDialog()
227248 If ret = Windows.Forms.DialogResult.Cancel Then
@@ -238,6 +259,7 @@
238259 End Sub
239260
240261 Private Sub btnUnSelect_Click(sender As Object, e As EventArgs) Handles btnUnSelect.Click
262+ lstPDFFiles.SelectedItem = Nothing
241263 _dispacher.CloseViewers()
242264 End Sub
243265