OSDN Git Service

acf0bdd7f0150e61ecdf93350e4da1f9b8e99ed1
[opentween/open-tween.git] / Tween / InputTabName.vb
1 ' Tween - Client of Twitter
2 ' Copyright (c) 2007-2009 kiri_feather (@kiri_feather) <kiri_feather@gmail.com>
3 '           (c) 2008-2009 Moz (@syo68k) <http://iddy.jp/profile/moz/>
4 '           (c) 2008-2009 takeshik (@takeshik) <http://www.takeshik.org/>
5 ' All rights reserved.
6
7 ' This file is part of Tween.
8
9 ' This program is free software; you can redistribute it and/or modify it
10 ' under the terms of the GNU General Public License as published by the Free
11 ' Software Foundation; either version 3 of the License, or (at your option)
12 ' any later version.
13
14 ' This program is distributed in the hope that it will be useful, but
15 ' WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 ' or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 ' for more details. 
18
19 ' You should have received a copy of the GNU General Public License along
20 ' with this program. If not, see <http://www.gnu.org/licenses/>, or write to
21 ' the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
22 ' Boston, MA 02110-1301, USA.
23
24 Imports System.Windows.Forms
25
26 Public Class InputTabName
27
28     Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
29         Me.DialogResult = System.Windows.Forms.DialogResult.OK
30         Me.Close()
31     End Sub
32
33     Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
34         TextTabName.Text = ""
35         Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
36         Me.Close()
37     End Sub
38
39     Public Property TabName() As String
40         Get
41             Return Me.TextTabName.Text.Trim()
42         End Get
43         Set(ByVal value As String)
44             TextTabName.Text = value.Trim()
45         End Set
46     End Property
47
48     Public WriteOnly Property FormTitle() As String
49         Set(ByVal value As String)
50             Me.Text = value
51         End Set
52     End Property
53
54     Public WriteOnly Property FormDescription() As String
55         Set(ByVal value As String)
56             Me.LabelDescription.Text = value
57         End Set
58     End Property
59
60     Private _isShowUsage As Boolean
61     Public WriteOnly Property IsShowUsage() As Boolean
62         Set(ByVal value As Boolean)
63             _isShowUsage = value
64         End Set
65     End Property
66
67     Private _usage As TabUsageType
68     Public ReadOnly Property Usage() As TabUsageType
69         Get
70             Return _usage
71         End Get
72     End Property
73
74     Private Sub InputTabName_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
75         Me.LabelUsage.Visible = False
76         Me.ComboUsage.Visible = False
77         Me.ComboUsage.Items.Add("タイムライン振り分け")
78         Me.ComboUsage.Items.Add("PublicSearch")
79         Me.ComboUsage.SelectedIndex = 0
80     End Sub
81
82     Private Sub InputTabName_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
83         ActiveControl = TextTabName
84         If _isShowUsage Then
85             Me.LabelUsage.Visible = True
86             Me.ComboUsage.Visible = True
87         End If
88     End Sub
89
90     Private Sub ComboUsage_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboUsage.SelectedIndexChanged
91         Select Case ComboUsage.SelectedIndex
92             Case 0
93                 _usage = TabUsageType.UserDefined
94             Case 1
95                 _usage = TabUsageType.PublicSearch
96             Case Else
97                 _usage = TabUsageType.Undefined
98         End Select
99     End Sub
100 End Class