comparison dynamin/gui/control.d @ 49:62742ce025ec

Add Control.tabIndex
author Jordan Miner <jminer7@gmail.com>
date Tue, 04 Aug 2009 20:39:03 -0500
parents 41b76c218851
children a18c2fd9fe36
comparison
equal deleted inserted replaced
48:41b141453b8e 49:62742ce025ec
61 class Control { 61 class Control {
62 protected: 62 protected:
63 bool _visible; 63 bool _visible;
64 bool _focusable; 64 bool _focusable;
65 bool _focused; 65 bool _focused;
66 int _tabIndex;
66 package Point _location; 67 package Point _location;
67 package Size _size; 68 package Size _size;
68 string _text; 69 string _text;
69 Color _backColor; 70 Color _backColor;
70 Color _foreColor; 71 Color _foreColor;
232 _location = Point(0, 0); 233 _location = Point(0, 0);
233 _size = Size(100, 100); 234 _size = Size(100, 100);
234 _text = ""; 235 _text = "";
235 _focusable = false; 236 _focusable = false;
236 _focused = false; 237 _focused = false;
238 _tabIndex = 0;
237 _visible = true; 239 _visible = true;
238 _cursor = Cursor.Arrow; 240 _cursor = Cursor.Arrow;
239 _elasticX = false; 241 _elasticX = false;
240 _elasticY = false; 242 _elasticY = false;
241 243
277 /** 279 /**
278 * 280 *
279 */ 281 */
280 bool focused() { 282 bool focused() {
281 return _focused; 283 return _focused;
284 }
285
286 /**
287 * Gets or sets this control's tab index. The tab index of controls
288 * decides in what order they are focused when the tab key is pressed.
289 * If multiple controls in a window have the same tab index, focus is
290 * changed based on the order they were added to the window.
291 * The default is 0.
292 */
293 int tabIndex() {
294 return _tabIndex;
295 }
296 /// ditto
297 void tabIndex(int i) {
298 _tabIndex = i;
282 } 299 }
283 300
284 /** 301 /**
285 * 302 *
286 */ 303 */