Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed: GUIButtonControl and GUIToggleButtonControl send their click…

… message before executing a action or a hyperlink

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk/XBMC@2951 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information...
commit 27376d5001d460b5244c6d2da87f3d2eb1c84b6c 1 parent 8fded0a
bobbin007 authored
View
1  Changelog.txt
@@ -5,6 +5,7 @@
*************************************************************************************************************
added/fixed: (dd-mm-yyyy) (please specify date in CET)
+ - 02-03-2005 changed: GUIButtonControl and GUIToggleButtonControl send their click message before executing a action or a hyperlink
- 02-03-2005 fixed: screensaver preview sometimes crashes
- 02-03-2005 fixed: screensaver preview button is enabled when screensaver is off
- 02-03-2005 changed: folders and files from smb will be sorted by modification date now
View
26 guilib/GUIButtonControl.cpp
@@ -128,28 +128,34 @@ void CGUIButtonControl::OnAction(const CAction &action)
CGUIControl::OnAction(action);
if (action.wID == ACTION_SELECT_ITEM)
{
- if (m_strExecuteAction.length() > 0)
+ // Save values, SEND_CLICK_MESSAGE may deactivate the window
+ long lHyperLinkWindowID=m_lHyperLinkWindowID;
+ CStdString strExecuteAction=m_strExecuteAction;
+
+ // button selected, send a message
+ SEND_CLICK_MESSAGE(GetID(), GetParentID(), 0);
+
+ if (strExecuteAction.length() > 0)
{
CGUIMessage message(GUI_MSG_EXECUTE, GetID(), GetParentID());
- message.SetStringParam(m_strExecuteAction);
+ message.SetStringParam(strExecuteAction);
g_graphicsContext.SendMessage(message);
+ return;
}
- if (m_lHyperLinkWindowID != WINDOW_INVALID)
+ if (lHyperLinkWindowID != WINDOW_INVALID)
{
- CGUIWindow *pWindow = m_gWindowManager.GetWindow(m_lHyperLinkWindowID);
+ CGUIWindow *pWindow = m_gWindowManager.GetWindow(lHyperLinkWindowID);
if (pWindow && pWindow->IsDialog())
{
CGUIDialog *pDialog = (CGUIDialog *)pWindow;
- pDialog->DoModal(GetParentID());
+ pDialog->DoModal(m_gWindowManager.GetActiveWindow());
}
- else {
- m_gWindowManager.ActivateWindow(m_lHyperLinkWindowID);
+ else
+ {
+ m_gWindowManager.ActivateWindow(lHyperLinkWindowID);
}
}
-
- // button selected, send a message
- SEND_CLICK_MESSAGE(GetID(), GetParentID(), 0);
}
}
View
28 guilib/GUIToggleButtonControl.cpp
@@ -2,6 +2,7 @@
#include "GUIToggleButtonControl.h"
#include "guifontmanager.h"
#include "guiWindowManager.h"
+#include "guiDialog.h"
#include "../xbmc/utils/CharsetConverter.h"
CGUIToggleButtonControl::CGUIToggleButtonControl(DWORD dwParentID, DWORD dwControlId, int iPosX, int iPosY, DWORD dwWidth, DWORD dwHeight, const CStdString& strTextureFocus,const CStdString& strTextureNoFocus, const CStdString& strAltTextureFocus,const CStdString& strAltTextureNoFocus)
@@ -80,17 +81,28 @@ void CGUIToggleButtonControl::OnAction(const CAction &action)
{
CGUIControl::OnAction(action);
if (action.wID == ACTION_SELECT_ITEM)
- {
+ {
m_bSelected=!m_bSelected;
- if (m_lHyperLinkWindowID != WINDOW_INVALID)
+ // Save value, SEND_CLICK_MESSAGE may deactivate the window
+ long lHyperLinkWindowID=m_lHyperLinkWindowID;
+
+ // button selected, send a message
+ SEND_CLICK_MESSAGE(GetID(), GetParentID(), 0);
+
+ if (lHyperLinkWindowID != WINDOW_INVALID)
{
- m_gWindowManager.ActivateWindow(m_lHyperLinkWindowID);
- return;
+ CGUIWindow *pWindow = m_gWindowManager.GetWindow(lHyperLinkWindowID);
+ if (pWindow && pWindow->IsDialog())
+ {
+ CGUIDialog *pDialog = (CGUIDialog *)pWindow;
+ pDialog->DoModal(m_gWindowManager.GetActiveWindow());
+ }
+ else
+ {
+ m_gWindowManager.ActivateWindow(lHyperLinkWindowID);
+ }
}
- // button selected.
- // send a message
- SEND_CLICK_MESSAGE(GetID(), GetParentID(), 0);
- }
+ }
}
bool CGUIToggleButtonControl::OnMessage(CGUIMessage& message)
Please sign in to comment.
Something went wrong with that request. Please try again.