comparison dwtest.c @ 1685:96fcc01693cf

Updated the test program removing deprecated flags and using new flags and macros.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 30 Apr 2012 12:22:37 +0000
parents 31dd366acfc8
children 1a7b9b96d9d7
comparison
equal deleted inserted replaced
1684:31dd366acfc8 1685:96fcc01693cf
80 combox, 80 combox,
81 combobox1, 81 combobox1,
82 combobox2, 82 combobox2,
83 spinbutton, 83 spinbutton,
84 slider, 84 slider,
85 percent, 85 percent,
86 notebookbox, 86 notebookbox,
87 notebookbox1, 87 notebookbox1,
88 notebookbox2, 88 notebookbox2,
89 notebookbox3, 89 notebookbox3,
90 notebookbox4, 90 notebookbox4,
376 dw_color_background_set(DW_CLR_DARKRED); 376 dw_color_background_set(DW_CLR_DARKRED);
377 dw_draw_text(window, pixmap, 10, 10, "This should be aligned with the edges."); 377 dw_draw_text(window, pixmap, 10, 10, "This should be aligned with the edges.");
378 dw_color_foreground_set(DW_CLR_YELLOW); 378 dw_color_foreground_set(DW_CLR_YELLOW);
379 dw_draw_line(window, pixmap, width - 10, 10, 10, height - 10); 379 dw_draw_line(window, pixmap, width - 10, 10, 10, height - 10);
380 dw_color_foreground_set(DW_CLR_BLUE); 380 dw_color_foreground_set(DW_CLR_BLUE);
381 dw_draw_polygon(window, pixmap, TRUE, 7, x, y); 381 dw_draw_polygon(window, pixmap, DW_DRAW_FILL, 7, x, y);
382 dw_color_foreground_set(DW_CLR_BLACK); 382 dw_color_foreground_set(DW_CLR_BLACK);
383 dw_draw_rect(window, pixmap, DW_DRAW_FILL | DW_DRAW_NOAA, 80, 80, 80, 40); 383 dw_draw_rect(window, pixmap, DW_DRAW_FILL | DW_DRAW_NOAA, 80, 80, 80, 40);
384 dw_color_foreground_set(DW_CLR_CYAN); 384 dw_color_foreground_set(DW_CLR_CYAN);
385 /* Bottom right corner */ 385 /* Bottom right corner */
386 dw_draw_arc(window, pixmap, 0, width - 30, height - 30, width - 10, height - 30, width - 30, height - 10); 386 dw_draw_arc(window, pixmap, 0, width - 30, height - 30, width - 10, height - 30, width - 30, height - 10);
843 843
844 void archive_add(void) 844 void archive_add(void)
845 { 845 {
846 HWND browsefilebutton, browsefolderbutton, browsebox; 846 HWND browsefilebutton, browsefolderbutton, browsebox;
847 847
848 lbbox = dw_box_new(BOXVERT, 10); 848 lbbox = dw_box_new(DW_VERT, 10);
849 849
850 dw_box_pack_start(notebookbox1, lbbox, 150, 70, TRUE, TRUE, 0); 850 dw_box_pack_start(notebookbox1, lbbox, 150, 70, TRUE, TRUE, 0);
851 851
852 /* Archive Name */ 852 /* Archive Name */
853 stext = dw_text_new("File to browse", 0); 853 stext = dw_text_new("File to browse", 0);
854 854
855 dw_window_set_style(stext, DW_DT_VCENTER, DW_DT_VCENTER); 855 dw_window_set_style(stext, DW_DT_VCENTER, DW_DT_VCENTER);
856 856
857 dw_box_pack_start(lbbox, stext, 130, 15, TRUE, TRUE, 2); 857 dw_box_pack_start(lbbox, stext, 130, 15, TRUE, TRUE, 2);
858 858
859 browsebox = dw_box_new(BOXHORZ, 0); 859 browsebox = dw_box_new(DW_HORZ, 0);
860 860
861 dw_box_pack_start(lbbox, browsebox, 0, 0, TRUE, TRUE, 0); 861 dw_box_pack_start(lbbox, browsebox, 0, 0, TRUE, TRUE, 0);
862 862
863 entryfield = dw_entryfield_new("", 100L); 863 entryfield = dw_entryfield_new("", 100L);
864 864
876 876
877 dw_window_set_color(browsebox, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY); 877 dw_window_set_color(browsebox, DW_CLR_PALEGRAY, DW_CLR_PALEGRAY);
878 dw_window_set_color(stext, DW_CLR_BLACK, DW_CLR_PALEGRAY); 878 dw_window_set_color(stext, DW_CLR_BLACK, DW_CLR_PALEGRAY);
879 879
880 /* Buttons */ 880 /* Buttons */
881 buttonbox = dw_box_new(BOXHORZ, 10); 881 buttonbox = dw_box_new(DW_HORZ, 10);
882 882
883 dw_box_pack_start(lbbox, buttonbox, 0, 0, TRUE, TRUE, 0); 883 dw_box_pack_start(lbbox, buttonbox, 0, 0, TRUE, TRUE, 0);
884 884
885 cancelbutton = dw_button_new("Exit", 1002L); 885 cancelbutton = dw_button_new("Exit", 1002L);
886 dw_box_pack_start(buttonbox, cancelbutton, 130, 30, TRUE, TRUE, 2); 886 dw_box_pack_start(buttonbox, cancelbutton, 130, 30, TRUE, TRUE, 2);
901 /* Set some nice fonts and colors */ 901 /* Set some nice fonts and colors */
902 dw_window_set_color(lbbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY); 902 dw_window_set_color(lbbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY);
903 dw_window_set_color(buttonbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY); 903 dw_window_set_color(buttonbox, DW_CLR_DARKCYAN, DW_CLR_PALEGRAY);
904 dw_window_set_color(okbutton, DW_CLR_PALEGRAY, DW_CLR_DARKCYAN); 904 dw_window_set_color(okbutton, DW_CLR_PALEGRAY, DW_CLR_DARKCYAN);
905 905
906 dw_signal_connect(browsefilebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_file_callback), (void *)notebookbox1); 906 dw_signal_connect(browsefilebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_file_callback), DW_POINTER(notebookbox1));
907 dw_signal_connect(browsefolderbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_folder_callback), (void *)notebookbox1); 907 dw_signal_connect(browsefolderbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(browse_folder_callback), DW_POINTER(notebookbox1));
908 dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(beep_callback), (void *)notebookbox1); 908 dw_signal_connect(okbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(beep_callback), DW_POINTER(notebookbox1));
909 dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); 909 dw_signal_connect(cancelbutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow));
910 dw_signal_connect(cursortogglebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(cursortoggle_callback), (void *)mainwindow); 910 dw_signal_connect(cursortogglebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(cursortoggle_callback), DW_POINTER(mainwindow));
911 dw_signal_connect(colorchoosebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(colorchoose_callback), (void *)mainwindow); 911 dw_signal_connect(colorchoosebutton, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(colorchoose_callback), DW_POINTER(mainwindow));
912 } 912 }
913 913
914 int API motion_notify_event(HWND window, int x, int y, int buttonmask, void *data) 914 int API motion_notify_event(HWND window, int x, int y, int buttonmask, void *data)
915 { 915 {
916 char buf[200]; 916 char buf[200];
934 { 934 {
935 HMENUI hwndMenu = dw_menu_new(0L); 935 HMENUI hwndMenu = dw_menu_new(0L);
936 HWND menuitem = dw_menu_append_item(hwndMenu, "~Quit", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); 936 HWND menuitem = dw_menu_append_item(hwndMenu, "~Quit", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU);
937 long px, py; 937 long px, py;
938 938
939 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); 939 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow));
940 dw_menu_append_item(hwndMenu, DW_MENU_SEPARATOR, DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); 940 dw_menu_append_item(hwndMenu, DW_MENU_SEPARATOR, DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU);
941 menuitem = dw_menu_append_item(hwndMenu, "~Show Window", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); 941 menuitem = dw_menu_append_item(hwndMenu, "~Show Window", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU);
942 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(show_window_callback), (void *)mainwindow); 942 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(show_window_callback), DW_POINTER(mainwindow));
943 dw_pointer_query_pos(&px, &py); 943 dw_pointer_query_pos(&px, &py);
944 /* Use the toplevel window handle here.... because on the Mac.. 944 /* Use the toplevel window handle here.... because on the Mac..
945 * using the control itself, when a different tab is active 945 * using the control itself, when a different tab is active
946 * the control is removed from the window and can no longer 946 * the control is removed from the window and can no longer
947 * handle the messages. 947 * handle the messages.
955 unsigned long depth = dw_color_depth_get(); 955 unsigned long depth = dw_color_depth_get();
956 HWND vscrollbox, hbox, button1, button2, label; 956 HWND vscrollbox, hbox, button1, button2, label;
957 int vscrollbarwidth, hscrollbarheight; 957 int vscrollbarwidth, hscrollbarheight;
958 958
959 /* create a box to pack into the notebook page */ 959 /* create a box to pack into the notebook page */
960 pagebox = dw_box_new(BOXHORZ, 2); 960 pagebox = dw_box_new(DW_HORZ, 2);
961 dw_box_pack_start( notebookbox2, pagebox, 0, 0, TRUE, TRUE, 0); 961 dw_box_pack_start( notebookbox2, pagebox, 0, 0, TRUE, TRUE, 0);
962 /* now a status area under this box */ 962 /* now a status area under this box */
963 hbox = dw_box_new(BOXHORZ, 1 ); 963 hbox = dw_box_new(DW_HORZ, 1 );
964 dw_box_pack_start( notebookbox2, hbox, 100, 20, TRUE, FALSE, 1); 964 dw_box_pack_start( notebookbox2, hbox, 100, 20, TRUE, FALSE, 1);
965 status1 = dw_status_text_new("", 0); 965 status1 = dw_status_text_new("", 0);
966 dw_box_pack_start( hbox, status1, 100, 20, TRUE, FALSE, 1); 966 dw_box_pack_start( hbox, status1, 100, 20, TRUE, FALSE, 1);
967 status2 = dw_status_text_new("", 0); 967 status2 = dw_status_text_new("", 0);
968 dw_box_pack_start( hbox, status2, 100, 20, TRUE, FALSE, 1); 968 dw_box_pack_start( hbox, status2, 100, 20, TRUE, FALSE, 1);
969 /* a box with combobox and button */ 969 /* a box with combobox and button */
970 hbox = dw_box_new(BOXHORZ, 1 ); 970 hbox = dw_box_new(DW_HORZ, 1 );
971 dw_box_pack_start( notebookbox2, hbox, 100, 25, TRUE, FALSE, 1); 971 dw_box_pack_start( notebookbox2, hbox, 100, 25, TRUE, FALSE, 1);
972 rendcombo = dw_combobox_new( "Shapes Double Buffered", 0 ); 972 rendcombo = dw_combobox_new( "Shapes Double Buffered", 0 );
973 dw_box_pack_start( hbox, rendcombo, 80, 25, TRUE, FALSE, 0); 973 dw_box_pack_start( hbox, rendcombo, 80, 25, TRUE, FALSE, 0);
974 dw_listbox_append(rendcombo, "Shapes Double Buffered"); 974 dw_listbox_append(rendcombo, "Shapes Double Buffered");
975 dw_listbox_append(rendcombo, "Shapes Direct"); 975 dw_listbox_append(rendcombo, "Shapes Direct");
1013 /* create render box for number pixmap */ 1013 /* create render box for number pixmap */
1014 textbox1 = dw_render_new( 100 ); 1014 textbox1 = dw_render_new( 100 );
1015 dw_window_set_font(textbox1, FIXEDFONT); 1015 dw_window_set_font(textbox1, FIXEDFONT);
1016 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height); 1016 dw_font_text_extents_get(textbox1, NULL, "(g", &font_width, &font_height);
1017 font_width = font_width / 2; 1017 font_width = font_width / 2;
1018 vscrollbox = dw_box_new(BOXVERT, 0); 1018 vscrollbox = dw_box_new(DW_VERT, 0);
1019 dw_box_pack_start(vscrollbox, textbox1, font_width*width1, font_height*rows, FALSE, TRUE, 0); 1019 dw_box_pack_start(vscrollbox, textbox1, font_width*width1, font_height*rows, FALSE, TRUE, 0);
1020 dw_box_pack_start(vscrollbox, 0, (font_width*(width1+1)), hscrollbarheight, FALSE, FALSE, 0); 1020 dw_box_pack_start(vscrollbox, 0, (font_width*(width1+1)), hscrollbarheight, FALSE, FALSE, 0);
1021 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0); 1021 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0);
1022 1022
1023 /* pack empty space 1 character wide */ 1023 /* pack empty space 1 character wide */
1024 dw_box_pack_start(pagebox, 0, font_width, 0, FALSE, TRUE, 0); 1024 dw_box_pack_start(pagebox, 0, font_width, 0, FALSE, TRUE, 0);
1025 1025
1026 /* create box for filecontents and horz scrollbar */ 1026 /* create box for filecontents and horz scrollbar */
1027 textboxA = dw_box_new( BOXVERT,0 ); 1027 textboxA = dw_box_new( DW_VERT,0 );
1028 dw_box_pack_start( pagebox, textboxA, 0, 0, TRUE, TRUE, 0); 1028 dw_box_pack_start( pagebox, textboxA, 0, 0, TRUE, TRUE, 0);
1029 1029
1030 /* create render box for filecontents pixmap */ 1030 /* create render box for filecontents pixmap */
1031 textbox2 = dw_render_new( 101 ); 1031 textbox2 = dw_render_new( 101 );
1032 dw_box_pack_start( textboxA, textbox2, 10, 10, TRUE, TRUE, 0); 1032 dw_box_pack_start( textboxA, textbox2, 10, 10, TRUE, TRUE, 0);
1033 dw_window_set_font(textbox2, FIXEDFONT); 1033 dw_window_set_font(textbox2, FIXEDFONT);
1034 /* create horizonal scrollbar */ 1034 /* create horizonal scrollbar */
1035 dw_box_pack_start( textboxA, hscrollbar, -1, -1, TRUE, FALSE, 0); 1035 dw_box_pack_start( textboxA, hscrollbar, -1, -1, TRUE, FALSE, 0);
1036 1036
1037 /* create vertical scrollbar */ 1037 /* create vertical scrollbar */
1038 vscrollbox = dw_box_new(BOXVERT, 0); 1038 vscrollbox = dw_box_new(DW_VERT, 0);
1039 dw_box_pack_start(vscrollbox, vscrollbar, -1, -1, FALSE, TRUE, 0); 1039 dw_box_pack_start(vscrollbox, vscrollbar, -1, -1, FALSE, TRUE, 0);
1040 /* Pack an area of empty space 14x14 pixels */ 1040 /* Pack an area of empty space 14x14 pixels */
1041 dw_box_pack_start(vscrollbox, 0, vscrollbarwidth, hscrollbarheight, FALSE, FALSE, 0); 1041 dw_box_pack_start(vscrollbox, 0, vscrollbarwidth, hscrollbarheight, FALSE, FALSE, 0);
1042 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0); 1042 dw_box_pack_start(pagebox, vscrollbox, 0, 0, FALSE, TRUE, 0);
1043 1043
1054 dw_draw_rect(0, text2pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*cols, font_height*rows); 1054 dw_draw_rect(0, text2pm, DW_DRAW_FILL | DW_DRAW_NOAA, 0, 0, font_width*cols, font_height*rows);
1055 dw_signal_connect(textbox1, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(context_menu_event), NULL); 1055 dw_signal_connect(textbox1, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(context_menu_event), NULL);
1056 dw_signal_connect(textbox1, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL); 1056 dw_signal_connect(textbox1, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL);
1057 dw_signal_connect(textbox2, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL); 1057 dw_signal_connect(textbox2, DW_SIGNAL_EXPOSE, DW_SIGNAL_FUNC(text_expose), NULL);
1058 dw_signal_connect(textbox2, DW_SIGNAL_CONFIGURE, DW_SIGNAL_FUNC(configure_event), text2pm); 1058 dw_signal_connect(textbox2, DW_SIGNAL_CONFIGURE, DW_SIGNAL_FUNC(configure_event), text2pm);
1059 dw_signal_connect(textbox2, DW_SIGNAL_MOTION_NOTIFY, DW_SIGNAL_FUNC(motion_notify_event), (void *)1); 1059 dw_signal_connect(textbox2, DW_SIGNAL_MOTION_NOTIFY, DW_SIGNAL_FUNC(motion_notify_event), DW_INT_TO_POINTER(1));
1060 dw_signal_connect(textbox2, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(motion_notify_event), (void *)0); 1060 dw_signal_connect(textbox2, DW_SIGNAL_BUTTON_PRESS, DW_SIGNAL_FUNC(motion_notify_event), DW_INT_TO_POINTER(0));
1061 dw_signal_connect(hscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), (void *)status1); 1061 dw_signal_connect(hscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), DW_POINTER(status1));
1062 dw_signal_connect(vscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), (void *)status1); 1062 dw_signal_connect(vscrollbar, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(scrollbar_valuechanged_callback), DW_POINTER(status1));
1063 dw_signal_connect(imagestretchcheck, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(refresh_callback), NULL); 1063 dw_signal_connect(imagestretchcheck, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(refresh_callback), NULL);
1064 dw_signal_connect(button1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(refresh_callback), NULL); 1064 dw_signal_connect(button1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(refresh_callback), NULL);
1065 dw_signal_connect(button2, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(print_callback), NULL); 1065 dw_signal_connect(button2, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(print_callback), NULL);
1066 dw_signal_connect(rendcombo, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(render_select_event_callback), NULL ); 1066 dw_signal_connect(rendcombo, DW_SIGNAL_LIST_SELECT, DW_SIGNAL_FUNC(render_select_event_callback), NULL );
1067 dw_signal_connect(mainwindow, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(keypress_callback), NULL); 1067 dw_signal_connect(mainwindow, DW_SIGNAL_KEY_PRESS, DW_SIGNAL_FUNC(keypress_callback), NULL);
1090 /* and a status area to see whats going on */ 1090 /* and a status area to see whats going on */
1091 tree_status = dw_status_text_new("", 0); 1091 tree_status = dw_status_text_new("", 0);
1092 dw_box_pack_start( notebookbox3, tree_status, 100, 20, TRUE, FALSE, 1); 1092 dw_box_pack_start( notebookbox3, tree_status, 100, 20, TRUE, FALSE, 1);
1093 1093
1094 /* set up our signal trappers... */ 1094 /* set up our signal trappers... */
1095 dw_signal_connect(tree, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), (void *)tree_status); 1095 dw_signal_connect(tree, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(tree_status));
1096 dw_signal_connect(tree, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(item_select_cb), (void *)tree_status); 1096 dw_signal_connect(tree, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(item_select_cb), DW_POINTER(tree_status));
1097 1097
1098 t1 = dw_tree_insert(tree, "tree folder 1", foldericon, NULL, (void *)1 ); 1098 t1 = dw_tree_insert(tree, "tree folder 1", foldericon, NULL, DW_INT_TO_POINTER(1) );
1099 t2 = dw_tree_insert(tree, "tree folder 2", foldericon, NULL, (void *)2 ); 1099 t2 = dw_tree_insert(tree, "tree folder 2", foldericon, NULL, DW_INT_TO_POINTER(2) );
1100 dw_tree_insert(tree, "tree file 1", fileicon, t1, (void *)3 ); 1100 dw_tree_insert(tree, "tree file 1", fileicon, t1, DW_INT_TO_POINTER(3) );
1101 dw_tree_insert(tree, "tree file 2", fileicon, t1, (void *)4 ); 1101 dw_tree_insert(tree, "tree file 2", fileicon, t1, DW_INT_TO_POINTER(4) );
1102 dw_tree_insert(tree, "tree file 3", fileicon, t2, (void *)5 ); 1102 dw_tree_insert(tree, "tree file 3", fileicon, t2, DW_INT_TO_POINTER(5) );
1103 dw_tree_insert(tree, "tree file 4", fileicon, t2, (void *)6 ); 1103 dw_tree_insert(tree, "tree file 4", fileicon, t2, DW_INT_TO_POINTER(6) );
1104 /* set the folder name and icon again to show error with dw_tree_item_change under GTK 2.0 */
1105 dw_tree_item_change(tree, t1, "tree folder 1", foldericon ); 1104 dw_tree_item_change(tree, t1, "tree folder 1", foldericon );
1106 dw_tree_item_change(tree, t2, "tree folder 2", foldericon ); 1105 dw_tree_item_change(tree, t2, "tree folder 2", foldericon );
1107 } 1106 }
1108 1107
1109 void container_add(void) 1108 void container_add(void)
1120 CDATE date; 1119 CDATE date;
1121 unsigned long size, newpoint; 1120 unsigned long size, newpoint;
1122 HICN thisicon; 1121 HICN thisicon;
1123 1122
1124 /* create a box to pack into the notebook page */ 1123 /* create a box to pack into the notebook page */
1125 containerbox = dw_box_new(BOXHORZ, 2); 1124 containerbox = dw_box_new(DW_HORZ, 2);
1126 dw_box_pack_start( notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0); 1125 dw_box_pack_start( notebookbox4, containerbox, 500, 200, TRUE, TRUE, 0);
1127 1126
1128 /* now a container area under this box */ 1127 /* now a container area under this box */
1129 container = dw_container_new(100, TRUE); 1128 container = dw_container_new(100, TRUE);
1130 dw_box_pack_start( notebookbox4, container, 500, 200, TRUE, FALSE, 1); 1129 dw_box_pack_start( notebookbox4, container, 500, 200, TRUE, FALSE, 1);
1198 mle_point = (int)newpoint; 1197 mle_point = (int)newpoint;
1199 sprintf(buffer, "[%d]\r\n\r\n", mle_point); 1198 sprintf(buffer, "[%d]\r\n\r\n", mle_point);
1200 mle_point = dw_mle_import(container_mle, buffer, mle_point); 1199 mle_point = dw_mle_import(container_mle, buffer, mle_point);
1201 dw_mle_set_cursor(container_mle, mle_point); 1200 dw_mle_set_cursor(container_mle, mle_point);
1202 /* connect our event trappers... */ 1201 /* connect our event trappers... */
1203 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), (void *)container_status); 1202 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), DW_POINTER(container_status));
1204 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), (void *)container_status); 1203 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(container_status));
1205 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), (void *)container_status); 1204 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), DW_POINTER(container_status));
1206 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_cb), (void *)container_status); 1205 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_cb), DW_POINTER(container_status));
1207 } 1206 }
1208 1207
1209 /* Beep every second */ 1208 /* Beep every second */
1210 int DWSIGNAL timer_callback(void *data) 1209 int DWSIGNAL timer_callback(void *data)
1211 { 1210 {
1221 HWND abutton1,abutton2,calbox; 1220 HWND abutton1,abutton2,calbox;
1222 int i; 1221 int i;
1223 char **text; 1222 char **text;
1224 1223
1225 /* create a box to pack into the notebook page */ 1224 /* create a box to pack into the notebook page */
1226 buttonsbox = dw_box_new(BOXVERT, 2); 1225 buttonsbox = dw_box_new(DW_VERT, 2);
1227 dw_box_pack_start( notebookbox5, buttonsbox, 25, 200, TRUE, TRUE, 0); 1226 dw_box_pack_start( notebookbox5, buttonsbox, 25, 200, TRUE, TRUE, 0);
1228 dw_window_set_color(buttonsbox, DW_CLR_RED, DW_CLR_RED); 1227 dw_window_set_color(buttonsbox, DW_CLR_RED, DW_CLR_RED);
1229 1228
1230 calbox = dw_box_new(DW_HORZ, 0); 1229 calbox = dw_box_new(DW_HORZ, 0);
1231 dw_box_pack_start(notebookbox5, calbox, 500, 200, TRUE, TRUE, 1); 1230 dw_box_pack_start(notebookbox5, calbox, 500, 200, TRUE, TRUE, 1);
1235 dw_calendar_set_date(cal, 2001, 1, 1); 1234 dw_calendar_set_date(cal, 2001, 1, 1);
1236 */ 1235 */
1237 /* 1236 /*
1238 * Create our file toolbar boxes... 1237 * Create our file toolbar boxes...
1239 */ 1238 */
1240 buttonboxperm = dw_box_new( BOXVERT, 0 ); 1239 buttonboxperm = dw_box_new( DW_VERT, 0 );
1241 dw_box_pack_start( buttonsbox, buttonboxperm, 25, 0, FALSE, TRUE, 2 ); 1240 dw_box_pack_start( buttonsbox, buttonboxperm, 25, 0, FALSE, TRUE, 2 );
1242 dw_window_set_color(buttonboxperm, DW_CLR_WHITE, DW_CLR_WHITE); 1241 dw_window_set_color(buttonboxperm, DW_CLR_WHITE, DW_CLR_WHITE);
1243 // abutton1 = dw_bitmapbutton_new_from_file( "Top Button", 0, FILE_ICON_NAME ); 1242 // abutton1 = dw_bitmapbutton_new_from_file( "Top Button", 0, FILE_ICON_NAME );
1244 abutton1 = dw_bitmapbutton_new_from_file( "Top Button", 0, "z:\\projects\\RexxGd\\regina\\tile_up.png" ); 1243 abutton1 = dw_bitmapbutton_new_from_file( "Top Button", 0, "z:\\projects\\RexxGd\\regina\\tile_up.png" );
1245 dw_box_pack_start( buttonboxperm, abutton1, 100, 30, FALSE, FALSE, 0 ); 1244 dw_box_pack_start( buttonboxperm, abutton1, 100, 30, FALSE, FALSE, 0 );
1249 dw_box_pack_start( buttonsbox, abutton2, 25, 25, FALSE, FALSE, 0 ); 1248 dw_box_pack_start( buttonsbox, abutton2, 25, 25, FALSE, FALSE, 0 );
1250 dw_signal_connect( abutton2, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(button_callback), NULL ); 1249 dw_signal_connect( abutton2, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(button_callback), NULL );
1251 1250
1252 create_button(0); 1251 create_button(0);
1253 /* make a combobox */ 1252 /* make a combobox */
1254 combox = dw_box_new(BOXVERT, 2); 1253 combox = dw_box_new(DW_VERT, 2);
1255 dw_box_pack_start( notebookbox5, combox, 25, 200, TRUE, FALSE, 0); 1254 dw_box_pack_start( notebookbox5, combox, 25, 200, TRUE, FALSE, 0);
1256 combobox1 = dw_combobox_new( "fred", 0 ); /* no point in specifying an initial value */ 1255 combobox1 = dw_combobox_new( "fred", 0 ); /* no point in specifying an initial value */
1257 dw_listbox_append( combobox1, "fred" ); 1256 dw_listbox_append( combobox1, "fred" );
1258 dw_box_pack_start( combox, combobox1, -1, -1, TRUE, FALSE, 0); 1257 dw_box_pack_start( combox, combobox1, -1, -1, TRUE, FALSE, 0);
1259 /* 1258 /*
1311 } 1310 }
1312 1311
1313 void create_button( int redraw) 1312 void create_button( int redraw)
1314 { 1313 {
1315 HWND abutton1; 1314 HWND abutton1;
1316 filetoolbarbox = dw_box_new( BOXVERT, 0 ); 1315 filetoolbarbox = dw_box_new( DW_VERT, 0 );
1317 dw_box_pack_start( buttonboxperm, filetoolbarbox, 0, 0, TRUE, TRUE, 0 ); 1316 dw_box_pack_start( buttonboxperm, filetoolbarbox, 0, 0, TRUE, TRUE, 0 );
1318 1317
1319 abutton1 = dw_bitmapbutton_new_from_file( "Should be under Top button", 0, "junk" ); 1318 abutton1 = dw_bitmapbutton_new_from_file( "Should be under Top button", 0, "junk" );
1320 dw_box_pack_start( filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0); 1319 dw_box_pack_start( filetoolbarbox, abutton1, 25, 25, FALSE, FALSE, 0);
1321 dw_signal_connect( abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(change_color_red_callback), NULL ); 1320 dw_signal_connect( abutton1, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(change_color_red_callback), NULL );
1375 1374
1376 mainmenubar = dw_menubar_new( mainwindow ); 1375 mainmenubar = dw_menubar_new( mainwindow );
1377 /* add menus to the menubar */ 1376 /* add menus to the menubar */
1378 menu = dw_menu_new( 0 ); 1377 menu = dw_menu_new( 0 );
1379 menuitem = dw_menu_append_item( menu, "~Quit", 1019, 0, TRUE, FALSE, 0 ); 1378 menuitem = dw_menu_append_item( menu, "~Quit", 1019, 0, TRUE, FALSE, 0 );
1380 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); 1379 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow));
1381 /* 1380 /*
1382 * Add the "File" menu to the menubar... 1381 * Add the "File" menu to the menubar...
1383 */ 1382 */
1384 dw_menu_append_item( mainmenubar, "~File", 1010, 0, TRUE, FALSE, menu ); 1383 dw_menu_append_item( mainmenubar, "~File", 1010, 0, TRUE, FALSE, menu );
1385 1384
1386 changeable_menu = dw_menu_new( 0 ); 1385 changeable_menu = dw_menu_new( 0 );
1387 checkable_menuitem = dw_menu_append_item( changeable_menu, "~Checkable Menu Item", CHECKABLE_MENUITEMID, 0, TRUE, TRUE, 0 ); 1386 checkable_menuitem = dw_menu_append_item( changeable_menu, "~Checkable Menu Item", CHECKABLE_MENUITEMID, 0, TRUE, TRUE, 0 );
1388 dw_signal_connect( checkable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), (void *)"checkable"); 1387 dw_signal_connect( checkable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), DW_POINTER("checkable"));
1389 noncheckable_menuitem = dw_menu_append_item( changeable_menu, "~Non-checkable Menu Item", NONCHECKABLE_MENUITEMID, 0, TRUE, FALSE, 0 ); 1388 noncheckable_menuitem = dw_menu_append_item( changeable_menu, "~Non-checkable Menu Item", NONCHECKABLE_MENUITEMID, 0, TRUE, FALSE, 0 );
1390 dw_signal_connect( noncheckable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), (void *)"non-checkable"); 1389 dw_signal_connect( noncheckable_menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menu_callback), DW_POINTER("non-checkable"));
1391 dw_menu_append_item( changeable_menu, "~Disabled menu Item", 2003, DW_MIS_DISABLED|DW_MIS_CHECKED, TRUE, TRUE, 0 ); 1390 dw_menu_append_item( changeable_menu, "~Disabled menu Item", 2003, DW_MIS_DISABLED|DW_MIS_CHECKED, TRUE, TRUE, 0 );
1392 /* seperator */ 1391 /* seperator */
1393 dw_menu_append_item( changeable_menu, DW_MENU_SEPARATOR, 3999, 0, TRUE, FALSE, 0 ); 1392 dw_menu_append_item( changeable_menu, DW_MENU_SEPARATOR, 3999, 0, TRUE, FALSE, 0 );
1394 menuitem = dw_menu_append_item( changeable_menu, "~Menu Items Disabled", 2009, 0, TRUE, TRUE, 0 ); 1393 menuitem = dw_menu_append_item( changeable_menu, "~Menu Items Disabled", 2009, 0, TRUE, TRUE, 0 );
1395 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menutoggle_callback), (void *)NULL); 1394 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(menutoggle_callback), NULL);
1396 /* 1395 /*
1397 * Add the "Menu" menu to the menubar... 1396 * Add the "Menu" menu to the menubar...
1398 */ 1397 */
1399 dw_menu_append_item( mainmenubar, "~Menu", 1020, 0, TRUE, FALSE, changeable_menu ); 1398 dw_menu_append_item( mainmenubar, "~Menu", 1020, 0, TRUE, FALSE, changeable_menu );
1400 1399
1401 menu = dw_menu_new( 0 ); 1400 menu = dw_menu_new( 0 );
1402 menuitem = dw_menu_append_item( menu, "~About", 1091, 0, TRUE, FALSE, 0 ); 1401 menuitem = dw_menu_append_item( menu, "~About", 1091, 0, TRUE, FALSE, 0 );
1403 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(helpabout_callback), (void *)mainwindow); 1402 dw_signal_connect( menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(helpabout_callback), DW_POINTER(mainwindow));
1404 /* 1403 /*
1405 * Add the "Help" menu to the menubar... 1404 * Add the "Help" menu to the menubar...
1406 */ 1405 */
1407 dw_menu_append_item( mainmenubar, "~Help", 1090, 0, TRUE, FALSE, menu ); 1406 dw_menu_append_item( mainmenubar, "~Help", 1090, 0, TRUE, FALSE, menu );
1408 } 1407 }
1635 mainwindow = dw_window_new( HWND_DESKTOP, "dwindows test UTF8 中国語 (繁体) cañón", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX); 1634 mainwindow = dw_window_new( HWND_DESKTOP, "dwindows test UTF8 中国語 (繁体) cañón", flStyle | DW_FCF_SIZEBORDER | DW_FCF_MINMAX);
1636 dw_window_set_icon(mainwindow, fileicon); 1635 dw_window_set_icon(mainwindow, fileicon);
1637 1636
1638 menu_add(); 1637 menu_add();
1639 1638
1640 notebookbox = dw_box_new( BOXVERT, 5 ); 1639 notebookbox = dw_box_new( DW_VERT, 5 );
1641 dw_box_pack_start( mainwindow, notebookbox, 0, 0, TRUE, TRUE, 0); 1640 dw_box_pack_start( mainwindow, notebookbox, 0, 0, TRUE, TRUE, 0);
1642 1641
1643 foldericon = dw_icon_load_from_file( FOLDER_ICON_NAME ); 1642 foldericon = dw_icon_load_from_file( FOLDER_ICON_NAME );
1644 fileicon = dw_icon_load_from_file( FILE_ICON_NAME ); 1643 fileicon = dw_icon_load_from_file( FILE_ICON_NAME );
1645 1644
1646 notebook = dw_notebook_new( 1, TRUE ); 1645 notebook = dw_notebook_new( 1, TRUE );
1647 dw_box_pack_start( notebookbox, notebook, 100, 100, TRUE, TRUE, 0); 1646 dw_box_pack_start( notebookbox, notebook, 100, 100, TRUE, TRUE, 0);
1648 dw_signal_connect(notebook, DW_SIGNAL_SWITCH_PAGE, DW_SIGNAL_FUNC(switch_page_cb), NULL); 1647 dw_signal_connect(notebook, DW_SIGNAL_SWITCH_PAGE, DW_SIGNAL_FUNC(switch_page_cb), NULL);
1649 1648
1650 notebookbox1 = dw_box_new( BOXVERT, 5 ); 1649 notebookbox1 = dw_box_new( DW_VERT, 5 );
1651 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE ); 1650 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE );
1652 dw_notebook_pack( notebook, notebookpage1, notebookbox1 ); 1651 dw_notebook_pack( notebook, notebookpage1, notebookbox1 );
1653 dw_notebook_page_set_text( notebook, notebookpage1, "buttons and entry"); 1652 dw_notebook_page_set_text( notebook, notebookpage1, "buttons and entry");
1654 archive_add(); 1653 archive_add();
1655 1654
1656 notebookbox2 = dw_box_new( BOXVERT, 5 ); 1655 notebookbox2 = dw_box_new( DW_VERT, 5 );
1657 notebookpage2 = dw_notebook_page_new( notebook, 1, FALSE ); 1656 notebookpage2 = dw_notebook_page_new( notebook, 1, FALSE );
1658 dw_notebook_pack( notebook, notebookpage2, notebookbox2 ); 1657 dw_notebook_pack( notebook, notebookpage2, notebookbox2 );
1659 dw_notebook_page_set_text( notebook, notebookpage2, "render"); 1658 dw_notebook_page_set_text( notebook, notebookpage2, "render");
1660 text_add(); 1659 text_add();
1661 1660
1662 notebookbox3 = dw_box_new( BOXVERT, 5 ); 1661 notebookbox3 = dw_box_new( DW_VERT, 5 );
1663 notebookpage3 = dw_notebook_page_new( notebook, 1, FALSE ); 1662 notebookpage3 = dw_notebook_page_new( notebook, 1, FALSE );
1664 dw_notebook_pack( notebook, notebookpage3, notebookbox3 ); 1663 dw_notebook_pack( notebook, notebookpage3, notebookbox3 );
1665 dw_notebook_page_set_text( notebook, notebookpage3, "tree"); 1664 dw_notebook_page_set_text( notebook, notebookpage3, "tree");
1666 tree_add(); 1665 tree_add();
1667 1666
1668 notebookbox4 = dw_box_new( BOXVERT, 5 ); 1667 notebookbox4 = dw_box_new( DW_VERT, 5 );
1669 notebookpage4 = dw_notebook_page_new( notebook, 1, FALSE ); 1668 notebookpage4 = dw_notebook_page_new( notebook, 1, FALSE );
1670 dw_notebook_pack( notebook, notebookpage4, notebookbox4 ); 1669 dw_notebook_pack( notebook, notebookpage4, notebookbox4 );
1671 dw_notebook_page_set_text( notebook, notebookpage4, "container"); 1670 dw_notebook_page_set_text( notebook, notebookpage4, "container");
1672 container_add(); 1671 container_add();
1673 1672
1674 notebookbox5 = dw_box_new( BOXVERT, 5 ); 1673 notebookbox5 = dw_box_new( DW_VERT, 5 );
1675 notebookpage5 = dw_notebook_page_new( notebook, 1, FALSE ); 1674 notebookpage5 = dw_notebook_page_new( notebook, 1, FALSE );
1676 dw_notebook_pack( notebook, notebookpage5, notebookbox5 ); 1675 dw_notebook_pack( notebook, notebookpage5, notebookbox5 );
1677 dw_notebook_page_set_text( notebook, notebookpage5, "buttons"); 1676 dw_notebook_page_set_text( notebook, notebookpage5, "buttons");
1678 buttons_add(); 1677 buttons_add();
1679 1678
1680 notebookbox6 = dw_box_new( BOXVERT, 5 ); 1679 notebookbox6 = dw_box_new( DW_VERT, 5 );
1681 notebookpage6 = dw_notebook_page_new( notebook, 1, FALSE ); 1680 notebookpage6 = dw_notebook_page_new( notebook, 1, FALSE );
1682 dw_notebook_pack( notebook, notebookpage6, notebookbox6 ); 1681 dw_notebook_pack( notebook, notebookpage6, notebookbox6 );
1683 dw_notebook_page_set_text( notebook, notebookpage6, "mdi"); 1682 dw_notebook_page_set_text( notebook, notebookpage6, "mdi");
1684 mdi_add(); 1683 mdi_add();
1685 1684
1686 notebookbox7 = dw_box_new( BOXVERT, 6 ); 1685 notebookbox7 = dw_box_new( DW_VERT, 6 );
1687 notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE ); 1686 notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE );
1688 dw_notebook_pack( notebook, notebookpage7, notebookbox7 ); 1687 dw_notebook_pack( notebook, notebookpage7, notebookbox7 );
1689 dw_notebook_page_set_text( notebook, notebookpage7, "html"); 1688 dw_notebook_page_set_text( notebook, notebookpage7, "html");
1690 1689
1691 rawhtml = dw_html_new(1001); 1690 rawhtml = dw_html_new(1001);
1701 { 1700 {
1702 html = dw_text_new("HTML widget not available.", 0); 1701 html = dw_text_new("HTML widget not available.", 0);
1703 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0); 1702 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0);
1704 } 1703 }
1705 1704
1706 notebookbox8 = dw_box_new( BOXVERT, 7 ); 1705 notebookbox8 = dw_box_new( DW_VERT, 7 );
1707 notebookpage8 = dw_notebook_page_new( notebook, 1, FALSE ); 1706 notebookpage8 = dw_notebook_page_new( notebook, 1, FALSE );
1708 dw_notebook_pack( notebook, notebookpage8, notebookbox8 ); 1707 dw_notebook_pack( notebook, notebookpage8, notebookbox8 );
1709 dw_notebook_page_set_text( notebook, notebookpage8, "scrollbox"); 1708 dw_notebook_page_set_text( notebook, notebookpage8, "scrollbox");
1710 scrollbox_add(); 1709 scrollbox_add();
1711 1710
1712 notebookbox9 = dw_box_new( BOXVERT, 8 ); 1711 notebookbox9 = dw_box_new( DW_VERT, 8 );
1713 notebookpage9 = dw_notebook_page_new( notebook, 1, FALSE ); 1712 notebookpage9 = dw_notebook_page_new( notebook, 1, FALSE );
1714 dw_notebook_pack( notebook, notebookpage9, notebookbox9 ); 1713 dw_notebook_pack( notebook, notebookpage9, notebookbox9 );
1715 dw_notebook_page_set_text( notebook, notebookpage9, "thread/event"); 1714 dw_notebook_page_set_text( notebook, notebookpage9, "thread/event");
1716 thread_add(); 1715 thread_add();
1717 1716
1718 dw_signal_connect(mainwindow, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), (void *)mainwindow); 1717 dw_signal_connect(mainwindow, DW_SIGNAL_DELETE, DW_SIGNAL_FUNC(exit_callback), DW_POINTER(mainwindow));
1719 timerid = dw_timer_connect(2000, DW_SIGNAL_FUNC(timer_callback), 0); 1718 timerid = dw_timer_connect(2000, DW_SIGNAL_FUNC(timer_callback), 0);
1720 dw_window_set_size(mainwindow, 640, 520); 1719 dw_window_set_size(mainwindow, 640, 520);
1721 dw_window_show(mainwindow); 1720 dw_window_show(mainwindow);
1722 1721
1723 /* Now that the window is created and shown... 1722 /* Now that the window is created and shown...