From d712c5a00fd88324b7238a131fe93d75147246c3 Mon Sep 17 00:00:00 2001 From: f_swallow Date: Fri, 4 Feb 2011 10:06:02 +0000 Subject: [PATCH] =?utf8?q?=E8=A8=AD=E5=AE=9A=E3=83=80=E3=82=A4=E3=82=A2?= =?utf8?q?=E3=83=AD=E3=82=B0=E3=81=AE=E3=83=84=E3=83=AA=E3=83=BC=E3=83=93?= =?utf8?q?=E3=83=A5=E3=83=BC=E3=81=AE=E3=83=8E=E3=83=BC=E3=83=89=E3=81=AE?= =?utf8?q?=E3=82=B7=E3=83=B3=E3=82=B0=E3=83=AB=E3=82=AF=E3=83=AA=E3=83=83?= =?utf8?q?=E3=82=AF=E3=81=A7=E3=81=AE=E5=B1=95=E9=96=8B=E3=82=92=E3=81=AA?= =?utf8?q?=E3=81=8F=E3=81=97=E3=81=A6=E3=82=82=E3=81=A8=E3=81=AE=E5=BD=A2?= =?utf8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.sourceforge.jp/svnroot/tween/trunk@1440 e39ad16e-3079-482e-bb30-4b4d378143b6 --- Tween/AppendSettingDialog.Designer.vb | 3 +- Tween/AppendSettingDialog.vb | 92 ++++++++++++++++++++--------------- 2 files changed, 53 insertions(+), 42 deletions(-) diff --git a/Tween/AppendSettingDialog.Designer.vb b/Tween/AppendSettingDialog.Designer.vb index fed2d95f..564a45b7 100644 --- a/Tween/AppendSettingDialog.Designer.vb +++ b/Tween/AppendSettingDialog.Designer.vb @@ -322,7 +322,6 @@ Partial Class AppendSettingDialog ' Me.TreeViewSetting.Cursor = System.Windows.Forms.Cursors.Hand resources.ApplyResources(Me.TreeViewSetting, "TreeViewSetting") - Me.TreeViewSetting.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawText Me.TreeViewSetting.HideSelection = False Me.TreeViewSetting.Name = "TreeViewSetting" Me.TreeViewSetting.Nodes.AddRange(New System.Windows.Forms.TreeNode() {CType(resources.GetObject("TreeViewSetting.Nodes"), System.Windows.Forms.TreeNode), CType(resources.GetObject("TreeViewSetting.Nodes1"), System.Windows.Forms.TreeNode), CType(resources.GetObject("TreeViewSetting.Nodes2"), System.Windows.Forms.TreeNode), CType(resources.GetObject("TreeViewSetting.Nodes3"), System.Windows.Forms.TreeNode), CType(resources.GetObject("TreeViewSetting.Nodes4"), System.Windows.Forms.TreeNode)}) @@ -1974,7 +1973,6 @@ Partial Class AppendSettingDialog End Sub Friend WithEvents SplitContainer1 As System.Windows.Forms.SplitContainer - Friend WithEvents TreeViewSetting As System.Windows.Forms.TreeView Friend WithEvents BasedPanel As System.Windows.Forms.Panel Friend WithEvents AuthBasicRadio As System.Windows.Forms.RadioButton Friend WithEvents AuthOAuthRadio As System.Windows.Forms.RadioButton @@ -2213,4 +2211,5 @@ Partial Class AppendSettingDialog Friend WithEvents LabelUserStreamActive As System.Windows.Forms.Label Friend WithEvents LabelApiUsingUserStreamEnabled As System.Windows.Forms.Label Friend WithEvents CheckUserUpdateEvent As System.Windows.Forms.CheckBox + Private WithEvents TreeViewSetting As System.Windows.Forms.TreeView End Class diff --git a/Tween/AppendSettingDialog.vb b/Tween/AppendSettingDialog.vb index b9d211a8..3d993415 100644 --- a/Tween/AppendSettingDialog.vb +++ b/Tween/AppendSettingDialog.vb @@ -130,7 +130,6 @@ Public Class AppendSettingDialog Private _MyOpenUserTimeline As Boolean Private _ValidationError As Boolean = False - Private _curPanel As Panel = Nothing Private _MyEventNotifyEnabled As Boolean Private _MyEventNotifyFlag As EVENTTYPE Private _isMyEventNotifyFlag As EVENTTYPE @@ -140,41 +139,57 @@ Public Class AppendSettingDialog Private _soundfileListup As Boolean = False Private _MyEventSoundFile As String - Private Sub ToggleNodeChange(ByVal node As TreeNode) - If node Is Nothing Then Exit Sub - TreeViewSetting.BeginUpdate() - If node.IsExpanded Then - node.Collapse() - Else - node.Expand() - End If - TreeViewSetting.EndUpdate() + Private Sub TreeViewSetting_BeforeSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewCancelEventArgs) Handles TreeViewSetting.BeforeSelect + If Me.TreeViewSetting.SelectedNode Is Nothing Then Exit Sub + Dim pnl = DirectCast(Me.TreeViewSetting.SelectedNode.Tag, Panel) + If pnl Is Nothing Then Exit Sub + pnl.Enabled = False + pnl.Visible = False End Sub - Private Sub TreeViewSetting_DrawNode(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawTreeNodeEventArgs) Handles TreeViewSetting.DrawNode - e.DrawDefault = True - If (e.State And TreeNodeStates.Selected) = TreeNodeStates.Selected Then - Dim pnl = DirectCast(e.Node.Tag, Panel) - If pnl Is Nothing Then Exit Sub - If _curPanel IsNot Nothing Then - If pnl.Name <> _curPanel.Name Then - _curPanel.Enabled = False - _curPanel.Visible = False - - _curPanel = pnl - pnl.Enabled = True - pnl.Visible = True - End If - End If - End If + Private Sub TreeViewSetting_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeViewSetting.AfterSelect + If e.Node Is Nothing Then Exit Sub + Dim pnl = DirectCast(e.Node.Tag, Panel) + If pnl Is Nothing Then Exit Sub + pnl.Enabled = True + pnl.Visible = True End Sub - Private Sub TreeViewSetting_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeViewSetting.MouseDown - Dim info As TreeViewHitTestInfo = TreeViewSetting.HitTest(e.X, e.Y) - If CBool((info.Location And TreeViewHitTestLocations.Label)) Then - ToggleNodeChange(info.Node) - End If - End Sub + 'Private Sub ToggleNodeChange(ByVal node As TreeNode) + ' If node Is Nothing Then Exit Sub + ' TreeViewSetting.BeginUpdate() + ' If node.IsExpanded Then + ' node.Collapse() + ' Else + ' node.Expand() + ' End If + ' TreeViewSetting.EndUpdate() + 'End Sub + + 'Private Sub TreeViewSetting_DrawNode(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawTreeNodeEventArgs) Handles TreeViewSetting.DrawNode + ' e.DrawDefault = True + ' If (e.State And TreeNodeStates.Selected) = TreeNodeStates.Selected Then + ' Dim pnl = DirectCast(e.Node.Tag, Panel) + ' If pnl Is Nothing Then Exit Sub + ' If _curPanel IsNot Nothing Then + ' If pnl.Name <> _curPanel.Name Then + ' _curPanel.Enabled = False + ' _curPanel.Visible = False + + ' _curPanel = pnl + ' pnl.Enabled = True + ' pnl.Visible = True + ' End If + ' End If + ' End If + 'End Sub + + 'Private Sub TreeViewSetting_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeViewSetting.MouseDown + ' Dim info As TreeViewHitTestInfo = TreeViewSetting.HitTest(e.X, e.Y) + ' If CBool((info.Location And TreeViewHitTestLocations.Label)) Then + ' ToggleNodeChange(info.Node) + ' End If + 'End Sub Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Save.Click If TweenMain.IsNetworkAvailable() AndAlso _ @@ -397,7 +412,6 @@ Public Class AppendSettingDialog End Sub Private Sub Setting_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing - If TreeViewSetting.SelectedNode IsNot Nothing Then _curPanel = CType(TreeViewSetting.SelectedNode.Tag, Panel) If tw IsNot Nothing AndAlso tw.Username = "" AndAlso e.CloseReason = CloseReason.None Then If MessageBox.Show(My.Resources.Setting_FormClosing1, "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) = Windows.Forms.DialogResult.Cancel Then e.Cancel = True @@ -406,6 +420,11 @@ Public Class AppendSettingDialog If _ValidationError Then e.Cancel = True End If + If e.Cancel = False AndAlso TreeViewSetting.SelectedNode IsNot Nothing Then + Dim curPanel As Panel = CType(TreeViewSetting.SelectedNode.Tag, Panel) + curPanel.Visible = False + curPanel.Enabled = False + End If End Sub Private Sub Setting_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Load @@ -689,13 +708,6 @@ Public Class AppendSettingDialog .SelectedNode = .Nodes(0) End With - If _curPanel IsNot Nothing Then - _curPanel.Enabled = False - _curPanel.Visible = False - End If - _curPanel = BasedPanel - _curPanel.Enabled = True - _curPanel.Visible = True TreeViewSetting.SelectedNode = TreeViewSetting.TopNode ActiveControl = Username End Sub -- 2.11.0