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(); } }
void gcImageControl::setPropotional(uint32 x, uint32 y) { m_uiXPro = x; m_uiYPro = y; invalidatePaint(); }
void gcImageControl::setImage(const char* image) { wxRegion r; SetShape(r, this); m_imgHandle = GetGCThemeManager()->getImageHandle(image); invalidatePaint(); }
void StripMenuButton::onFocus(wxFocusEvent& event) { if (m_bHasFocus) return; m_bHasFocus = true; invalidatePaint(); }
void StripMenuButton::onBlur(wxFocusEvent& event) { if (!m_bHasFocus) return; m_bHasFocus = false; invalidatePaint(); }
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(); }
void onActiveToggle(bool state) { m_imgHandle = GetGCThemeManager()->getImageHandle(state?"#menu_bg":"#menu_bg_nonactive"); invalidatePaint(); }
void StripMenuButton::onSelected() { invalidatePaint(); Refresh(); }