Mercurial > projects > dynamin
comparison dynamin/gui/control.d @ 51:d5823ccfddc6
Add a couple doc comments.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Tue, 04 Aug 2009 20:59:38 -0500 |
parents | a18c2fd9fe36 |
children | 6e33b00595e9 |
comparison
equal
deleted
inserted
replaced
50:a18c2fd9fe36 | 51:d5823ccfddc6 |
---|---|
376 /// ditto | 376 /// ditto |
377 bool contains(real x, real y) { | 377 bool contains(real x, real y) { |
378 return contains(Point(x, y)); | 378 return contains(Point(x, y)); |
379 } | 379 } |
380 | 380 |
381 /** | |
382 * Returns true if this control is a top-level control and false otherwise. | |
383 * Top-level controls do not have parents. Non-top-level controls can only | |
384 * be shown on the screen by adding them as children to a top-level control. | |
385 * Currently, the only top-level control is Window. | |
386 */ | |
381 bool topLevel() { return false; } | 387 bool topLevel() { return false; } |
382 // TODO: return NativeControl/Window? | 388 // TODO: return NativeControl/Window? |
389 /** | |
390 * Loops over this control's ancestors, and if a top-level control is found, | |
391 * it is returned. If this control does not have a top-level ancestor, | |
392 * null is returned. | |
393 */ | |
383 Control getTopLevel() { | 394 Control getTopLevel() { |
384 Control c = this; | 395 Control c = this; |
385 while(c.parent) | 396 while(c.parent) |
386 c = c.parent; | 397 c = c.parent; |
387 return c.topLevel ? c : null; | 398 return c.topLevel ? c : null; |