comparison dynamin/gui/window.d @ 68:6580fabb7dce

Setting a property to the value it already is shouldn't do anything
author Jordan Miner <jminer7@gmail.com>
date Mon, 10 Aug 2009 02:48:15 -0500
parents 419e38206522
children b5460ba7c93e
comparison
equal deleted inserted replaced
67:419e38206522 68:6580fabb7dce
395 395
396 // TODO: because you should always be able to click a window from 396 // TODO: because you should always be able to click a window from
397 // the taskbar, then show it on taskbar if window has an owner, 397 // the taskbar, then show it on taskbar if window has an owner,
398 // but don't if it does not 398 // but don't if it does not
399 void owner(Window w) { 399 void owner(Window w) {
400 if(_owner == w)
401 return;
400 _owner = w; 402 _owner = w;
401 if(!handleCreated) 403 if(!handleCreated)
402 return; 404 return;
403 recreateHandle(); 405 recreateHandle();
404 } 406 }
408 * Gets or sets whether this window is visible. The default is false. 410 * Gets or sets whether this window is visible. The default is false.
409 */ 411 */
410 bool visible() { return _visible; } 412 bool visible() { return _visible; }
411 /// ditto 413 /// ditto
412 void visible(bool b) { 414 void visible(bool b) {
415 if(_visible == b)
416 return;
413 _visible = b; 417 _visible = b;
414 backend_visible = b; 418 backend_visible = b;
415 419
416 scope e = new EventArgs; 420 scope e = new EventArgs;
417 visibleChanged(e); 421 visibleChanged(e);
448 * The default is WindowBorderStyle.Normal. 452 * The default is WindowBorderStyle.Normal.
449 */ 453 */
450 WindowBorderStyle borderStyle() { return _borderStyle; } 454 WindowBorderStyle borderStyle() { return _borderStyle; }
451 /// ditto 455 /// ditto
452 void borderStyle(WindowBorderStyle border) { 456 void borderStyle(WindowBorderStyle border) {
457 if(_borderStyle == border)
458 return;
453 if(border > WindowBorderStyle.Tool) 459 if(border > WindowBorderStyle.Tool)
454 throw new IllegalArgumentException("Window.borderStyle(): invalid border style"); 460 throw new IllegalArgumentException("Window.borderStyle(): invalid border style");
455 _borderStyle = border; 461 _borderStyle = border;
456 backend_borderStyle = border; 462 backend_borderStyle = border;
457 } 463 }
493 * The default is true. 499 * The default is true.
494 */ 500 */
495 bool resizable() { return _resizable; } 501 bool resizable() { return _resizable; }
496 /// ditto 502 /// ditto
497 void resizable(bool b) { 503 void resizable(bool b) {
504 if(_resizable == b)
505 return;
498 _resizable = b; 506 _resizable = b;
499 if(!handleCreated) 507 if(!handleCreated)
500 return; 508 return;
501 backend_resizable = b; 509 backend_resizable = b;
502 } 510 }