Esempio n. 1
0
void StripMenuButton::updateMouse()
{
	wxRect panelRec = GetScreenRect(); 
	panelRec.x += 2;
	panelRec.y += 2;
	panelRec.width -= 4;
	panelRec.height -= 4;

	wxPoint mousePoint = wxGetMousePosition();

	bool t1 = panelRec.x <= mousePoint.x;
	bool t2 = panelRec.y <= mousePoint.y;
	bool t3 = (panelRec.x + panelRec.width ) >= mousePoint.x;
	bool t4 = (panelRec.y + panelRec.height) >= mousePoint.y;

	if (t1 && t2 && t3 && t4)
	{
		if (!m_bHovering)
		{
			SetForegroundColour( m_colHover );
			m_bHovering = true;
			invalidatePaint();
			this->Refresh();
		}
	}
	else if (m_bHovering)
	{
		SetForegroundColour( m_colNormal );
		m_bHovering = false;
		invalidatePaint();
		this->Refresh();
	}
}
Esempio n. 2
0
void gcImageControl::setPropotional(uint32 x, uint32 y)
{
	m_uiXPro = x;
	m_uiYPro = y;

	invalidatePaint();
}
Esempio n. 3
0
void gcImageControl::setImage(const char* image)
{
	wxRegion r;
	SetShape(r, this);
	m_imgHandle = GetGCThemeManager()->getImageHandle(image);
	invalidatePaint();
}
Esempio n. 4
0
void StripMenuButton::onFocus(wxFocusEvent& event)
{
	if (m_bHasFocus)
		return;

	m_bHasFocus = true;
	invalidatePaint();
}
Esempio n. 5
0
void StripMenuButton::onBlur(wxFocusEvent& event)
{
	if (!m_bHasFocus)
		return;

	m_bHasFocus = false;
	invalidatePaint();
}
Esempio n. 6
0
	void onActiveToggle(bool state)
	{
		if (state)
		{
			m_colNormal = wxColor(GetGCThemeManager()->getColor("itemToolBar", "fg"));
			m_szImage = "#playlist_button_normal";
		}
		else
		{
			m_colNormal = wxColor(GetGCThemeManager()->getColor("itemToolBar", "na-fg"));
			m_szImage = "#playlist_button_nonactive";
		}

		refreshImage(true);
		invalidatePaint();
	}
Esempio n. 7
0
	void onActiveToggle(bool state)
	{
		m_imgHandle = GetGCThemeManager()->getImageHandle(state?"#menu_bg":"#menu_bg_nonactive");
		invalidatePaint();
	}
Esempio n. 8
0
void StripMenuButton::onSelected()
{
	invalidatePaint();
	Refresh();
}