comparison dynamin/gui/window.d @ 35:ee9a564d2814

Allow more use of Containers versus Panels.
author Jordan Miner <jminer7@gmail.com>
date Mon, 27 Jul 2009 01:35:35 -0500
parents d55b5b998412
children ad551ec36b75
comparison
equal deleted inserted replaced
34:e4d290aaa7ed 35:ee9a564d2814
152 mixin WindowBackend; 152 mixin WindowBackend;
153 BorderSize _borderSize; 153 BorderSize _borderSize;
154 Window _owner; 154 Window _owner;
155 WindowBorderStyle _borderStyle; 155 WindowBorderStyle _borderStyle;
156 bool _resizable = true; 156 bool _resizable = true;
157 Panel _content; 157 Container _content;
158 Control _focusedControl; 158 Control _focusedControl;
159 package Control focusedControl() { return _focusedControl; } 159 package Control focusedControl() { return _focusedControl; }
160 package void focusedControl(Control c) { 160 package void focusedControl(Control c) {
161 _focusedControl = c; 161 _focusedControl = c;
162 } 162 }
178 this(string text) { 178 this(string text) {
179 this(); 179 this();
180 this.text = text; 180 this.text = text;
181 } 181 }
182 182
183 void content(Panel panel) { 183 void content(Container panel) {
184 if(panel is null) 184 if(panel is null)
185 throw new IllegalArgumentException("content must not be null"); 185 throw new IllegalArgumentException("content must not be null");
186 // TODO: remove handlers 186 // TODO: remove handlers
187 super.remove(panel); 187 super.remove(panel);
188 super.add(_content = panel); 188 super.add(_content = panel);
222 _content._location = Point(_borderSize.left, _borderSize.top); 222 _content._location = Point(_borderSize.left, _borderSize.top);
223 ignoreResize = true; 223 ignoreResize = true;
224 _content.size = _size-_borderSize; 224 _content.size = _size-_borderSize;
225 ignoreResize = false; 225 ignoreResize = false;
226 } 226 }
227 Panel content() { 227 Container content() {
228 return _content; 228 return _content;
229 } 229 }
230 230
231 /** 231 /**
232 * If the handle has not yet been created, calling this will cause it to be. 232 * If the handle has not yet been created, calling this will cause it to be.