Mercurial > dwindows
comparison dwtest.c @ 2462:596bbc06e134
Add a sample popup menu to the container widget for testing purposes.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 14 Apr 2021 17:40:49 +0000 |
parents | 44b77654c406 |
children | fa976a5bc7bd |
comparison
equal
deleted
inserted
replaced
2461:7c716b48e5b5 | 2462:596bbc06e134 |
---|---|
767 int DWSIGNAL item_enter_cb(HWND window, char *text, void *data, void *itemdata) | 767 int DWSIGNAL item_enter_cb(HWND window, char *text, void *data, void *itemdata) |
768 { | 768 { |
769 char buf[200]; | 769 char buf[200]; |
770 HWND statline = (HWND)data; | 770 HWND statline = (HWND)data; |
771 | 771 |
772 sprintf(buf,"DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), text, DW_POINTER_TO_UINT(itemdata) ); | 772 sprintf(buf,"DW_SIGNAL_ITEM_ENTER: Window: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), text, DW_POINTER_TO_UINT(itemdata)); |
773 dw_window_set_text( statline, buf); | 773 dw_window_set_text(statline, buf); |
774 return 0; | 774 return 0; |
775 } | 775 } |
776 | 776 |
777 int DWSIGNAL item_context_cb(HWND window, char *text, int x, int y, void *data, void *itemdata) | 777 /* Context menus */ |
778 int DWSIGNAL context_menu_cb(HWND hwnd, void *data) | |
778 { | 779 { |
779 char buf[200]; | 780 char buf[200]; |
780 HWND statline = (HWND)data; | 781 HWND statline = (HWND)data; |
781 | 782 |
782 sprintf(buf,"DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", DW_POINTER_TO_UINT(window), text, x, y, DW_POINTER_TO_UINT(itemdata) ); | 783 sprintf(buf,"DW_SIGNAL_CLICKED: Menu: %x Container context menu clicked", DW_POINTER_TO_UINT(hwnd)); |
783 dw_window_set_text( statline, buf); | 784 dw_window_set_text(statline, buf); |
784 return 0; | 785 return 0; |
785 } | 786 } |
786 | 787 |
787 int DWSIGNAL list_select_cb(HWND window, int item, void *data) | 788 HMENUI item_context_menu_new(char *text, void *data) |
789 { | |
790 HMENUI hwndMenu = dw_menu_new(0L); | |
791 HMENUI hwndSubMenu = dw_menu_new(0L); | |
792 HWND menuitem = dw_menu_append_item(hwndSubMenu, "File", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); | |
793 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
794 menuitem = dw_menu_append_item(hwndSubMenu, "Date", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); | |
795 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
796 menuitem = dw_menu_append_item(hwndSubMenu, "Size", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); | |
797 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
798 menuitem = dw_menu_append_item(hwndSubMenu, "None", DW_MENU_POPUP, 0L, TRUE, TRUE, DW_NOMENU); | |
799 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
800 | |
801 menuitem = dw_menu_append_item(hwndMenu, "Sort", DW_MENU_POPUP, 0L, TRUE, FALSE, hwndSubMenu); | |
802 | |
803 menuitem = dw_menu_append_item(hwndMenu, "Make Directory", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); | |
804 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
805 | |
806 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, DW_NOMENU); | |
807 menuitem = dw_menu_append_item(hwndMenu, "Rename Entry", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); | |
808 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
809 | |
810 menuitem = dw_menu_append_item(hwndMenu, "Delete Entry", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); | |
811 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
812 | |
813 dw_menu_append_item(hwndMenu, "", 0L, 0L, TRUE, FALSE, DW_NOMENU); | |
814 menuitem = dw_menu_append_item(hwndMenu, "View File", DW_MENU_POPUP, 0L, TRUE, FALSE, DW_NOMENU); | |
815 dw_signal_connect(menuitem, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(context_menu_cb), data); | |
816 | |
817 return hwndMenu; | |
818 } | |
819 | |
820 int DWSIGNAL item_context_cb(HWND window, char *text, int x, int y, void *data, void *itemdata) | |
788 { | 821 { |
789 char buf[200]; | 822 char buf[200]; |
790 HWND statline = (HWND)data; | 823 HWND statline = (HWND)data; |
791 | 824 HMENUI popupmenu = item_context_menu_new(text, data); |
792 sprintf(buf,"DW_SIGNAL_LIST_SELECT: Window: %d Item: %d", DW_POINTER_TO_UINT(window), item ); | 825 |
793 dw_window_set_text( statline, buf); | 826 sprintf(buf,"DW_SIGNAL_ITEM_CONTEXT: Window: %x Text: %s x: %d y: %d Itemdata: %x", DW_POINTER_TO_UINT(window), text, x, y, DW_POINTER_TO_UINT(itemdata)); |
794 return 0; | 827 dw_window_set_text(statline, buf); |
795 } | 828 dw_menu_popup(&popupmenu, mainwindow, x, y); |
796 | 829 return 0; |
797 int DWSIGNAL item_select_cb(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) | 830 } |
831 | |
832 int DWSIGNAL list_select_cb(HWND window, int item, void *data) | |
798 { | 833 { |
799 char buf[200]; | 834 char buf[200]; |
800 HWND statline = (HWND)data; | 835 HWND statline = (HWND)data; |
801 | 836 |
837 sprintf(buf,"DW_SIGNAL_LIST_SELECT: Window: %d Item: %d", DW_POINTER_TO_UINT(window), item); | |
838 dw_window_set_text(statline, buf); | |
839 return 0; | |
840 } | |
841 | |
842 int DWSIGNAL item_select_cb(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) | |
843 { | |
844 char buf[200]; | |
845 HWND statline = (HWND)data; | |
846 | |
802 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), | 847 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), |
803 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata) ); | 848 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata)); |
804 dw_window_set_text( statline, buf); | 849 dw_window_set_text(statline, buf); |
805 return 0; | 850 return 0; |
806 } | 851 } |
807 | 852 |
808 int DWSIGNAL container_select_cb(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) | 853 int DWSIGNAL container_select_cb(HWND window, HTREEITEM item, char *text, void *data, void *itemdata) |
809 { | 854 { |
811 char *str; | 856 char *str; |
812 HWND statline = (HWND)data; | 857 HWND statline = (HWND)data; |
813 unsigned long size; | 858 unsigned long size; |
814 | 859 |
815 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), | 860 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", DW_POINTER_TO_UINT(window), |
816 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata) ); | 861 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata)); |
817 dw_window_set_text( statline, buf); | 862 dw_window_set_text( statline, buf); |
818 sprintf(buf,"\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", DW_POINTER_TO_UINT(window), | 863 sprintf(buf,"\r\nDW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x\r\n", DW_POINTER_TO_UINT(window), |
819 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata) ); | 864 DW_POINTER_TO_UINT(item), text, DW_POINTER_TO_UINT(itemdata)); |
820 mle_point = dw_mle_import( container_mle, buf, mle_point); | 865 mle_point = dw_mle_import( container_mle, buf, mle_point); |
821 str = dw_container_query_start(container, DW_CRA_SELECTED); | 866 str = dw_container_query_start(container, DW_CRA_SELECTED); |
822 while(str) | 867 while(str) |
823 { | 868 { |
824 sprintf(buf,"Selected: %s\r\n", str); | 869 sprintf(buf,"Selected: %s\r\n", str); |
840 } | 885 } |
841 | 886 |
842 int DWSIGNAL switch_page_cb(HWND window, unsigned long page_num, void *itemdata) | 887 int DWSIGNAL switch_page_cb(HWND window, unsigned long page_num, void *itemdata) |
843 { | 888 { |
844 dw_debug("DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %u Itemdata: %x\n", DW_POINTER_TO_UINT(window), | 889 dw_debug("DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %u Itemdata: %x\n", DW_POINTER_TO_UINT(window), |
845 DW_POINTER_TO_UINT(page_num), DW_POINTER_TO_UINT(itemdata) ); | 890 DW_POINTER_TO_UINT(page_num), DW_POINTER_TO_UINT(itemdata)); |
846 return 0; | 891 return 0; |
847 } | 892 } |
848 | 893 |
849 int DWSIGNAL column_click_cb(HWND window, int column_num, void *data) | 894 int DWSIGNAL column_click_cb(HWND window, int column_num, void *data) |
850 { | 895 { |
1072 dw_listbox_append(rendcombo, "Shapes Double Buffered"); | 1117 dw_listbox_append(rendcombo, "Shapes Double Buffered"); |
1073 dw_listbox_append(rendcombo, "Shapes Direct"); | 1118 dw_listbox_append(rendcombo, "Shapes Direct"); |
1074 dw_listbox_append(rendcombo, "File Display"); | 1119 dw_listbox_append(rendcombo, "File Display"); |
1075 label = dw_text_new("Image X:", 100); | 1120 label = dw_text_new("Image X:", 100); |
1076 dw_window_set_style(label, DW_DT_VCENTER | DW_DT_CENTER, DW_DT_VCENTER | DW_DT_CENTER); | 1121 dw_window_set_style(label, DW_DT_VCENTER | DW_DT_CENTER, DW_DT_VCENTER | DW_DT_CENTER); |
1077 dw_box_pack_start( hbox, label, -1, 25, FALSE, TRUE, 0); | 1122 dw_box_pack_start(hbox, label, -1, 25, FALSE, TRUE, 0); |
1078 imagexspin = dw_spinbutton_new("20", 1021); | 1123 imagexspin = dw_spinbutton_new("20", 1021); |
1079 dw_box_pack_start( hbox, imagexspin, 25, 25, TRUE, TRUE, 0); | 1124 dw_box_pack_start(hbox, imagexspin, 25, 25, TRUE, TRUE, 0); |
1080 label = dw_text_new("Y:", 100); | 1125 label = dw_text_new("Y:", 100); |
1081 dw_window_set_style(label, DW_DT_VCENTER | DW_DT_CENTER, DW_DT_VCENTER | DW_DT_CENTER); | 1126 dw_window_set_style(label, DW_DT_VCENTER | DW_DT_CENTER, DW_DT_VCENTER | DW_DT_CENTER); |
1082 dw_box_pack_start( hbox, label, -1, 25, FALSE, TRUE, 0); | 1127 dw_box_pack_start(hbox, label, -1, 25, FALSE, TRUE, 0); |
1083 imageyspin = dw_spinbutton_new("20", 1021); | 1128 imageyspin = dw_spinbutton_new("20", 1021); |
1084 dw_box_pack_start( hbox, imageyspin, 25, 25, TRUE, TRUE, 0); | 1129 dw_box_pack_start(hbox, imageyspin, 25, 25, TRUE, TRUE, 0); |
1085 dw_spinbutton_set_limits(imagexspin, 2000, 0); | 1130 dw_spinbutton_set_limits(imagexspin, 2000, 0); |
1086 dw_spinbutton_set_limits(imageyspin, 2000, 0); | 1131 dw_spinbutton_set_limits(imageyspin, 2000, 0); |
1087 dw_spinbutton_set_pos(imagexspin, 20); | 1132 dw_spinbutton_set_pos(imagexspin, 20); |
1088 dw_spinbutton_set_pos(imageyspin, 20); | 1133 dw_spinbutton_set_pos(imageyspin, 20); |
1089 imagestretchcheck = dw_checkbox_new("Stretch", 1021); | 1134 imagestretchcheck = dw_checkbox_new("Stretch", 1021); |
1090 dw_box_pack_start( hbox, imagestretchcheck, -1, 25, FALSE, TRUE, 0); | 1135 dw_box_pack_start(hbox, imagestretchcheck, -1, 25, FALSE, TRUE, 0); |
1091 | 1136 |
1092 button1 = dw_button_new("Refresh", 1223L ); | 1137 button1 = dw_button_new("Refresh", 1223L ); |
1093 dw_box_pack_start( hbox, button1, 100, 25, FALSE, TRUE, 0); | 1138 dw_box_pack_start(hbox, button1, 100, 25, FALSE, TRUE, 0); |
1094 button2 = dw_button_new("Print", 1224L ); | 1139 button2 = dw_button_new("Print", 1224L ); |
1095 dw_box_pack_start( hbox, button2, 100, 25, FALSE, TRUE, 0); | 1140 dw_box_pack_start(hbox, button2, 100, 25, FALSE, TRUE, 0); |
1096 | 1141 |
1097 /* Pre-create the scrollbars so we can query their sizes */ | 1142 /* Pre-create the scrollbars so we can query their sizes */ |
1098 vscrollbar = dw_scrollbar_new(DW_VERT, 50); | 1143 vscrollbar = dw_scrollbar_new(DW_VERT, 50); |
1099 hscrollbar = dw_scrollbar_new(DW_HORZ, 50); | 1144 hscrollbar = dw_scrollbar_new(DW_HORZ, 50); |
1100 dw_window_get_preferred_size(vscrollbar, &vscrollbarwidth, NULL); | 1145 dw_window_get_preferred_size(vscrollbar, &vscrollbarwidth, NULL); |
1217 dw_tree_insert(tree, "tree file 4", fileicon, t2, DW_INT_TO_POINTER(6)); | 1262 dw_tree_insert(tree, "tree file 4", fileicon, t2, DW_INT_TO_POINTER(6)); |
1218 dw_tree_item_change(tree, t1, "tree folder 1", foldericon); | 1263 dw_tree_item_change(tree, t1, "tree folder 1", foldericon); |
1219 dw_tree_item_change(tree, t2, "tree folder 2", foldericon); | 1264 dw_tree_item_change(tree, t2, "tree folder 2", foldericon); |
1220 dw_tree_item_set_data(tree, t2, DW_INT_TO_POINTER(100)); | 1265 dw_tree_item_set_data(tree, t2, DW_INT_TO_POINTER(100)); |
1221 title = dw_tree_get_title(tree, t1); | 1266 title = dw_tree_get_title(tree, t1); |
1222 dw_debug("t1 title \"%s\" data %d t2 data %d\n", title, DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t1)), DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t2))); | 1267 dw_debug("t1 title \"%s\" data %d t2 data %d\n", title, DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t1)), |
1268 DW_POINTER_TO_INT(dw_tree_item_get_data(tree, t2))); | |
1223 dw_free(title); | 1269 dw_free(title); |
1224 } | 1270 } |
1225 else | 1271 else |
1226 { | 1272 { |
1227 tree = dw_text_new("Tree widget not available.", 0); | 1273 tree = dw_text_new("Tree widget not available.", 0); |
1383 | 1429 |
1384 void container_add(void) | 1430 void container_add(void) |
1385 { | 1431 { |
1386 char *titles[4]; | 1432 char *titles[4]; |
1387 char buffer[100]; | 1433 char buffer[100]; |
1388 unsigned long flags[4] = { DW_CFA_BITMAPORICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, | 1434 unsigned long flags[4] = { DW_CFA_BITMAPORICON | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
1389 DW_CFA_ULONG | DW_CFA_RIGHT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, | 1435 DW_CFA_ULONG | DW_CFA_RIGHT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
1390 DW_CFA_TIME | DW_CFA_CENTER | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, | 1436 DW_CFA_TIME | DW_CFA_CENTER | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR, |
1391 DW_CFA_DATE | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR }; | 1437 DW_CFA_DATE | DW_CFA_LEFT | DW_CFA_HORZSEPARATOR | DW_CFA_SEPARATOR }; |
1392 int z; | 1438 int z; |
1393 CTIME time; | 1439 CTIME time; |
1394 CDATE date; | 1440 CDATE date; |
1395 unsigned long size, newpoint; | 1441 unsigned long size, newpoint; |
1396 HICN thisicon; | 1442 HICN thisicon; |
1446 dw_window_set_data(hbox, "fontname", DW_POINTER(fontname)); | 1492 dw_window_set_data(hbox, "fontname", DW_POINTER(fontname)); |
1447 } | 1493 } |
1448 | 1494 |
1449 /* now a container area under this box */ | 1495 /* now a container area under this box */ |
1450 container = dw_container_new(100, TRUE); | 1496 container = dw_container_new(100, TRUE); |
1451 dw_box_pack_start( notebookbox4, container, 500, 200, TRUE, FALSE, 1); | 1497 dw_box_pack_start(notebookbox4, container, 500, 200, TRUE, FALSE, 1); |
1452 | 1498 |
1453 /* and a status area to see whats going on */ | 1499 /* and a status area to see whats going on */ |
1454 container_status = dw_status_text_new("", 0); | 1500 container_status = dw_status_text_new("", 0); |
1455 dw_box_pack_start( notebookbox4, container_status, 100, -1, TRUE, FALSE, 1); | 1501 dw_box_pack_start(notebookbox4, container_status, 100, -1, TRUE, FALSE, 1); |
1456 | 1502 |
1457 titles[0] = "Type"; | 1503 titles[0] = "Type"; |
1458 titles[1] = "Size"; | 1504 titles[1] = "Size"; |
1459 titles[2] = "Time"; | 1505 titles[2] = "Time"; |
1460 titles[3] = "Date"; | 1506 titles[3] = "Date"; |
1468 { | 1514 { |
1469 char names[100]; | 1515 char names[100]; |
1470 | 1516 |
1471 sprintf(names, "We can now allocate from the stack: Item: %d", z); | 1517 sprintf(names, "We can now allocate from the stack: Item: %d", z); |
1472 size = z*100; | 1518 size = z*100; |
1473 sprintf(buffer, "Filename %d",z+1); | 1519 sprintf(buffer, "Filename %d", z+1); |
1474 if (z == 0 ) thisicon = foldericon; | 1520 if (z == 0 ) thisicon = foldericon; |
1475 else thisicon = fileicon; | 1521 else thisicon = fileicon; |
1476 dw_debug("Initial: container: %x containerinfo: %x icon: %x\n", DW_POINTER_TO_INT(container), | 1522 dw_debug("Initial: container: %x containerinfo: %x icon: %x\n", DW_POINTER_TO_INT(container), |
1477 DW_POINTER_TO_INT(containerinfo), DW_POINTER_TO_INT(thisicon)); | 1523 DW_POINTER_TO_INT(containerinfo), DW_POINTER_TO_INT(thisicon)); |
1478 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon); | 1524 dw_filesystem_set_file(container, containerinfo, z, buffer, thisicon); |
1505 dw_container_set_row_title(containerinfo, 0, "Extra"); | 1551 dw_container_set_row_title(containerinfo, 0, "Extra"); |
1506 | 1552 |
1507 dw_container_insert(container, containerinfo, 1); | 1553 dw_container_insert(container, containerinfo, 1); |
1508 dw_container_optimize(container); | 1554 dw_container_optimize(container); |
1509 | 1555 |
1510 container_mle = dw_mle_new( 111 ); | 1556 container_mle = dw_mle_new(111); |
1511 dw_box_pack_start(containerbox, container_mle, 500, 200, TRUE, TRUE, 0); | 1557 dw_box_pack_start(containerbox, container_mle, 500, 200, TRUE, TRUE, 0); |
1512 | 1558 |
1513 mle_point = dw_mle_import(container_mle, "", -1); | 1559 mle_point = dw_mle_import(container_mle, "", -1); |
1514 sprintf(buffer, "[%d]", mle_point); | 1560 sprintf(buffer, "[%d]", mle_point); |
1515 mle_point = dw_mle_import(container_mle, buffer, mle_point); | 1561 mle_point = dw_mle_import(container_mle, buffer, mle_point); |
1520 dw_mle_get_size(container_mle, &newpoint, NULL); | 1566 dw_mle_get_size(container_mle, &newpoint, NULL); |
1521 mle_point = (int)newpoint; | 1567 mle_point = (int)newpoint; |
1522 sprintf(buffer, "[%d]\r\n\r\n", mle_point); | 1568 sprintf(buffer, "[%d]\r\n\r\n", mle_point); |
1523 mle_point = dw_mle_import(container_mle, buffer, mle_point); | 1569 mle_point = dw_mle_import(container_mle, buffer, mle_point); |
1524 dw_mle_set_cursor(container_mle, mle_point); | 1570 dw_mle_set_cursor(container_mle, mle_point); |
1571 | |
1525 /* connect our event trappers... */ | 1572 /* connect our event trappers... */ |
1526 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), DW_POINTER(container_status)); | 1573 dw_signal_connect(container, DW_SIGNAL_ITEM_ENTER, DW_SIGNAL_FUNC(item_enter_cb), DW_POINTER(container_status)); |
1527 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(container_status)); | 1574 dw_signal_connect(container, DW_SIGNAL_ITEM_CONTEXT, DW_SIGNAL_FUNC(item_context_cb), DW_POINTER(container_status)); |
1528 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), DW_POINTER(container_status)); | 1575 dw_signal_connect(container, DW_SIGNAL_ITEM_SELECT, DW_SIGNAL_FUNC(container_select_cb), DW_POINTER(container_status)); |
1529 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_cb), DW_POINTER(container_status)); | 1576 dw_signal_connect(container, DW_SIGNAL_COLUMN_CLICK, DW_SIGNAL_FUNC(column_click_cb), DW_POINTER(container_status)); |
1875 /* Increment the ready count while protected by mutex */ | 1922 /* Increment the ready count while protected by mutex */ |
1876 dw_mutex_lock(mutex); | 1923 dw_mutex_lock(mutex); |
1877 ready++; | 1924 ready++; |
1878 sprintf(buf, "Thread %d work done. ready=%d", threadnum, ready); | 1925 sprintf(buf, "Thread %d work done. ready=%d", threadnum, ready); |
1879 /* If all 4 threads have incrememted the ready count... | 1926 /* If all 4 threads have incrememted the ready count... |
1880 * Post the control event semaphore so things will get started. | 1927 * Post the control event semaphore so things will get started. |
1881 */ | 1928 */ |
1882 if(ready == 4) | 1929 if(ready == 4) |
1883 { | 1930 { |
1884 dw_event_post(controlevent); | 1931 dw_event_post(controlevent); |
1885 strcat(buf, " Control posted."); | 1932 strcat(buf, " Control posted."); |
1886 } | 1933 } |
2019 | 2066 |
2020 dw_listbox_append(javascript, "window.scrollTo(0,500);"); | 2067 dw_listbox_append(javascript, "window.scrollTo(0,500);"); |
2021 dw_listbox_append(javascript, "window.document.title;"); | 2068 dw_listbox_append(javascript, "window.document.title;"); |
2022 dw_listbox_append(javascript, "window.navigator.userAgent;"); | 2069 dw_listbox_append(javascript, "window.navigator.userAgent;"); |
2023 | 2070 |
2024 dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); | 2071 dw_box_pack_start(notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); |
2025 dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>"); | 2072 dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>"); |
2026 html = dw_html_new(1002); | 2073 html = dw_html_new(1002); |
2027 | 2074 |
2028 dw_box_pack_start(notebookbox7, hbox, 0, 0, TRUE, FALSE, 0); | 2075 dw_box_pack_start(notebookbox7, hbox, 0, 0, TRUE, FALSE, 0); |
2029 | 2076 |
2051 dw_window_set_data(item, "javascript", DW_POINTER(javascript)); | 2098 dw_window_set_data(item, "javascript", DW_POINTER(javascript)); |
2052 dw_box_pack_start(hbox, item, -1, -1, FALSE, FALSE, 0); | 2099 dw_box_pack_start(hbox, item, -1, -1, FALSE, FALSE, 0); |
2053 dw_signal_connect(item, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(web_run_clicked), DW_POINTER(html)); | 2100 dw_signal_connect(item, DW_SIGNAL_CLICKED, DW_SIGNAL_FUNC(web_run_clicked), DW_POINTER(html)); |
2054 dw_window_click_default(javascript, item); | 2101 dw_window_click_default(javascript, item); |
2055 | 2102 |
2056 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0); | 2103 dw_box_pack_start(notebookbox7, html, 0, 100, TRUE, TRUE, 0); |
2057 dw_html_url(html, "https://dbsoft.org/dw_help.php"); | 2104 dw_html_url(html, "https://dbsoft.org/dw_help.php"); |
2058 htmlstatus = dw_status_text_new("HTML status loading...", 0); | 2105 htmlstatus = dw_status_text_new("HTML status loading...", 0); |
2059 dw_box_pack_start( notebookbox7, htmlstatus, 100, -1, TRUE, FALSE, 1); | 2106 dw_box_pack_start(notebookbox7, htmlstatus, 100, -1, TRUE, FALSE, 1); |
2060 dw_signal_connect(html, DW_SIGNAL_HTML_CHANGED, DW_SIGNAL_FUNC(web_html_changed), DW_POINTER(htmlstatus)); | 2107 dw_signal_connect(html, DW_SIGNAL_HTML_CHANGED, DW_SIGNAL_FUNC(web_html_changed), DW_POINTER(htmlstatus)); |
2061 dw_signal_connect(html, DW_SIGNAL_HTML_RESULT, DW_SIGNAL_FUNC(web_html_result), DW_POINTER(javascript)); | 2108 dw_signal_connect(html, DW_SIGNAL_HTML_RESULT, DW_SIGNAL_FUNC(web_html_result), DW_POINTER(javascript)); |
2062 } | 2109 } |
2063 else | 2110 else |
2064 { | 2111 { |