Dim nCurrentTab

Sub CleanButtonState()
	Button_Basic.selected = false
	Button_Upgrade.selected = false
	Button_HotKey.selected = false
	Button_LyricPane.selected = false
	Button_DesktopLyric.selected = false
	Button_SkinColor.selected = false
	Button_DownLoad.selected = false
	Button_CacheMgr.selected = false
	Button_SoundEffect.selected = false
	Button_other.selected = false
End Sub

Sub CleanPlaneState()
	DlgItem_Basic.visible = false
	DlgItem_Upgrade.visible = false
	DlgItem_HotKey.visible = false
	DlgItem_LyricPane.visible = false
	DlgItem_DesktopLyric.visible = false
	DlgItem_SkinColor.visible = false
	DlgItem_Download.visible = false
	DlgItem_CacheMgr.visible = false
	DlgItem_SoundEffect.visible = false
	DlgItem_Other.visible = false
End Sub

Sub Window_OnInit()
End Sub

Sub Button_Tab_General_OnClick()
	nCurrentTab = 1
	Adjust_TypeTab()
End Sub

Sub Button_Basic_OnClick()
	Button_Tab_General_OnClick()
	CleanButtonState()
	Button_Basic.selected = true
End Sub

Sub Button_Upgrade_OnClick()
	Button_Tab_General_OnClick()
	CleanButtonState()
	Button_Upgrade.selected = true
End Sub

Sub Button_HotKey_OnClick()
	Button_Tab_General_OnClick()
	CleanButtonState()
	Button_HotKey.selected = true	
End Sub

Sub Button_CacheMgr_OnClick()
	Button_Tab_General_OnClick
	CleanButtonState()
	Button_CacheMgr.selected = true	
End Sub

Sub Button_Tab_Lyric_OnClick()
	nCurrentTab = 2
	Adjust_TypeTab()
End Sub

Sub Button_LyricPane_OnClick()
	Button_Tab_Lyric_OnClick()
	CleanButtonState()
	Button_LyricPane.selected = true	
End Sub

Sub Button_DesktopLyric_OnClick()
	Button_Tab_Lyric_OnClick()
	CleanButtonState()
	Button_DesktopLyric.selected = true	
End Sub

Sub Button_Tab_Personal_OnClick()
	nCurrentTab = 3
	Adjust_TypeTab()
End Sub

Sub Button_SkinColor_OnClick()
	Button_Tab_Personal_OnClick
	CleanButtonState()
	Button_SkinColor.selected = true		
End Sub

Sub Button_DownLoad_OnClick()
	Button_Tab_Personal_OnClick
	CleanButtonState()
	Button_DownLoad.selected = true	
End Sub

Sub Button_SoundEffect_OnClick()
	Button_Tab_Personal_OnClick
	CleanButtonState()
	Button_SoundEffect.selected = true	
End Sub

Sub Button_other_OnClick()
	Button_Tab_Personal_OnClick
	CleanButtonState()
	Button_other.selected = true	
End Sub

Sub Window_OnSize(cx,cy)
End Sub

Sub Adjust_TypeTab()
	If nCurrentTab = 1 Then
		Button_Tab_General.left = 2
		Button_Tab_General.top = 2
		Button_Basic.visible = true
		Button_Basic.left = Button_Tab_General.left
		Button_Basic.top = Button_Tab_General.top + Button_Tab_General.height + 2
		Button_Upgrade.visible = true
		Button_Upgrade.left = Button_Tab_General.left
		Button_Upgrade.top = Button_Basic.top + Button_Basic.height
		Button_HotKey.visible = true
		Button_HotKey.left = Button_Tab_General.left
		Button_HotKey.top = Button_Upgrade.top + Button_Upgrade.height
		Button_CacheMgr.visible = true
		Button_CacheMgr.left = Button_Tab_General.left
		Button_CacheMgr.top = Button_HotKey.top + Button_HotKey.height
		
		Button_Tab_Lyric.left = Button_Tab_General.left 
		Button_Tab_Lyric.top = TypeTab.height - Button_Tab_Personal.height - Button_Tab_Lyric.height - 3
		Button_LyricPane.visible = false
		Button_DesktopLyric.visible = false
		
		Button_Tab_Personal.left = Button_Tab_General.left
		Button_Tab_Personal.top = Button_Tab_Lyric.top + Button_Tab_Lyric.height + 1
		Button_SkinColor.visible = false
		Button_DownLoad.visible = false
		Button_SoundEffect.visible = false
		Button_other.visible = false
	ElseIf nCurrentTab = 2 Then
		Button_Tab_General.left = 2
		Button_Tab_General.top = 2
		Button_Basic.visible = false
		Button_Upgrade.visible = false
		Button_HotKey.visible = false
		Button_CacheMgr.visible = false
		
		Button_Tab_Lyric.left = Button_Tab_General.left 
		Button_Tab_Lyric.top = Button_Tab_General.top + Button_Tab_General.height + 1
		Button_LyricPane.visible = true
		Button_LyricPane.left = Button_Tab_Lyric.left
		Button_LyricPane.top = Button_Tab_Lyric.top + Button_Tab_Lyric.height + 2
		Button_DesktopLyric.visible = true
		Button_DesktopLyric.left = Button_Tab_Lyric.left
		Button_DesktopLyric.top = Button_LyricPane.top + Button_LyricPane.height
		
		Button_Tab_Personal.left = Button_Tab_General.left
		Button_Tab_Personal.top = TypeTab.height - Button_Tab_Personal.height - 2
		Button_SkinColor.visible = false
		Button_DownLoad.visible = false
		Button_SoundEffect.visible = false
		Button_other.visible = false	
	ElseIf nCurrentTab = 3 Then
		Button_Tab_General.left = 2
		Button_Tab_General.top = 2
		Button_Basic.visible = false
		Button_Upgrade.visible = false
		Button_HotKey.visible = false
		Button_CacheMgr.visible = false
		
		Button_Tab_Lyric.left = Button_Tab_General.left 
		Button_Tab_Lyric.top = Button_Tab_General.top + Button_Tab_General.height + 1
		Button_LyricPane.visible = false
		Button_DesktopLyric.visible = false
		
		Button_Tab_Personal.left = Button_Tab_General.left
		Button_Tab_Personal.top = Button_Tab_Lyric.top + Button_Tab_Lyric.height + 1
		
		Button_SkinColor.visible = true
		Button_SkinColor.left = Button_Tab_Personal.left
		Button_SkinColor.top = Button_Tab_Personal.top + Button_Tab_Personal.height + 2
		
		Button_DownLoad.visible = true
		Button_DownLoad.left = Button_Tab_Personal.left
		Button_DownLoad.top = Button_SkinColor.top + Button_SkinColor.height
		
		Button_SoundEffect.visible = true
		Button_SoundEffect.left = Button_Tab_Personal.left
		Button_SoundEffect.top = Button_DownLoad.top + Button_DownLoad.height
		
		Button_other.visible = true
		Button_other.left = Button_Tab_Personal.left
		Button_other.top = Button_SoundEffect.top + Button_SoundEffect.height	
	End If
End Sub

'处理QQMusic程序发来的事件
Sub Window_OnNotify(code,var)
	If code = 1001 Then
		If Var = 0 Then
			Button_Basic_OnClick()
		ElseIf Var = 1 Then
			Button_Upgrade_OnClick()
		ElseIf Var = 2 Then
			Button_HotKey_OnClick()
		ElseIf Var = 3 Then
			Button_LyricPane_OnClick()
		ElseIf Var = 4 Then
			Button_DesktopLyric_OnClick()
		ElseIf Var = 5 Then
			Button_SkinColor_OnClick()
		ElseIf Var = 6 Then
			Button_DownLoad_OnClick()
		ElseIf Var = 7 Then
			Button_CacheMgr_OnClick()
		ElseIf Var = 8 Then
			Button_SoundEffect_OnClick()
		ElseIf Var = 9 Then
			Button_Other_OnClick()
		End If 
	End If
End Sub
