# HG changeset patch # User Jordan Miner # Date 1249890495 18000 # Node ID 6580fabb7dce8c1ab639d7d23555a76ff6bb0660 # Parent 419e382065224b1f9f6de25035fbb5b79bc98db8 Setting a property to the value it already is shouldn't do anything diff -r 419e38206522 -r 6580fabb7dce dynamin/gui/check_box.d --- a/dynamin/gui/check_box.d Mon Aug 10 02:46:42 2009 -0500 +++ b/dynamin/gui/check_box.d Mon Aug 10 02:48:15 2009 -0500 @@ -76,7 +76,10 @@ } /// ditto void checked(bool b) { + auto old = _checkState; _checkState = b ? CheckState.Checked : CheckState.Unchecked; + if(_checkState == old) + return; repaint(); checkedChanged(new EventArgs); } diff -r 419e38206522 -r 6580fabb7dce dynamin/gui/container.d --- a/dynamin/gui/container.d Mon Aug 10 02:46:42 2009 -0500 +++ b/dynamin/gui/container.d Mon Aug 10 02:48:15 2009 -0500 @@ -315,6 +315,8 @@ Size minSize() { return _minSize; } /// ditto void minSize(Size size) { + if(_minSize == size) + return; _minSize = size; minSizeChanged(new EventArgs); } @@ -336,6 +338,8 @@ Size maxSize() { return _maxSize; } /// ditto void maxSize(Size size) { + if(_maxSize == size) + return; _maxSize = size; minSizeChanged(new EventArgs); } diff -r 419e38206522 -r 6580fabb7dce dynamin/gui/control.d --- a/dynamin/gui/control.d Mon Aug 10 02:46:42 2009 -0500 +++ b/dynamin/gui/control.d Mon Aug 10 02:48:15 2009 -0500 @@ -495,6 +495,8 @@ throw new Exception("cannot set location of a window's content"); pt.x = round(pt.x); pt.y = round(pt.y); + if(_location == pt) + return; repaint(); _location = pt; repaint(); @@ -523,6 +525,8 @@ newSize.height = 0; newSize.width = round(newSize.width); newSize.height = round(newSize.height); + if(_size == newSize) + return; repaint(); _size = newSize; repaint(); @@ -578,6 +582,8 @@ string text() { return _text.dup; } /// ditto void text(string str) { + if(_text == str) + return; _text = str.dup; repaint(); //TextChanged(EventArgs e) // TODO: add event @@ -589,6 +595,8 @@ Color backColor() { return _backColor; } /// ditto void backColor(Color c) { + if(_backColor == c) + return; _backColor = c; repaint(); } @@ -599,6 +607,8 @@ Color foreColor() { return _foreColor; } /// ditto void foreColor(Color c) { + if(_foreColor == c) + return; _foreColor = c; repaint(); } @@ -617,6 +627,8 @@ } /// ditto void font(Font f) { + if(_font is f) + return; _font = f; repaint(); } diff -r 419e38206522 -r 6580fabb7dce dynamin/gui/notebook.d --- a/dynamin/gui/notebook.d Mon Aug 10 02:46:42 2009 -0500 +++ b/dynamin/gui/notebook.d Mon Aug 10 02:48:15 2009 -0500 @@ -151,6 +151,8 @@ int selectedIndex() { return _selectedIndex; } /// ditto void selectedIndex(int index) { + if(_selectedIndex == index) + return; if(index < -1) throw new IllegalArgumentException("index cannot be less than -1"); _selectedIndex = index; diff -r 419e38206522 -r 6580fabb7dce dynamin/gui/window.d --- a/dynamin/gui/window.d Mon Aug 10 02:46:42 2009 -0500 +++ b/dynamin/gui/window.d Mon Aug 10 02:48:15 2009 -0500 @@ -397,6 +397,8 @@ // the taskbar, then show it on taskbar if window has an owner, // but don't if it does not void owner(Window w) { + if(_owner == w) + return; _owner = w; if(!handleCreated) return; @@ -410,6 +412,8 @@ bool visible() { return _visible; } /// ditto void visible(bool b) { + if(_visible == b) + return; _visible = b; backend_visible = b; @@ -450,6 +454,8 @@ WindowBorderStyle borderStyle() { return _borderStyle; } /// ditto void borderStyle(WindowBorderStyle border) { + if(_borderStyle == border) + return; if(border > WindowBorderStyle.Tool) throw new IllegalArgumentException("Window.borderStyle(): invalid border style"); _borderStyle = border; @@ -495,6 +501,8 @@ bool resizable() { return _resizable; } /// ditto void resizable(bool b) { + if(_resizable == b) + return; _resizable = b; if(!handleCreated) return;