# HG changeset patch # User mhessling@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1077100009 0 # Node ID 078a40ba2e41786f2019a791ed6fdde6dd54db11 # Parent c607eb385e58a5e33bcba6875b72d7a787eee0bf Added dw_container_get_column_type and dw_filesystem_get_column_type. diff -r c607eb385e58 -r 078a40ba2e41 dw.def --- a/dw.def Thu Jan 22 18:51:49 2004 +0000 +++ b/dw.def Wed Feb 18 10:26:49 2004 +0000 @@ -137,12 +137,14 @@ dw_container_optimize @234 dw_container_delete_row @235 dw_container_change_item @236 + dw_container_get_column_type @237 dw_filesystem_setup @240 dw_filesystem_set_item @241 dw_filesystem_set_file @242 dw_filesystem_change_item @243 dw_filesystem_change_file @244 + dw_filesystem_get_column_type @245 dw_screen_width @250 dw_screen_height @251 diff -r c607eb385e58 -r 078a40ba2e41 dw.h --- a/dw.h Thu Jan 22 18:51:49 2004 +0000 +++ b/dw.h Wed Feb 18 10:26:49 2004 +0000 @@ -1009,6 +1009,8 @@ void API dw_filesystem_set_file(HWND handle, void *pointer, int row, char *filename, unsigned long icon); void API dw_filesystem_change_item(HWND handle, int column, int row, void *data); void API dw_filesystem_change_file(HWND handle, int row, char *filename, unsigned long icon); +int API dw_container_get_column_type(HWND handle, int column); +int API dw_filesystem_get_column_type(HWND handle, int column); void API dw_taskbar_insert(HWND handle, unsigned long icon, char *bubbletext); void API dw_taskbar_delete(HWND handle, unsigned long icon); int API dw_screen_width(void); diff -r c607eb385e58 -r 078a40ba2e41 dwtest.c --- a/dwtest.c Thu Jan 22 18:51:49 2004 +0000 +++ b/dwtest.c Wed Feb 18 10:26:49 2004 +0000 @@ -472,10 +472,10 @@ /* Make the last inserted point the cursor location */ dw_mle_set(container_mle, mle_point); /* set the details of item 0 to new data */ -fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", container, containerinfo, fileicon); +fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)fileicon); dw_filesystem_change_file(container, 0, "new data", fileicon); size = 999; -fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", container, containerinfo, fileicon); +fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)fileicon); dw_filesystem_change_item(container, 0, 0, &size); return 0; } @@ -490,10 +490,29 @@ int DWSIGNAL column_click_cb( HWND window, int column_num, void *data ) { - char buf[200]; + char buf[200], buf1[100]; HWND statline = (HWND)data; + int column_type; - sprintf(buf,"DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Itemdata: %x", (unsigned int)window, column_num, (unsigned int)data ); + if(column_num == 0) + strcpy(buf1,"Filename"); + else + { + column_type = dw_filesystem_get_column_type( window, column_num-1 ); + if( column_type == DW_CFA_STRING) + strcpy(buf1,"String"); + else if( column_type == DW_CFA_ULONG) + strcpy(buf1,"ULong"); + else if( column_type == DW_CFA_DATE) + strcpy(buf1,"Date"); + else if( column_type == DW_CFA_TIME) + strcpy(buf1,"Time"); + else if( column_type == DW_CFA_BITMAPORICON) + strcpy(buf1,"BitmapOrIcon"); + else + strcpy(buf1,"Unknown"); + } + sprintf(buf,"DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", (unsigned int)window, column_num, buf1, (unsigned int)data ); dw_window_set_text( statline, buf); return 0; } @@ -697,7 +716,7 @@ sprintf(buffer, "Filename %d",z+1); if (z == 0 ) thisicon = foldericon; else thisicon = fileicon; -fprintf(stderr,"Initial: container: %x containerinfo: %x icon: %x\n", container, containerinfo, thisicon); +fprintf(stderr,"Initial: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)thisicon); dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon); dw_filesystem_set_item(container, containerinfo, 0, z, &size); diff -r c607eb385e58 -r 078a40ba2e41 dww.def --- a/dww.def Thu Jan 22 18:51:49 2004 +0000 +++ b/dww.def Wed Feb 18 10:26:49 2004 +0000 @@ -134,12 +134,14 @@ dw_container_optimize @234 dw_container_delete_row @235 dw_container_change_item @236 + dw_container_get_column_type @237 dw_filesystem_setup @240 dw_filesystem_set_item @241 dw_filesystem_set_file @242 dw_filesystem_change_item @243 dw_filesystem_change_file @244 + dw_filesystem_get_column_type @245 dw_screen_width @250 dw_screen_height @251 diff -r c607eb385e58 -r 078a40ba2e41 gtk/dw.c --- a/gtk/dw.c Thu Jan 22 18:51:49 2004 +0000 +++ b/gtk/dw.c Wed Feb 18 10:26:49 2004 +0000 @@ -5136,6 +5136,57 @@ } /* + * Gets column type for a container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int dw_container_get_column_type(HWND handle, int column) +{ + char numbuf[10]; + int flag, rc; + GtkWidget *clist; + int _locked_by_me = FALSE; + + DW_MUTEX_LOCK; + clist = (GtkWidget *)gtk_object_get_user_data(GTK_OBJECT(handle)); + if(!clist) + { + DW_MUTEX_UNLOCK; + return 0; + } + + sprintf(numbuf, "%d", column); + flag = (int)gtk_object_get_data(GTK_OBJECT(clist), numbuf); + + if(flag & DW_CFA_BITMAPORICON) + rc = DW_CFA_BITMAPORICON; + else if(flag & DW_CFA_STRING) + rc = DW_CFA_STRING; + else if(flag & DW_CFA_ULONG) + rc = DW_CFA_ULONG; + else if(flag & DW_CFA_DATE) + rc = DW_CFA_DATE; + else if(flag & DW_CFA_TIME) + rc = DW_CFA_TIME; + else + rc = 0; + DW_MUTEX_UNLOCK; + return rc; +} + +/* + * Gets column type for a filesystem container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int API dw_filesystem_get_column_type(HWND handle, int column) +{ + return dw_container_get_column_type( handle, column + 1 ); +} + +/* * Sets the width of a column in the container. * Parameters: * handle: Handle to window (widget) of container. diff -r c607eb385e58 -r 078a40ba2e41 mac/dw.c --- a/mac/dw.c Thu Jan 22 18:51:49 2004 +0000 +++ b/mac/dw.c Wed Feb 18 10:26:49 2004 +0000 @@ -2261,6 +2261,28 @@ } /* + * Gets column type for a container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int API dw_container_get_column_type(HWND handle, int column) +{ + return 0; +} + +/* + * Gets column type for a filesystem container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int API dw_filesystem_get_column_type(HWND handle, int column) +{ + return dw_container_get_column_type( handle, column + 1 ); +} + +/* * Sets the width of a column in the container. * Parameters: * handle: Handle to window (widget) of container. diff -r c607eb385e58 -r 078a40ba2e41 os2/dw.c --- a/os2/dw.c Thu Jan 22 18:51:49 2004 +0000 +++ b/os2/dw.c Wed Feb 18 10:26:49 2004 +0000 @@ -6660,6 +6660,47 @@ } /* + * Gets column type for a container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int API dw_container_get_column_type(HWND handle, int column) +{ + WindowData *blah = (WindowData *)WinQueryWindowPtr(handle, QWP_USER); + ULONG *flags = blah ? blah->data : 0; + int rc; + + if(!flags) + return 0; + + if(flags[column] & DW_CFA_BITMAPORICON) + rc = DW_CFA_BITMAPORICON; + else if(flags[column] & DW_CFA_STRING) + rc = DW_CFA_STRING; + else if(flags[column] & DW_CFA_ULONG) + rc = DW_CFA_ULONG; + else if(flags[column] & DW_CFA_DATE) + rc = DW_CFA_DATE; + else if(flags[column] & DW_CFA_TIME) + rc = DW_CFA_TIME; + else + rc = 0; + return rc; +} + +/* + * Gets column type for a filesystem container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int API dw_filesystem_get_column_type(HWND handle, int column) +{ + return dw_container_get_column_type( handle, column + 1 ); +} + +/* * Sets the width of a column in the container. * Parameters: * handle: Handle to window (widget) of container. diff -r c607eb385e58 -r 078a40ba2e41 win/dw.c --- a/win/dw.c Thu Jan 22 18:51:49 2004 +0000 +++ b/win/dw.c Wed Feb 18 10:26:49 2004 +0000 @@ -6729,6 +6729,49 @@ } /* + * Gets column type for a container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int API dw_container_get_column_type(HWND handle, int column) +{ + ContainerInfo *cinfo = (ContainerInfo *)GetWindowLongPtr(handle, GWLP_USERDATA); + ULONG *flags; + int rc; + + if(!cinfo || !cinfo->flags) + return 0; + + flags = cinfo->flags; + + if(flags[column] & DW_CFA_BITMAPORICON) + rc = DW_CFA_BITMAPORICON; + else if(flags[column] & DW_CFA_STRING) + rc = DW_CFA_STRING; + else if(flags[column] & DW_CFA_ULONG) + rc = DW_CFA_ULONG; + else if(flags[column] & DW_CFA_DATE) + rc = DW_CFA_DATE; + else if(flags[column] & DW_CFA_TIME) + rc = DW_CFA_TIME; + else + rc = 0; + return rc; +} + +/* + * Gets column type for a filesystem container column + * Parameters: + * handle: Handle to the container window (widget). + * column: Zero based column. + */ +int API dw_filesystem_get_column_type(HWND handle, int column) +{ + return dw_container_get_column_type( handle, column + 1 ); +} + +/* * Sets the width of a column in the container. * Parameters: * handle: Handle to window (widget) of container.