Mercurial > fife-parpg
comparison engine/core/gui/widgets/clicklabel.cpp @ 157:bb9902910067
input_rework merged!
Bad features:
* Broken DND for zero-projekt.
* Design short-comings.
author | phoku@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Tue, 14 Oct 2008 07:41:48 +0000 |
parents | d29593182f40 |
children | 756b895e1dab |
comparison
equal
deleted
inserted
replaced
156:376b8afc9a18 | 157:bb9902910067 |
---|---|
38 ClickLabel::ClickLabel() { | 38 ClickLabel::ClickLabel() { |
39 mGuiFont = static_cast<FIFE::GuiFont*> (getFont()); | 39 mGuiFont = static_cast<FIFE::GuiFont*> (getFont()); |
40 // setAlignment(Graphics::LEFT); | 40 // setAlignment(Graphics::LEFT); |
41 setTextWrapping(false); | 41 setTextWrapping(false); |
42 setFrameSize(0); | 42 setFrameSize(0); |
43 m_listener = NULL; | |
44 addMouseListener(this); | 43 addMouseListener(this); |
45 addKeyListener(this); | 44 addKeyListener(this); |
46 addFocusListener(this); | 45 addFocusListener(this); |
47 | 46 |
48 } | 47 } |
51 mGuiFont = static_cast<FIFE::GuiFont*> (getFont()); | 50 mGuiFont = static_cast<FIFE::GuiFont*> (getFont()); |
52 // setAlignment(Graphics::LEFT); | 51 // setAlignment(Graphics::LEFT); |
53 setTextWrapping(false); | 52 setTextWrapping(false); |
54 setCaption(caption); | 53 setCaption(caption); |
55 setFrameSize(0); | 54 setFrameSize(0); |
56 m_listener = NULL; | |
57 addMouseListener(this); | 55 addMouseListener(this); |
58 addKeyListener(this); | 56 addKeyListener(this); |
59 addFocusListener(this); | 57 addFocusListener(this); |
60 | 58 |
61 wrapText(); | 59 wrapText(); |
139 } | 137 } |
140 } | 138 } |
141 | 139 |
142 void ClickLabel::mouseExited(MouseEvent& mouseEvent) | 140 void ClickLabel::mouseExited(MouseEvent& mouseEvent) |
143 { | 141 { |
144 // taken from TwoButton.cpp | |
145 if (m_listener) { | |
146 m_listener->mouseExited(*this); | |
147 } | |
148 mHasMouse = false; | 142 mHasMouse = false; |
149 } | 143 } |
150 | 144 |
151 void ClickLabel::mouseEntered(MouseEvent& mouseEvent) | 145 void ClickLabel::mouseEntered(MouseEvent& mouseEvent) |
152 { | 146 { |
153 // taken from TwoButton.cpp | |
154 if (m_listener) { | |
155 m_listener->mouseEntered(*this); | |
156 } | |
157 mHasMouse = true; | 147 mHasMouse = true; |
158 } | 148 } |
159 | 149 |
160 void ClickLabel::mouseReleased(MouseEvent& mouseEvent) | 150 void ClickLabel::mouseReleased(MouseEvent& mouseEvent) |
161 { | 151 { |