• R/O
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#windowsobjective-ccocoaqtpython誰得phprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

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


Commit MetaInfo

Revision46 (tree)
Time2018-11-26 16:42:55
Authorbellyoshi

Log Message

Change Summary

Incremental Difference

--- pdfsecondmonitor/CtlImage.vb (revision 45)
+++ pdfsecondmonitor/CtlImage.vb (revision 46)
@@ -2,11 +2,7 @@
22
33 Private _dispacher As FormDispacher = FormDispacher.GetInstance
44
5- Public ReadOnly Property PictureBox As PictureBox
6- Get
7- Return _dispacher.GetPictureBox
8- End Get
9- End Property
5+ Private _pictureBox As PictureBox
106
117 Private Sub btnRotate_Click(sender As Object, e As EventArgs) Handles btnRotate.Click
128 Dim bmp As Bitmap = New Bitmap(_fileViewParam.FileName)
@@ -15,24 +11,20 @@
1511 '"FlipX"は水平方向に反転することを意味する
1612 bmp.RotateFlip(RotateFlipType.Rotate180FlipX)
1713 '表示
18- PictureBox.Image = bmp
14+ _pictureBox.Image = bmp
1915 End Sub
2016
21- Private Sub CtlImage_Load(sender As Object, e As EventArgs) Handles MyBase.Load
2217
23- End Sub
24-
2518 Private _fileViewParam As FileViewParam
2619
2720 Public Sub SetFileInfo(f As FileViewParam)
2821 Me._fileViewParam = f
29- If _fileViewParam Is Nothing Then
30- _dispacher.HidePdfViewer()
31- Else
32- _dispacher.ShowPdfViewer()
22+ If f Is Nothing Then
23+ Return
3324 End If
34- PictureBox.ImageLocation = _fileViewParam.FileName
35- PictureBox.SizeMode = PictureBoxSizeMode.Zoom 'サイズ調整
25+ _pictureBox = _dispacher.ShowImage()
26+ _pictureBox.ImageLocation = _fileViewParam.FileName
27+ _pictureBox.SizeMode = PictureBoxSizeMode.Zoom 'サイズ調整
3628
3729
3830 End Sub
--- pdfsecondmonitor/FormDispacher.vb (revision 45)
+++ pdfsecondmonitor/FormDispacher.vb (revision 46)
@@ -35,34 +35,17 @@
3535 Return instance
3636 End Function
3737
38- Private _frmOperation As frmOperation
39- Public Sub ShowOperation()
40- Create(_frmOperation, GetType(frmOperation))
41- _frmOperation.Show()
42- End Sub
43-
44-
45- Public Sub ShowImage()
38+ Public Function ShowImage() As PictureBox
4639 Show(_frmImageViewer, GetType(frmImageViewer))
47- End Sub
48- Private _frmImageViewer As frmImageViewer
49- Public Function GetPictureBox() As PictureBox
50- If _frmImageViewer Is Nothing Then
51- ShowImage()
52- End If
5340 Return _frmImageViewer.PictureBox1
5441 End Function
42+ Private _frmImageViewer As frmImageViewer
5543
56- Dim _frmPdfViewer As frmPdfViewer
5744
45+
5846 Private _frmMovieViewer As frmMovieViewer
59- Public Sub ShowMovie()
47+ Public Function ShowMovie() As AxWMPLib.AxWindowsMediaPlayer
6048 Show(_frmMovieViewer, GetType(frmMovieViewer))
61- End Sub
62- Public Function GetPlayer() As AxWMPLib.AxWindowsMediaPlayer
63- If _frmMovieViewer Is Nothing Then
64- ShowMovie()
65- End If
6649 Return _frmMovieViewer.AxWindowsMediaPlayer1
6750 End Function
6851
@@ -89,25 +72,18 @@
8972 targetForm.Show()
9073 End Sub
9174
92- Public Sub HidePdfViewer()
93- _frmPdfViewer.Hide()
94- End Sub
95-
96- Public Sub ShowPdfViewer()
75+ Dim _frmPdfViewer As frmPdfViewer
76+ Public Function ShowPdfViewer() As frmPdfViewer
9777 Show(_frmPdfViewer, GetType(frmPdfViewer))
98- End Sub
99-
100- 'Private _frmStartup As frmStartup
101- 'Public Sub SetStartup(ByVal frm As frmStartup)
102- ' _frmStartup = frmStartup
103- 'End Sub
104- Public Sub Close()
105- '特に処理なし
106- End Sub
107-
108- Public Function GetFrmPdfViewer() As frmPdfViewer
10978 Return _frmPdfViewer
11079 End Function
11180
11281
82+
83+ Public Sub CloseViewers()
84+ For Each frm In _secondMonitorWindows
85+ frm.Close()
86+ Next
87+ End Sub
88+
11389 End Class
--- pdfsecondmonitor/My Project/Application.Designer.vb (revision 45)
+++ pdfsecondmonitor/My Project/Application.Designer.vb (revision 46)
@@ -32,7 +32,7 @@
3232
3333 <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
3434 Protected Overrides Sub OnCreateMainForm()
35- Me.MainForm = Global.pdfsecondmonitor.startup
35+ Me.MainForm = Global.pdfsecondmonitor.frmOperation
3636 End Sub
3737 End Class
3838 End Namespace
--- pdfsecondmonitor/ctlMovie.vb (revision 45)
+++ pdfsecondmonitor/ctlMovie.vb (revision 46)
@@ -2,11 +2,7 @@
22 Private _dispacher As FormDispacher = FormDispacher.GetInstance
33
44
5- Public ReadOnly Property player As AxWMPLib.AxWindowsMediaPlayer
6- Get
7- Return _dispacher.GetPlayer
8- End Get
9- End Property
5+ Private player As AxWMPLib.AxWindowsMediaPlayer
106
117 Private _fileViewParam As FileViewParam
128
@@ -13,10 +9,10 @@
139 Public Sub SetFileInfo(f As FileViewParam)
1410 Me._fileViewParam = f
1511 If _fileViewParam Is Nothing Then
12+ Return
13+ End If
14+ player = _dispacher.ShowMovie()
1615
17- Else
18- _dispacher.ShowMovie()
19- End If
2016 player.URL = _fileViewParam.FileName
2117 player.uiMode = "none"
2218 player.stretchToFit = True
--- pdfsecondmonitor/ctlPdf.vb (revision 45)
+++ pdfsecondmonitor/ctlPdf.vb (revision 46)
@@ -2,28 +2,23 @@
22
33 Private _dispacher As FormDispacher = FormDispacher.GetInstance
44
5- ReadOnly Property frmPdfViewer As frmPdfViewer
6- Get
7- Return _dispacher.GetFrmPdfViewer
8- End Get
9- End Property
5+ Private _viewer As frmPdfViewer
106
117
128
139
14-
1510 #Region "ページ移動"
1611
1712 Private Sub btnFirst_Click(sender As Object, e As EventArgs) Handles btnPDFFirst.Click
18- frmPdfViewer.FirstPage()
13+ _viewer.FirstPage()
1914 End Sub
2015
2116 Private Sub btnNext_Click(sender As Object, e As EventArgs) Handles btnPDFNext.Click
22- frmPdfViewer.NextPage()
17+ _viewer.NextPage()
2318 End Sub
2419
2520 Private Sub btnBack_Click(sender As Object, e As EventArgs) Handles btnPDFBack.Click
26- frmPdfViewer.PrePage()
21+ _viewer.PrePage()
2722 End Sub
2823
2924 Private Sub btnLast_Click(sender As Object, e As EventArgs) Handles btnPDFLast.Click
@@ -37,7 +32,8 @@
3732 Private _fileViewParam As FileViewParam
3833 Public Sub SetFileInfo(f As FileViewParam)
3934 Me._fileViewParam = f
40- frmPdfViewer.OpenFile(f.FileName)
35+ _viewer = _dispacher.ShowPdfViewer()
36+ _viewer.OpenFile(f.FileName)
4137 End Sub
4238
4339
--- pdfsecondmonitor/frmMovieViewer.vb (revision 45)
+++ pdfsecondmonitor/frmMovieViewer.vb (revision 46)
@@ -1,5 +1,3 @@
11 Public Class frmMovieViewer
2- Private Sub CtlMoviePlayer1_Load(sender As Object, e As EventArgs)
32
4- End Sub
53 End Class
\ No newline at end of file
--- pdfsecondmonitor/frmOperation.Designer.vb (revision 45)
+++ pdfsecondmonitor/frmOperation.Designer.vb (revision 46)
@@ -38,10 +38,9 @@
3838 Me.Label6 = New System.Windows.Forms.Label()
3939 Me.txtPDFFileName = New System.Windows.Forms.TextBox()
4040 Me.btnDelete = New System.Windows.Forms.Button()
41- Me.btnInsert = New System.Windows.Forms.Button()
4241 Me.lstPDFFiles = New System.Windows.Forms.ListBox()
4342 Me.BackgroundWorker1 = New System.ComponentModel.BackgroundWorker()
44- Me.Button1 = New System.Windows.Forms.Button()
43+ Me.btnUnSelect = New System.Windows.Forms.Button()
4544 Me.Button2 = New System.Windows.Forms.Button()
4645 Me.GroupBox1.SuspendLayout()
4746 Me.tpMediaPlayer.SuspendLayout()
@@ -177,15 +176,6 @@
177176 Me.btnDelete.Text = "削除"
178177 Me.btnDelete.UseVisualStyleBackColor = True
179178 '
180- 'btnInsert
181- '
182- Me.btnInsert.Location = New System.Drawing.Point(107, 598)
183- Me.btnInsert.Name = "btnInsert"
184- Me.btnInsert.Size = New System.Drawing.Size(92, 23)
185- Me.btnInsert.TabIndex = 20
186- Me.btnInsert.Text = "リストに追加"
187- Me.btnInsert.UseVisualStyleBackColor = True
188- '
189179 'lstPDFFiles
190180 '
191181 Me.lstPDFFiles.FormattingEnabled = True
@@ -195,14 +185,14 @@
195185 Me.lstPDFFiles.Size = New System.Drawing.Size(308, 349)
196186 Me.lstPDFFiles.TabIndex = 19
197187 '
198- 'Button1
188+ 'btnUnSelect
199189 '
200- Me.Button1.Location = New System.Drawing.Point(43, 114)
201- Me.Button1.Name = "Button1"
202- Me.Button1.Size = New System.Drawing.Size(299, 23)
203- Me.Button1.TabIndex = 20
204- Me.Button1.Text = "背景テキスト"
205- Me.Button1.UseVisualStyleBackColor = True
190+ Me.btnUnSelect.Location = New System.Drawing.Point(53, 126)
191+ Me.btnUnSelect.Name = "btnUnSelect"
192+ Me.btnUnSelect.Size = New System.Drawing.Size(267, 23)
193+ Me.btnUnSelect.TabIndex = 20
194+ Me.btnUnSelect.Text = "選択解除"
195+ Me.btnUnSelect.UseVisualStyleBackColor = True
206196 '
207197 'Button2
208198 '
@@ -220,10 +210,9 @@
220210 Me.ClientSize = New System.Drawing.Size(1168, 649)
221211 Me.Controls.Add(Me.Label6)
222212 Me.Controls.Add(Me.Button2)
223- Me.Controls.Add(Me.Button1)
213+ Me.Controls.Add(Me.btnUnSelect)
224214 Me.Controls.Add(Me.tbcFileOpes)
225215 Me.Controls.Add(Me.GroupBox1)
226- Me.Controls.Add(Me.btnInsert)
227216 Me.Controls.Add(Me.btnDelete)
228217 Me.Controls.Add(Me.lstPDFFiles)
229218 Me.Controls.Add(Me.txtPDFFileName)
@@ -248,11 +237,10 @@
248237 Friend WithEvents tbcFileOpes As TabControl
249238 Friend WithEvents tpAdobePDF As TabPage
250239 Friend WithEvents txtPDFFileName As TextBox
251- Friend WithEvents btnInsert As Button
252240 Friend WithEvents lstPDFFiles As ListBox
253241 Friend WithEvents btnDelete As Button
254242 Friend WithEvents BackgroundWorker1 As System.ComponentModel.BackgroundWorker
255- Friend WithEvents Button1 As Button
243+ Friend WithEvents btnUnSelect As Button
256244 Friend WithEvents Label6 As Label
257245 Friend WithEvents Button2 As Button
258246 Friend WithEvents tpImage As TabPage
--- pdfsecondmonitor/frmOperation.vb (revision 45)
+++ pdfsecondmonitor/frmOperation.vb (revision 46)
@@ -85,8 +85,8 @@
8585
8686 Private Sub frmOperation_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
8787 AppSettingSave()
88- _dispacher.Close()
8988
89+
9090 End Sub
9191 #End Region
9292
@@ -170,13 +170,11 @@
170170 Dim ext = IO.Path.GetExtension(fileviewinfo.FileName)
171171 If IsContain(ext, {".pdf"}) Then
172172 tbcFileOpes.SelectTab(tpAdobePDF.TabIndex)
173- _dispacher.ShowPdfViewer()
174173 CtlPdf1.SetFileInfo(fileviewinfo)
175174
176175 ElseIf IsImageExt(ext) Then
177176 tbcFileOpes.SelectTab(tpImage.TabIndex)
178177 CtlImage1.SetFileInfo(fileviewinfo)
179- _dispacher.ShowImage()
180178 ElseIf IsMovieExt(ext) Then
181179 tbcFileOpes.SelectTab(tpMediaPlayer.TabIndex)
182180 CtlMovie1.SetFileInfo(fileviewinfo)
@@ -225,6 +223,9 @@
225223
226224 End Sub
227225
226+ Private Sub btnUnSelect_Click(sender As Object, e As EventArgs) Handles btnUnSelect.Click
227+ _dispacher.CloseViewers()
228+ End Sub
228229
229230
230231
@@ -231,6 +232,7 @@
231232
232233
233234
235+
234236 #End Region
235237
236238 End Class
\ No newline at end of file
--- pdfsecondmonitor/startup.vb (revision 45)
+++ pdfsecondmonitor/startup.vb (revision 46)
@@ -1,7 +1,7 @@
11 Public Class startup
22 Private Sub startup_Load(sender As Object, e As EventArgs) Handles MyBase.Load
33 Dim dis = FormDispacher.GetInstance
4- dis.ShowOperation()
54
5+
66 End Sub
77 End Class
\ No newline at end of file