Mercurial > projects > dynamin
comparison dynamin/gui/list_box.d @ 83:3cfc83a99cbc
Add List.opIndexAssign and switch to one callback for change notification.
Also, update controls to work with the new API.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Sun, 18 Jul 2010 22:20:50 -0500 |
parents | 651082a9b364 |
children | 73060bc3f004 |
comparison
equal
deleted
inserted
replaced
82:e52546f41851 | 83:3cfc83a99cbc |
---|---|
81 /// Override this method in a subclass to handle the selectionChanged event. | 81 /// Override this method in a subclass to handle the selectionChanged event. |
82 protected void whenSelectionChanged(EventArgs e) { } | 82 protected void whenSelectionChanged(EventArgs e) { } |
83 /// This event occurs after the selection has changed. | 83 /// This event occurs after the selection has changed. |
84 Event!(whenSelectionChanged) selectionChanged; | 84 Event!(whenSelectionChanged) selectionChanged; |
85 | 85 |
86 void whenListItemsChanged(string, int) { | 86 void whenListItemsChanged(ListChangeType, string, string, uint) { |
87 super.layout(); | 87 super.layout(); |
88 repaint(); | 88 repaint(); |
89 } | 89 } |
90 | 90 |
91 /// | 91 /// |
92 this() { | 92 this() { |
93 selectionChanged.setUp(&whenSelectionChanged); | 93 selectionChanged.setUp(&whenSelectionChanged); |
94 _items = new List!(string, true)(&whenListItemsChanged, &whenListItemsChanged); | 94 _items = new List!(string, true)(&whenListItemsChanged); |
95 | 95 |
96 super(); | 96 super(); |
97 _focusable = true; | 97 _focusable = true; |
98 // TODO: hack | 98 // TODO: hack |
99 backColor = WindowsTheme.getColor(5); | 99 backColor = WindowsTheme.getColor(5); |