changeset 832:37cdfec6d3fa

Fix for dw_filesystem_set_file() not working as designed on Windows... Added a test case for the container behavior fixes in the test program we can see if they are working.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 27 Mar 2011 03:47:53 +0000
parents 168b9db65825
children 53b677d126dc
files dwtest.c win/dw.c
diffstat 2 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dwtest.c	Sun Mar 27 03:30:27 2011 +0000
+++ b/dwtest.c	Sun Mar 27 03:47:53 2011 +0000
@@ -854,6 +854,16 @@
    }
 
    dw_container_insert(container, containerinfo, 3);
+   
+   containerinfo = dw_container_alloc(container, 1);
+   dw_filesystem_set_file(container, containerinfo, 0, strdup("Yikes"), foldericon);
+   size = 324;
+   dw_filesystem_set_item(container, containerinfo, 0, 0, &size);
+   dw_filesystem_set_item(container, containerinfo, 1, 0, &time);
+   dw_filesystem_set_item(container, containerinfo, 2, 0, &date);
+   dw_container_set_row_title(containerinfo, 0, strdup("Extra"));
+   
+   dw_container_insert(container, containerinfo, 1);
    dw_container_optimize(container);
 
    container_mle = dw_mle_new( 111 );
--- a/win/dw.c	Sun Mar 27 03:30:27 2011 +0000
+++ b/win/dw.c	Sun Mar 27 03:47:53 2011 +0000
@@ -7641,8 +7641,14 @@
 void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, HICN icon)
 {
    LV_ITEM lvi;
-
-   lvi.iItem = row;
+   int item = 0;
+   
+   if(pointer)
+   {
+	   item = (int)dw_window_get_data(handle, "_dw_insertitem");
+   }
+
+   lvi.iItem = row + item;
    lvi.iSubItem = 0;
    lvi.mask = LVIF_DI_SETITEM | LVIF_IMAGE | LVIF_TEXT;
    lvi.pszText = filename;