Mercurial > fife-parpg
diff engine/core/gui/widgets/clicklabel.cpp @ 154:d29593182f40
- modified clicklabel to provide a mouse listener for hover events
- modified clicklabel.i to make new methods available for python
- added LabelListener to pychan wrapper, as well as two new methods to Label class to set enter / exit callbacks
NOTE:
author | chewie@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Sat, 11 Oct 2008 14:13:56 +0000 |
parents | 90005975cdbb |
children | bb9902910067 |
line wrap: on
line diff
--- a/engine/core/gui/widgets/clicklabel.cpp Sat Oct 11 14:03:01 2008 +0000 +++ b/engine/core/gui/widgets/clicklabel.cpp Sat Oct 11 14:13:56 2008 +0000 @@ -40,7 +40,7 @@ // setAlignment(Graphics::LEFT); setTextWrapping(false); setFrameSize(0); - + m_listener = NULL; addMouseListener(this); addKeyListener(this); addFocusListener(this); @@ -53,7 +53,7 @@ setTextWrapping(false); setCaption(caption); setFrameSize(0); - + m_listener = NULL; addMouseListener(this); addKeyListener(this); addFocusListener(this); @@ -141,11 +141,19 @@ void ClickLabel::mouseExited(MouseEvent& mouseEvent) { + // taken from TwoButton.cpp + if (m_listener) { + m_listener->mouseExited(*this); + } mHasMouse = false; } void ClickLabel::mouseEntered(MouseEvent& mouseEvent) { + // taken from TwoButton.cpp + if (m_listener) { + m_listener->mouseEntered(*this); + } mHasMouse = true; }