[gbrainy] Disable mouse events on pause
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbrainy] Disable mouse events on pause
- Date: Fri, 23 Jul 2010 16:54:16 +0000 (UTC)
commit 71f21c793a83663395d327607810a72ee55f3ea6
Author: Jordi Mas <jmas softcatala org>
Date: Fri Jul 23 18:55:39 2010 +0200
Disable mouse events on pause
src/Core/Main/Game.cs | 4 ++--
src/Core/Main/GameSession.cs | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/Core/Main/Game.cs b/src/Core/Main/Game.cs
index eb82edc..e5ab5c0 100644
--- a/src/Core/Main/Game.cs
+++ b/src/Core/Main/Game.cs
@@ -457,11 +457,11 @@ namespace gbrainy.Core.Main
return str;
}
- public void DisableMouseEvents ()
+ public void EnableMouseEvents (bool enable)
{
foreach (Toolkit.Container container in containers)
foreach (Widget widget in container.Children)
- widget.Sensitive = false;
+ widget.Sensitive = enable;
}
public void MouseEvent (object obj, MouseEventArgs args)
diff --git a/src/Core/Main/GameSession.cs b/src/Core/Main/GameSession.cs
index a73fe3b..9557f70 100644
--- a/src/Core/Main/GameSession.cs
+++ b/src/Core/Main/GameSession.cs
@@ -144,7 +144,7 @@ namespace gbrainy.Core.Main
controler.Status = value;
if (status == SessionStatus.Answered && CurrentGame != null)
- CurrentGame.DisableMouseEvents ();
+ CurrentGame.EnableMouseEvents (false);
}
}
@@ -260,12 +260,14 @@ namespace gbrainy.Core.Main
EnableTimer = false;
paused = true;
current_time = Catalog.GetString ("Paused");
+ CurrentGame.EnableMouseEvents (false);
}
public void Resume ()
{
EnableTimer = true;
paused = false;
+ CurrentGame.EnableMouseEvents (true);
}
public bool ScoreGame (string answer)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]