Changeset 51 for trunk/luigi/gui.d
- Timestamp:
- 04/28/07 17:09:55 (2 years ago)
- Files:
-
- trunk/luigi/gui.d (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/luigi/gui.d
r50 r51 267 267 template WidgetMixin() 268 268 { 269 alias typeof(this) T; 270 static assert(is(T:Widget), "WidgetMixin should be derived from Widget"); 269 alias typeof(this) WidgetType; 270 static assert(is(WidgetType:luigi.gui.Widget), 271 "WidgetMixin should be derived from Widget"); 271 272 272 273 /** … … 284 285 Returns: A pointer to 'this', with the proper derived type. 285 286 */ 286 Tarranged_(VArg...)(VArg varg)287 WidgetType arranged_(VArg...)(VArg varg) 287 288 { 288 289 //static assert(is(T:Widget), "arranger_add requires a Widget as argument 0"); … … 296 297 template PanelMixin() 297 298 { 298 alias typeof(this) T; 299 static assert(is(T:Panel), "PanelMixin should be derived from Panel"); 299 alias typeof(this) PanelType; 300 static assert(is(PanelType:luigi.gui.Panel), 301 "PanelMixin should be derived from Panel"); 300 302 301 303 /** Add the widget to this panel. … … 312 314 W add_widget(W)(W widget) 313 315 { 314 static assert(is(W: Widget), "add_widget requires a Widget as argument");316 static assert(is(W:luigi.gui.Widget), "add_widget requires a Widget as argument"); 315 317 add(widget); 316 318 return widget; … … 331 333 W add_arranged(W, Varg...)(W widget, Varg args) 332 334 { 333 static assert(is(W:Widget), "add_arranged requires a Widget as argument"); 335 static assert(is(W:luigi.gui.Widget), 336 "add_arranged requires a Widget as argument"); 334 337 add(widget); 335 338 assert(arranger, "add_arranged called with no arranger set"); … … 345 348 { 346 349 mixin WidgetMixin; 350 351 // Some handy aliases everyone should have 352 // This makes it so you can refer to these inside a Widget subclass 353 // without worry 354 alias luigi.base.Size Size; 355 alias luigi.base.Rect Rect; 356 alias luigi.base.Point Point; 357 347 358 348 359 this() {} … … 1970 1981 1971 1982 int checked_item(int v) { 1972 writefln("checked item(%d), cur = %d", v, m_checkedItem);1973 1983 if (v == m_checkedItem) { return m_checkedItem; } 1974 1984 m_checkedItem = v;
