Mercurial > projects > dwt2
comparison org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/widgets/Tree.d @ 108:b397a43d66d1
Updated swt linux for DMD 1.063 and latest Tango trunk.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Wed, 25 Aug 2010 23:08:27 +0200 |
parents | f713da8bc051 |
children |
comparison
equal
deleted
inserted
replaced
107:e944a4cf537b | 108:b397a43d66d1 |
---|---|
275 if (column !is null) { | 275 if (column !is null) { |
276 modelIndex = column.modelIndex; | 276 modelIndex = column.modelIndex; |
277 customDraw = column.customDraw; | 277 customDraw = column.customDraw; |
278 } | 278 } |
279 } | 279 } |
280 if (modelIndex is -1) return 0; | 280 if (modelIndex is -1) return; |
281 bool setData = false; | 281 bool setData = false; |
282 if ((style & SWT.VIRTUAL) !is 0) { | 282 if ((style & SWT.VIRTUAL) !is 0) { |
283 /* | 283 /* |
284 * Feature in GTK. On GTK before 2.4, fixed_height_mode is not | 284 * Feature in GTK. On GTK before 2.4, fixed_height_mode is not |
285 * supported, and the tree asks for the data of all items. The | 285 * supported, and the tree asks for the data of all items. The |
298 * the correct height. | 298 * the correct height. |
299 */ | 299 */ |
300 if (imageList !is null && imageList.pixbufs.length > 0) { | 300 if (imageList !is null && imageList.pixbufs.length > 0) { |
301 if (isPixbuf) OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)imageList.pixbufs [0]); | 301 if (isPixbuf) OS.g_object_set1 (cell, OS.pixbuf.ptr, cast(int)imageList.pixbufs [0]); |
302 } | 302 } |
303 return 0; | 303 return; |
304 } | 304 } |
305 } | 305 } |
306 if (!item.cached) { | 306 if (!item.cached) { |
307 //lastIndexOf = index [0]; | 307 //lastIndexOf = index [0]; |
308 setData = checkData (item); | 308 setData = checkData (item); |
1988 */ | 1988 */ |
1989 return OS.GTK_VERSION < OS.buildVERSION (2, 6, 5) ? 1 : result; | 1989 return OS.GTK_VERSION < OS.buildVERSION (2, 6, 5) ? 1 : result; |
1990 } | 1990 } |
1991 | 1991 |
1992 override void gtk_row_activated (GtkTreeView* tree, GtkTreePath* path, GtkTreeViewColumn* column) { | 1992 override void gtk_row_activated (GtkTreeView* tree, GtkTreePath* path, GtkTreeViewColumn* column) { |
1993 if (path is null) return 0; | 1993 if (path is null) return; |
1994 TreeItem item = null; | 1994 TreeItem item = null; |
1995 GtkTreeIter iter; | 1995 GtkTreeIter iter; |
1996 if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) { | 1996 if (OS.gtk_tree_model_get_iter (modelHandle, &iter, path)) { |
1997 int index; | 1997 int index; |
1998 OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index); | 1998 OS.gtk_tree_model_get1 (modelHandle, &iter, ID_COLUMN, cast(void**)&index); |
1999 item = items [index ]; | 1999 item = items [index ]; |
2000 } | 2000 } |
2001 Event event = new Event (); | 2001 Event event = new Event (); |
2002 event.item = item; | 2002 event.item = item; |
2003 postEvent (SWT.DefaultSelection, event); | 2003 postEvent (SWT.DefaultSelection, event); |
2004 return 0; | 2004 return; |
2005 } | 2005 } |
2006 | 2006 |
2007 override int gtk_test_collapse_row ( | 2007 override int gtk_test_collapse_row ( |
2008 GtkTreeView *tree, | 2008 GtkTreeView *tree, |
2009 GtkTreeIter *iter, | 2009 GtkTreeIter *iter, |
2673 sendEvent (SWT.PaintItem, event); | 2673 sendEvent (SWT.PaintItem, event); |
2674 gc.dispose(); | 2674 gc.dispose(); |
2675 } | 2675 } |
2676 } | 2676 } |
2677 } | 2677 } |
2678 return result; | 2678 //return result; |
2679 } | 2679 } |
2680 | 2680 |
2681 void resetCustomDraw () { | 2681 void resetCustomDraw () { |
2682 if ((style & SWT.VIRTUAL) !is 0 || ownerDraw) return; | 2682 if ((style & SWT.VIRTUAL) !is 0 || ownerDraw) return; |
2683 int end = Math.max (1, columnCount); | 2683 int end = Math.max (1, columnCount); |
3328 if (selection !is null) { | 3328 if (selection !is null) { |
3329 int index; | 3329 int index; |
3330 OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index); | 3330 OS.gtk_tree_model_get1 (modelHandle, iter, ID_COLUMN, cast(void**)&index); |
3331 selection [length_] = index; | 3331 selection [length_] = index; |
3332 } | 3332 } |
3333 return 0; | |
3334 } | 3333 } |
3335 | 3334 |
3336 override void updateScrollBarValue (ScrollBar bar) { | 3335 override void updateScrollBarValue (ScrollBar bar) { |
3337 super.updateScrollBarValue (bar); | 3336 super.updateScrollBarValue (bar); |
3338 /* | 3337 /* |