Mercurial > projects > dynamin
comparison dynamin/gui/button.d @ 63:84beb40c1665
Edit some comments.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Sat, 08 Aug 2009 20:35:48 -0500 |
parents | 60832e1eef04 |
children | 651082a9b364 |
comparison
equal
deleted
inserted
replaced
62:60832e1eef04 | 63:84beb40c1665 |
---|---|
170 /// Override this method in a subclass to handle the clicked event. | 170 /// Override this method in a subclass to handle the clicked event. |
171 protected void whenClicked(EventArgs e) { } | 171 protected void whenClicked(EventArgs e) { } |
172 /// This event occurs after the button has been clicked. | 172 /// This event occurs after the button has been clicked. |
173 Event!(whenClicked) clicked; | 173 Event!(whenClicked) clicked; |
174 | 174 |
175 /// | |
175 this() { | 176 this() { |
176 clicked.mainHandler = &whenClicked; | 177 clicked.mainHandler = &whenClicked; |
177 _focusable = true; | 178 _focusable = true; |
178 } | 179 } |
180 /// | |
179 this(string text) { | 181 this(string text) { |
180 this(); | 182 this(); |
181 this.text = text; | 183 this.text = text; |
182 } | 184 } |
183 override Size bestSize() { return Theme.current.Button_bestSize(this); } | 185 override Size bestSize() { return Theme.current.Button_bestSize(this); } |
186 /// | |
184 ButtonState state() { return _state; } | 187 ButtonState state() { return _state; } |
188 /// | |
185 void state(ButtonState s) { _state = s; repaint(); } | 189 void state(ButtonState s) { _state = s; repaint(); } |
186 /** | 190 /** |
187 * Returns true if this button should be painted as being default. | 191 * Returns true if this button should be painted as being default. |
188 * Mainly for themes. | 192 * Mainly for themes. |
189 */ | 193 */ |