Mercurial > projects > dynamin
comparison dynamin/gui/window.d @ 106:acdbb30fee7e
Port to D2.
Most of the effort was dealing with immutable and const.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 23:41:50 -0600 |
parents | 73060bc3f004 |
children |
comparison
equal
deleted
inserted
replaced
105:97997a544ac0 | 106:acdbb30fee7e |
---|---|
441 return; | 441 return; |
442 backend_setCurrentCursor(cur); | 442 backend_setCurrentCursor(cur); |
443 } | 443 } |
444 | 444 |
445 alias Control.repaint repaint; | 445 alias Control.repaint repaint; |
446 void repaint(Rect rect) { | 446 override void repaint(Rect rect) { |
447 if(!handleCreated) | 447 if(!handleCreated) |
448 return; | 448 return; |
449 backend_repaint(rect); | 449 backend_repaint(rect); |
450 } | 450 } |
451 | 451 |
483 backend_resizable = b; | 483 backend_resizable = b; |
484 } | 484 } |
485 | 485 |
486 // TODO: 1.0 MinSize -> contentMinSize MaxSize -> contentMaxSize | 486 // TODO: 1.0 MinSize -> contentMinSize MaxSize -> contentMaxSize |
487 alias Control.location location; | 487 alias Control.location location; |
488 void location(Point pt) { | 488 override void location(Point pt) { |
489 super.location(pt); | 489 super.location(pt); |
490 if(!handleCreated) | 490 if(!handleCreated) |
491 return; | 491 return; |
492 backend_location = pt; | 492 backend_location = pt; |
493 } | 493 } |
494 | 494 |
495 alias Control.size size; | 495 alias Control.size size; |
496 void size(Size size) { | 496 override void size(Size size) { |
497 super.size(size); | 497 super.size(size); |
498 _content.size = size - _borderSize; | 498 _content.size = size - _borderSize; |
499 if(!handleCreated) | 499 if(!handleCreated) |
500 return; | 500 return; |
501 backend_size = size; | 501 backend_size = size; |
502 } | 502 } |
503 | 503 |
504 alias Control.text text; | 504 alias Control.text text; |
505 void text(string str) { | 505 override void text(string str) { |
506 super.text(str); | 506 super.text(str); |
507 if(!handleCreated) | 507 if(!handleCreated) |
508 return; | 508 return; |
509 backend_text = str; | 509 backend_text = str; |
510 } | 510 } |
527 rect = c.screenLocation + c.size; | 527 rect = c.screenLocation + c.size; |
528 } else { | 528 } else { |
529 rect = desktopRect; | 529 rect = desktopRect; |
530 } | 530 } |
531 Point newLoc = Point(); | 531 Point newLoc = Point(); |
532 switch(pos) { | 532 final switch(pos) { |
533 case Position.TopLeft: | 533 case Position.TopLeft: |
534 case Position.Left: | 534 case Position.Left: |
535 case Position.BottomLeft: | 535 case Position.BottomLeft: |
536 newLoc.x = rect.x; | 536 newLoc.x = rect.x; |
537 break; | 537 break; |
544 case Position.Right: | 544 case Position.Right: |
545 case Position.BottomRight: | 545 case Position.BottomRight: |
546 newLoc.x = rect.x + rect.width - width; | 546 newLoc.x = rect.x + rect.width - width; |
547 break; | 547 break; |
548 } | 548 } |
549 switch(pos) { | 549 final switch(pos) { |
550 case Position.TopLeft: | 550 case Position.TopLeft: |
551 case Position.Top: | 551 case Position.Top: |
552 case Position.TopRight: | 552 case Position.TopRight: |
553 newLoc.y = rect.y; | 553 newLoc.y = rect.y; |
554 break; | 554 break; |