diff options
Diffstat (limited to 'engines/titanic/gfx')
-rw-r--r-- | engines/titanic/gfx/st_button.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/gfx/st_button.h | 12 |
2 files changed, 14 insertions, 10 deletions
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp index 387800430f..154122ed60 100644 --- a/engines/titanic/gfx/st_button.cpp +++ b/engines/titanic/gfx/st_button.cpp @@ -24,6 +24,12 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CSTButton, CBackground) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseButtonUpMsg) + ON_MESSAGE(EnterViewMsg) +END_MESSAGE_MAP() + CSTButton::CSTButton() : CBackground() { _statusInc = 0; _statusTarget = "NULL"; @@ -60,14 +66,14 @@ void CSTButton::load(SimpleFile *file) { CBackground::load(file); } -bool CSTButton::handleMessage(CMouseButtonDownMsg &msg) { +bool CSTButton::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { changeStatus(0); // TODO: Obj6c stuff return true; } -bool CSTButton::handleMessage(CMouseButtonUpMsg &msg) { +bool CSTButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { int oldStatus = _currentStatus; int newStatus = _currentStatus + _statusInc; @@ -82,7 +88,7 @@ bool CSTButton::handleMessage(CMouseButtonUpMsg &msg) { return true; } -bool CSTButton::handleMessage(CEnterViewMsg &msg) { +bool CSTButton::EnterViewMsg(CEnterViewMsg *msg) { loadFrame(_buttonFrame); return true; } diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h index d613ad0eea..fd2b0fa401 100644 --- a/engines/titanic/gfx/st_button.h +++ b/engines/titanic/gfx/st_button.h @@ -29,10 +29,8 @@ namespace Titanic { -class CSTButton : public CBackground, - public CMouseButtonDownMsgTarget, - public CMouseButtonUpMsgTarget, - public CEnterViewMsgTarget { +class CSTButton : public CBackground { + DECLARE_MESSAGE_MAP private: int _statusInc; CString _statusTarget; @@ -42,9 +40,9 @@ private: CString _string5; int _buttonFrame; protected: - virtual bool handleMessage(CMouseButtonDownMsg &msg); - virtual bool handleMessage(CMouseButtonUpMsg &msg); - virtual bool handleMessage(CEnterViewMsg &msg); + virtual bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); + virtual bool MouseButtonUpMsg(CMouseButtonUpMsg *msg); + virtual bool EnterViewMsg(CEnterViewMsg *msg); public: CLASSDEF CSTButton(); |