From 598334a71e5303b1518df3568b5c2eebab6efbbb Mon Sep 17 00:00:00 2001 From: Frank Zago Date: Thu, 22 Oct 2009 03:12:01 +0000 Subject: [PATCH] Hide the mouse cursor while displaying a popup window. --- client/GUIClasses.cpp | 8 ++++++++ client/GUIClasses.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 7b897bcd9..4c5b4137c 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -715,6 +715,8 @@ void CRClickPopup::close() CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free) :free(Free),bitmap(Bitmap) { + CGI->curh->hide(); + pos.x = x; pos.y = y; pos.h = bitmap->h; @@ -729,6 +731,8 @@ CInfoPopup::CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free) CInfoPopup::CInfoPopup(SDL_Surface *Bitmap, bool Free) { + CGI->curh->hide(); + free=Free; bitmap=Bitmap; @@ -751,6 +755,10 @@ void CInfoPopup::show(SDL_Surface * to) { blitAt(bitmap,pos.x,pos.y,to); } +CInfoPopup::~CInfoPopup() +{ + CGI->curh->show(); +} void SComponent::init(Etype Type, int Subtype, int Val) { diff --git a/client/GUIClasses.h b/client/GUIClasses.h index 38bac3c9e..1ebb92f82 100644 --- a/client/GUIClasses.h +++ b/client/GUIClasses.h @@ -118,7 +118,7 @@ public: void show(SDL_Surface * to); CInfoPopup(SDL_Surface * Bitmap, int x, int y, bool Free=false); //c-tor CInfoPopup(SDL_Surface *Bitmap = NULL, bool Free = false); //default c-tor - ~CInfoPopup(){}; //d-tor + ~CInfoPopup(); //d-tor }; class SComponent : public virtual CIntObject //common popup window component