Maelstrom: The button code now relies on the panel being shown to dispatch actions.

https://github.com/libsdl-org/Maelstrom/commit/8b4f76da83b34c0bc70a886e8b33a07379d29b02

From 8b4f76da83b34c0bc70a886e8b33a07379d29b02 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 23 Nov 2012 10:56:10 -0800
Subject: [PATCH] The button code now relies on the panel being shown to
 dispatch actions.

---
 screenlib/UIDialogButton.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/screenlib/UIDialogButton.cpp b/screenlib/UIDialogButton.cpp
index 71b65f2e..c05431dc 100644
--- a/screenlib/UIDialogButton.cpp
+++ b/screenlib/UIDialogButton.cpp
@@ -69,10 +69,9 @@ UIDialogButton::OnClick()
 		static_cast<UIDialog*>(panel)->SetDialogStatus(m_statusID);
 	}
 
-	// Hide before doing the action (which may change the current panel)
+	UIElementButton::OnClick();
+
 	if (m_closeDialog && panel) {
 		GetUI()->HidePanel(panel);
 	}
-
-	UIElementButton::OnClick();
 }