diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-01-12 04:21:14 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-01-12 04:21:14 +0000 |
commit | ae9550b7de777a464c30ee50733f91c2682a79a5 (patch) | |
tree | dc32c3a9b0fc5bdb508f27ed22ebf9942d0e83d1 /guilib | |
parent | 5e7705c2c39ec3893d6ea64b7471a31dfe1f462f (diff) |
changed: Default the <hitrect> for windows and dialogs to the fullscreen size, and remove unneeded HitTest() routine when the base class suffices. Fixes #8469
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26710 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/GUIControlFactory.h | 2 | ||||
-rw-r--r-- | guilib/GUIWindow.cpp | 8 | ||||
-rw-r--r-- | guilib/GUIWindow.h | 1 |
3 files changed, 3 insertions, 8 deletions
diff --git a/guilib/GUIControlFactory.h b/guilib/GUIControlFactory.h index 018b945eb7..6867e2635d 100644 --- a/guilib/GUIControlFactory.h +++ b/guilib/GUIControlFactory.h @@ -65,6 +65,7 @@ public: static bool GetMultipleString(const TiXmlNode* pRootNode, const char* strTag, std::vector<CGUIActionDescriptor>& vecStringValue); static void GetRectFromString(const CStdString &string, CRect &rect); static bool GetAction(const TiXmlElement* pElement, CGUIActionDescriptor &action); + static bool GetHitRect(const TiXmlNode* pRootNode, CRect &rect); private: bool GetNavigation(const TiXmlElement *node, const char *tag, int &direction, std::vector<CGUIActionDescriptor> &actions); bool GetCondition(const TiXmlNode *control, const char *tag, int &condition); @@ -72,6 +73,5 @@ private: bool GetString(const TiXmlNode* pRootNode, const char* strTag, CStdString& strString); bool GetFloatRange(const TiXmlNode* pRootNode, const char* strTag, float& iMinValue, float& iMaxValue, float& iIntervalValue); bool GetIntRange(const TiXmlNode* pRootNode, const char* strTag, int& iMinValue, int& iMaxValue, int& iIntervalValue); - bool GetHitRect(const TiXmlNode* pRootNode, CRect &rect); }; #endif diff --git a/guilib/GUIWindow.cpp b/guilib/GUIWindow.cpp index df643f540e..896baa0dd0 100644 --- a/guilib/GUIWindow.cpp +++ b/guilib/GUIWindow.cpp @@ -145,6 +145,7 @@ bool CGUIWindow::Load(TiXmlDocument &xmlDoc) CGUIControlFactory::GetMultipleString(pRootElement, "onload", m_loadActions); CGUIControlFactory::GetMultipleString(pRootElement, "onunload", m_unloadActions); + CGUIControlFactory::GetHitRect(pRootElement, m_hitRect); TiXmlElement *pChild = pRootElement->FirstChildElement(); while (pChild) @@ -803,6 +804,7 @@ void CGUIWindow::SetDefaults() m_origins.clear(); m_hasCamera = false; m_animationsEnabled = true; + m_hitRect.SetRect(0, 0, g_settings.m_ResInfo[m_coordsRes].iWidth, g_settings.m_ResInfo[m_coordsRes].iHeight); } CRect CGUIWindow::GetScaledBounds() const @@ -959,9 +961,3 @@ void CGUIWindow::RunUnloadActions() { RunActions(m_unloadActions); } - -bool CGUIWindow::HitTest(const CPoint &point) const -{ - CRect rect(0, 0, m_width, m_height); - return rect.PtInRect(point - GetPosition()); -} diff --git a/guilib/GUIWindow.h b/guilib/GUIWindow.h index db5b275ffb..c5bf51500b 100644 --- a/guilib/GUIWindow.h +++ b/guilib/GUIWindow.h @@ -163,7 +163,6 @@ public: protected: virtual bool OnMouseEvent(const CPoint &point, const CMouseEvent &event); - virtual bool HitTest(const CPoint &point) const; virtual bool LoadXML(const CStdString& strPath, const CStdString &strLowerPath); ///< Loads from the given file bool Load(TiXmlDocument &xmlDoc); ///< Loads from the given XML document virtual void LoadAdditionalTags(TiXmlElement *root) {}; ///< Load additional information from the XML document |