comparison dwtest.c @ 508:078a40ba2e41

Added dw_container_get_column_type and dw_filesystem_get_column_type.
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 18 Feb 2004 10:26:49 +0000
parents f3ed8dda02f8
children 710f82598210
comparison
equal deleted inserted replaced
507:c607eb385e58 508:078a40ba2e41
470 str = dw_container_query_next(container, DW_CRA_SELECTED); 470 str = dw_container_query_next(container, DW_CRA_SELECTED);
471 } 471 }
472 /* Make the last inserted point the cursor location */ 472 /* Make the last inserted point the cursor location */
473 dw_mle_set(container_mle, mle_point); 473 dw_mle_set(container_mle, mle_point);
474 /* set the details of item 0 to new data */ 474 /* set the details of item 0 to new data */
475 fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", container, containerinfo, fileicon); 475 fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)fileicon);
476 dw_filesystem_change_file(container, 0, "new data", fileicon); 476 dw_filesystem_change_file(container, 0, "new data", fileicon);
477 size = 999; 477 size = 999;
478 fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", container, containerinfo, fileicon); 478 fprintf(stderr,"In cb: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)fileicon);
479 dw_filesystem_change_item(container, 0, 0, &size); 479 dw_filesystem_change_item(container, 0, 0, &size);
480 return 0; 480 return 0;
481 } 481 }
482 482
483 int DWSIGNAL switch_page_cb( HWND window, unsigned long page_num, void *itemdata ) 483 int DWSIGNAL switch_page_cb( HWND window, unsigned long page_num, void *itemdata )
488 return 0; 488 return 0;
489 } 489 }
490 490
491 int DWSIGNAL column_click_cb( HWND window, int column_num, void *data ) 491 int DWSIGNAL column_click_cb( HWND window, int column_num, void *data )
492 { 492 {
493 char buf[200]; 493 char buf[200], buf1[100];
494 HWND statline = (HWND)data; 494 HWND statline = (HWND)data;
495 495 int column_type;
496 sprintf(buf,"DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Itemdata: %x", (unsigned int)window, column_num, (unsigned int)data ); 496
497 if(column_num == 0)
498 strcpy(buf1,"Filename");
499 else
500 {
501 column_type = dw_filesystem_get_column_type( window, column_num-1 );
502 if( column_type == DW_CFA_STRING)
503 strcpy(buf1,"String");
504 else if( column_type == DW_CFA_ULONG)
505 strcpy(buf1,"ULong");
506 else if( column_type == DW_CFA_DATE)
507 strcpy(buf1,"Date");
508 else if( column_type == DW_CFA_TIME)
509 strcpy(buf1,"Time");
510 else if( column_type == DW_CFA_BITMAPORICON)
511 strcpy(buf1,"BitmapOrIcon");
512 else
513 strcpy(buf1,"Unknown");
514 }
515 sprintf(buf,"DW_SIGNAL_COLUMN_CLICK: Window: %x Column: %d Type: %s Itemdata: %x", (unsigned int)window, column_num, buf1, (unsigned int)data );
497 dw_window_set_text( statline, buf); 516 dw_window_set_text( statline, buf);
498 return 0; 517 return 0;
499 } 518 }
500 519
501 void archive_add(void) 520 void archive_add(void)
695 sprintf(names[z],"Don't allocate from stack: Item: %d",z); 714 sprintf(names[z],"Don't allocate from stack: Item: %d",z);
696 size = z*100; 715 size = z*100;
697 sprintf(buffer, "Filename %d",z+1); 716 sprintf(buffer, "Filename %d",z+1);
698 if (z == 0 ) thisicon = foldericon; 717 if (z == 0 ) thisicon = foldericon;
699 else thisicon = fileicon; 718 else thisicon = fileicon;
700 fprintf(stderr,"Initial: container: %x containerinfo: %x icon: %x\n", container, containerinfo, thisicon); 719 fprintf(stderr,"Initial: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)thisicon);
701 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon); 720 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon);
702 dw_filesystem_set_item(container, containerinfo, 0, z, &size); 721 dw_filesystem_set_item(container, containerinfo, 0, z, &size);
703 722
704 time.seconds = z+10; 723 time.seconds = z+10;
705 time.minutes = z+10; 724 time.minutes = z+10;