comparison dynamin/gui/window.d @ 74:7adc733aca2d

Change Window.quickCreateGraphics() to create the handle if not already created.
author Jordan Miner <jminer7@gmail.com>
date Wed, 12 Aug 2009 05:16:30 -0500
parents 68be24186634
children 651082a9b364
comparison
equal deleted inserted replaced
73:68be24186634 74:7adc733aca2d
361 /// 361 ///
362 void recreateHandle() { 362 void recreateHandle() {
363 backend_recreateHandle(); 363 backend_recreateHandle();
364 } 364 }
365 365
366 // should create the handle if it hasn't been yet
366 override protected Graphics quickCreateGraphics() { 367 override protected Graphics quickCreateGraphics() {
367 if(!handleCreated)
368 return null;
369 return backend_quickCreateGraphics(); 368 return backend_quickCreateGraphics();
370 } 369 }
371 override bool onScreen() { 370 override bool onScreen() {
372 return true; 371 return true;
373 } 372 }
584 } 583 }
585 584
586 unittest { 585 unittest {
587 auto w = new Window; 586 auto w = new Window;
588 assert(!w.handleCreated); 587 assert(!w.handleCreated);
589 w.content = new Panel;
590 assert(!w.handleCreated);
591 w.location = Point(5, 5); 588 w.location = Point(5, 5);
592 assert(!w.handleCreated); 589 assert(!w.handleCreated);
593 w.size = Size(100, 100); 590 w.size = Size(100, 100);
594 assert(!w.handleCreated); 591 assert(!w.handleCreated);
595 w.position = Position.Right; 592 w.position = Position.Right;