Mercurial > dwindows
diff gtk3/dw.c @ 1744:535e8c19a13d
Added dw_filesystem_set_column_title() function to aid in localization.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 04 Jun 2012 22:18:56 +0000 |
parents | cebf830e3da7 |
children | 7dd1659c2693 |
line wrap: on
line diff
--- a/gtk3/dw.c Sun Jun 03 19:44:04 2012 +0000 +++ b/gtk3/dw.c Mon Jun 04 22:18:56 2012 +0000 @@ -5622,6 +5622,19 @@ } /* + * Configures the main filesystem columnn title for localization. + * Parameters: + * handle: Handle to the container to be configured. + * title: The title to be displayed in the main column. + */ +void API dw_filesystem_set_column_title(HWND handle, char *title) +{ + char *newtitle = strdup(title ? title : ""); + + dw_window_set_data(handle, "_dw_coltitle", newtitle); +} + +/* * Sets up the filesystem columns, note: filesystem always has an icon/filename field. * Parameters: * handle: Handle to the container to be configured. @@ -5633,8 +5646,9 @@ { char **newtitles = malloc(sizeof(char *) * (count + 1)); unsigned long *newflags = malloc(sizeof(unsigned long) * (count + 1)); - - newtitles[0] = "Filename"; + char *coltitle = (char *)dw_window_get_data(handle, "_dw_coltitle"); + + newtitles[0] = coltitle ? coltitle : "Filename"; newflags[0] = DW_CFA_STRINGANDICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR; memcpy(&newtitles[1], titles, sizeof(char *) * count); @@ -5642,6 +5656,11 @@ _dw_container_setup(handle, newflags, newtitles, count + 1, 1, 1); + if(coltitle) + { + dw_window_set_data(handle, "_dw_coltitle", NULL); + free(coltitle); + } if ( newtitles) free(newtitles); if ( newflags ) free(newflags); return DW_ERROR_NONE;