comparison dwtest.c @ 897:2b07bf8ed95b

Added enterable widget on render tab to test keypress callback
author mhessling@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 18 Apr 2011 06:12:59 +0000
parents 39ab47d103c3
children ae5d884af4ed
comparison
equal deleted inserted replaced
896:529c27638936 897:2b07bf8ed95b
63 html, 63 html,
64 rawhtml, 64 rawhtml,
65 notebook, 65 notebook,
66 vscrollbar, 66 vscrollbar,
67 hscrollbar, 67 hscrollbar,
68 status, status1, 68 status,
69 container_status, 69 container_status,
70 tree_status, 70 tree_status,
71 stext, 71 stext,
72 tree, 72 tree,
73 container, 73 container,
329 char tmpbuf[100]; 329 char tmpbuf[100];
330 if ( ch ) 330 if ( ch )
331 sprintf( tmpbuf, "Key: %c(%d) Modifiers: %s(%d)", ch, ch, resolve_keymodifiers(state), state ); 331 sprintf( tmpbuf, "Key: %c(%d) Modifiers: %s(%d)", ch, ch, resolve_keymodifiers(state), state );
332 else 332 else
333 sprintf( tmpbuf, "Key: %s(%d) Modifiers: %s(%d)", resolve_keyname(vk), vk, resolve_keymodifiers(state), state ); 333 sprintf( tmpbuf, "Key: %s(%d) Modifiers: %s(%d)", resolve_keyname(vk), vk, resolve_keymodifiers(state), state );
334 dw_window_set_text( status1, tmpbuf); 334 dw_window_set_text( status, tmpbuf);
335 return 0; 335 return 0;
336 } 336 }
337 337
338 int DWSIGNAL menu_callback(HWND window, void *data) 338 int DWSIGNAL menu_callback(HWND window, void *data)
339 { 339 {
698 698
699 699
700 void text_add(void) 700 void text_add(void)
701 { 701 {
702 unsigned long depth = dw_color_depth_get(); 702 unsigned long depth = dw_color_depth_get();
703 HWND vscrollbox; 703 HWND vscrollbox,hbox,spin1,button1;
704 704
705 /* create a box to pack into the notebook page */ 705 /* create a box to pack into the notebook page */
706 pagebox = dw_box_new(BOXHORZ, 2); 706 pagebox = dw_box_new(BOXHORZ, 2);
707 dw_box_pack_start( notebookbox2, pagebox, 0, 0, TRUE, TRUE, 0); 707 dw_box_pack_start( notebookbox2, pagebox, 0, 0, TRUE, TRUE, 0);
708 /* now a status area under this box */ 708 /* now a status area under this box */
709 status = dw_status_text_new("", 0); 709 status = dw_status_text_new("", 0);
710 dw_box_pack_start( notebookbox2, status, 100, 20, TRUE, FALSE, 1); 710 dw_box_pack_start( notebookbox2, status, 100, 20, TRUE, FALSE, 1);
711 /* and another one */ 711 /* a box with combobox and button */
712 status1 = dw_status_text_new("", 0); 712 hbox = dw_box_new(BOXHORZ, 1 );
713 dw_box_pack_start( notebookbox2, status1, 100, 20, TRUE, FALSE, 1); 713 dw_box_pack_start( notebookbox2, hbox, 100, 20, TRUE, FALSE, 1);
714 button1 = dw_button_new( "Does nothing", 1223L );
715 dw_box_pack_start( hbox, button1, 100, 20, TRUE, FALSE, 0);
716 spin1 = dw_spinbutton_new( "", 0 );
717 dw_box_pack_start( hbox, spin1, 100, 20, TRUE, FALSE, 0);
718 dw_spinbutton_set_limits( spin1, 100, 1 );
719 dw_spinbutton_set_pos( spin1, 1 );
714 720
715 /* create render box for number pixmap */ 721 /* create render box for number pixmap */
716 textbox1 = dw_render_new( 100 ); 722 textbox1 = dw_render_new( 100 );
717 dw_window_set_font(textbox1, FIXEDFONT); 723 dw_window_set_font(textbox1, FIXEDFONT);
718 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height); 724 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height);
848 sprintf(buffer, "Filename %d",z+1); 854 sprintf(buffer, "Filename %d",z+1);
849 if (z == 0 ) thisicon = foldericon; 855 if (z == 0 ) thisicon = foldericon;
850 else thisicon = fileicon; 856 else thisicon = fileicon;
851 fprintf(stderr,"Initial: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)thisicon); 857 fprintf(stderr,"Initial: container: %x containerinfo: %x icon: %x\n", (int)container, (int)containerinfo, (int)thisicon);
852 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon); 858 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon);
853 dw_filesystem_set_item(container, containerinfo, 0, z, &thisicon); 859 dw_filesystem_set_item(container, containerinfo, 0, z, &thisicon);
854 dw_filesystem_set_item(container, containerinfo, 1, z, &size); 860 dw_filesystem_set_item(container, containerinfo, 1, z, &size);
855 861
856 time.seconds = z+10; 862 time.seconds = z+10;
857 time.minutes = z+10; 863 time.minutes = z+10;
858 time.hours = z+10; 864 time.hours = z+10;
865 871
866 dw_container_set_row_title(containerinfo, z, names[z]); 872 dw_container_set_row_title(containerinfo, z, names[z]);
867 } 873 }
868 874
869 dw_container_insert(container, containerinfo, 3); 875 dw_container_insert(container, containerinfo, 3);
870 876
871 containerinfo = dw_container_alloc(container, 1); 877 containerinfo = dw_container_alloc(container, 1);
872 dw_filesystem_set_file(container, containerinfo, 0, strdup("Yikes"), foldericon); 878 dw_filesystem_set_file(container, containerinfo, 0, strdup("Yikes"), foldericon);
873 size = 324; 879 size = 324;
874 dw_filesystem_set_item(container, containerinfo, 0, 0, &foldericon); 880 dw_filesystem_set_item(container, containerinfo, 0, 0, &foldericon);
875 dw_filesystem_set_item(container, containerinfo, 1, 0, &size); 881 dw_filesystem_set_item(container, containerinfo, 1, 0, &size);
876 dw_filesystem_set_item(container, containerinfo, 2, 0, &time); 882 dw_filesystem_set_item(container, containerinfo, 2, 0, &time);
877 dw_filesystem_set_item(container, containerinfo, 3, 0, &date); 883 dw_filesystem_set_item(container, containerinfo, 3, 0, &date);
878 dw_container_set_row_title(containerinfo, 0, strdup("Extra")); 884 dw_container_set_row_title(containerinfo, 0, strdup("Extra"));
879 885
880 dw_container_insert(container, containerinfo, 1); 886 dw_container_insert(container, containerinfo, 1);
881 dw_container_optimize(container); 887 dw_container_optimize(container);
882 888
883 container_mle = dw_mle_new( 111 ); 889 container_mle = dw_mle_new( 111 );
884 dw_box_pack_start( containerbox, container_mle, 500, 200, TRUE, TRUE, 0); 890 dw_box_pack_start( containerbox, container_mle, 500, 200, TRUE, TRUE, 0);