BOOL CXTPColorHex::PreTranslateMessage(MSG* pMsg)
{
	switch (pMsg->message)
	{
	case WM_KEYDOWN:
		{
			if (m_pCell)
			{
				TCHAR vkey = (TCHAR)pMsg->wParam;
				switch (vkey)
				{
				case VK_LEFT:
				case VK_RIGHT:
					{
						POSITION pos = m_rgnList.Find(m_pCell);
						if (pos)
						{
							if (vkey == VK_LEFT)
							{
								m_rgnList.GetPrev(pos);
							}
							else
							{
								m_rgnList.GetNext(pos);
							}

							if (pos)
							{
								UpdateSelection(m_rgnList.GetAt(pos));
							}
						}
						return TRUE;
					}

				case VK_UP:
				case VK_DOWN:
					{
						SetSelectedColor(m_pCell->m_iCell[(vkey == VK_UP) ? 0 : 1]);
						return TRUE;
					}
				}
			}
		}
		break;
	}

	return CStatic::PreTranslateMessage(pMsg);
}
void Button_Panel::ApplySchemeSettings(vgui::IScheme* Scheme)
{
	BaseClass::ApplySchemeSettings(Scheme);

	SetDefaultColor(Color(0, 0, 0, 0), Color(0, 0, 0, 0));
	SetArmedColor(Color(0, 0, 0, 0), Color(0, 0, 0, 0));
	SetSelectedColor(Color(0, 0, 0, 0), Color(0, 0, 0, 0));
	SetDepressedColor(Color(0, 0, 0, 0), Color(0, 0, 0, 0));
	SetBlinkColor(Color(0, 0, 0, 0));
	SetArmedSound("interface/ui/button_over.wav");
	SetDepressedSound("interface/ui/button_click.wav");
	SetReleasedSound("interface/ui/button_release.wav");

	Width = WidthOut = atof(Scheme->GetResourceString("Panel.Button.Width.Out"));
	WidthOver = atof(Scheme->GetResourceString("Panel.Button.Width.Over"));
	WidthPressed = atof(Scheme->GetResourceString("Panel.Button.Width.Pressed"));
	WidthReleased = atof(Scheme->GetResourceString("Panel.Button.Width.Released"));

	Height = HeightOut = atof(Scheme->GetResourceString("Panel.Button.Height.Out"));
	HeightOver = atof(Scheme->GetResourceString("Panel.Button.Height.Over"));
	HeightPressed = atof(Scheme->GetResourceString("Panel.Button.Height.Pressed"));
	HeightReleased = atof(Scheme->GetResourceString("Panel.Button.Height.Released"));

	TextOffsetX = atof(Scheme->GetResourceString("Panel.Button.Text.OffsetX"));
	TextOffsetY = atof(Scheme->GetResourceString("Panel.Button.Text.OffsetY"));

	DescriptionOffsetX = atof(Scheme->GetResourceString("Panel.Button.Description.OffsetX"));
	DescriptionOffsetY = atof(Scheme->GetResourceString("Panel.Button.Description.OffsetY"));

	bDescriptionHideOut = atoi(Scheme->GetResourceString("Panel.Button.Description.Hide.Out"));
	bDescriptionHideOver = atoi(Scheme->GetResourceString("Panel.Button.Description.Hide.Over"));
	bDescriptionHidePressed = atoi(Scheme->GetResourceString("Panel.Button.Description.Hide.Pressed"));
	bDescriptionHideReleased = atoi(Scheme->GetResourceString("Panel.Button.Description.Hide.Released"));

	AnimationWidth = atof(Scheme->GetResourceString("Panel.Button.Animation.Width"));
	AnimationHeight = atof(Scheme->GetResourceString("Panel.Button.Animation.Height"));
	AnimationBackground = atof(Scheme->GetResourceString("Panel.Button.Animation.Background"));
	AnimationText = atof(Scheme->GetResourceString("Panel.Button.Animation.Text"));
	AnimationDescription = atof(Scheme->GetResourceString("Panel.Button.Animation.Description"));

	BackgroundColor = BackgroundColorOut = GetSchemeColor("Panel.Button.Background.Out", Scheme);
	BackgroundColorOver = GetSchemeColor("Panel.Button.Background.Over", Scheme);
	BackgroundColorPressed = GetSchemeColor("Panel.Button.Background.Pressed", Scheme);
	BackgroundColorReleased = GetSchemeColor("Panel.Button.Background.Released", Scheme);

	BackgroundOutlineColor = BackgroundOutlineColorOut = GetSchemeColor("Panel.Button.Background.Outline.Out", Scheme);
	BackgroundOutlineColorOver = GetSchemeColor("Panel.Button.Background.Outline.Over", Scheme);
	BackgroundOutlineColorPressed = GetSchemeColor("Panel.Button.Background.Outline.Pressed", Scheme);
	BackgroundOutlineColorReleased = GetSchemeColor("Panel.Button.Background.Outline.Released", Scheme);

	TextColor = TextColorOut = GetSchemeColor("Panel.Button.Text.Out", Scheme);
	TextColorOver = GetSchemeColor("Panel.Button.Text.Over", Scheme);
	TextColorPressed = GetSchemeColor("Panel.Button.Text.Pressed", Scheme);
	TextColorReleased = GetSchemeColor("Panel.Button.Text.Released", Scheme);

	DescriptionColor = DescriptionColorOut = GetSchemeColor("Panel.Button.Description.Out", Scheme);
	DescriptionColorOver = GetSchemeColor("Panel.Button.Description.Over", Scheme);
	DescriptionColorPressed = GetSchemeColor("Panel.Button.Description.Pressed", Scheme);
	DescriptionColorReleased = GetSchemeColor("Panel.Button.Description.Released", Scheme);

	BackgroundBlurAlpha = Color(0, 0, 0, 0);
	bBackgroundBlurOut = atoi(Scheme->GetResourceString("Panel.Button.Background.Blur.Out"));
	bBackgroundBlurOver = atoi(Scheme->GetResourceString("Panel.Button.Background.Blur.Over"));
	bBackgroundBlurPressed = atoi(Scheme->GetResourceString("Panel.Button.Background.Blur.Pressed"));
	bBackgroundBlurReleased = atoi(Scheme->GetResourceString("Panel.Button.Background.Blur.Released"));

	TextFont = Scheme->GetFont("Panel.Button.Text.Font");
	DescriptionFont = Scheme->GetFont("Panel.Button.Description.Font");

	PreviousState = State;
}