diff dynamin/gui/list_box.d @ 55:c138461bf845

Add focusing and other changes that are related like descendantAdded/Removed events, Window.activated event, and updating List. Window.state was also added, even though focusing does not depend on it.
author Jordan Miner <jminer7@gmail.com>
date Sat, 08 Aug 2009 15:42:27 -0500
parents ccc108b25a0a
children 651082a9b364
line wrap: on
line diff
--- a/dynamin/gui/list_box.d	Sat Aug 08 15:31:24 2009 -0500
+++ b/dynamin/gui/list_box.d	Sat Aug 08 15:42:27 2009 -0500
@@ -38,7 +38,7 @@
  */
 class ListBox : Scrollable {
 protected:
-	List!(string) _items;
+	List!(string, true) _items;
 	int _selectedIndex = -1;
 
 	override void whenKeyDown(KeyEventArgs e) {
@@ -83,7 +83,7 @@
 	/// This event occurs after the selection has changed.
 	Event!(whenSelectionChanged) selectionChanged;
 
-	void listItemsChanged() {
+	void whenListItemsChanged(string, int) {
 		super.layout();
 		repaint();
 	}
@@ -91,7 +91,7 @@
 	///
 	this() {
 		selectionChanged.mainHandler = &whenSelectionChanged;
-		_items = new List!(string)(&listItemsChanged);
+		_items = new List!(string, true)(&whenListItemsChanged, &whenListItemsChanged);
 
 		super();
 		_focusable = true;
@@ -99,7 +99,7 @@
 		backColor = WindowsTheme.getColor(5);
 	}
 	///
-	List!(string) items() {
+	List!(string, true) items() {
 		return _items;
 	}
 	///