Mercurial > dwindows
comparison dwtest.c @ 627:77cc62375fee
Fixed dw_html_raw() under GTK+ and added test case for it
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 12 Apr 2008 11:01:29 +0000 |
parents | 46c261153aa4 |
children | a5deb87b26e4 |
comparison
equal
deleted
inserted
replaced
626:ad7a4335f1f1 | 627:77cc62375fee |
---|---|
97 lbbox, | 97 lbbox, |
98 combox, | 98 combox, |
99 combobox1, | 99 combobox1, |
100 combobox2, | 100 combobox2, |
101 spinbutton, | 101 spinbutton, |
102 slider, | |
102 notebookbox, | 103 notebookbox, |
103 notebookbox1, | 104 notebookbox1, |
104 notebookbox2, | 105 notebookbox2, |
105 notebookbox3, | 106 notebookbox3, |
106 notebookbox4, | 107 notebookbox4, |
107 notebookbox5, | 108 notebookbox5, |
108 notebookbox6, | 109 notebookbox6, |
109 notebookbox7, | 110 notebookbox7, |
110 html, | 111 html, |
112 rawhtml, | |
111 notebook, | 113 notebook, |
112 vscrollbar, | 114 vscrollbar, |
113 hscrollbar, | 115 hscrollbar, |
114 status, status1, | 116 status, status1, |
115 container_status, | 117 container_status, |
511 void DWSIGNAL spinbutton_valuechanged_callback(HWND hwnd, int value, void *data) | 513 void DWSIGNAL spinbutton_valuechanged_callback(HWND hwnd, int value, void *data) |
512 { | 514 { |
513 dw_messagebox("DWTest", DW_MB_OK, "New value from spinbutton: %d\n", value); | 515 dw_messagebox("DWTest", DW_MB_OK, "New value from spinbutton: %d\n", value); |
514 } | 516 } |
515 | 517 |
518 /* Callback to handle user selection of the slider position */ | |
519 void DWSIGNAL slider_valuechanged_callback(HWND hwnd, int value, void *data) | |
520 { | |
521 dw_messagebox("DWTest", DW_MB_OK, "New value from slider: %d\n", value); | |
522 } | |
523 | |
516 /* Handle size change of the main render window */ | 524 /* Handle size change of the main render window */ |
517 int DWSIGNAL configure_event(HWND hwnd, int width, int height, void *data) | 525 int DWSIGNAL configure_event(HWND hwnd, int width, int height, void *data) |
518 { | 526 { |
519 HPIXMAP old1 = text1pm, old2 = text2pm; | 527 HPIXMAP old1 = text1pm, old2 = text2pm; |
520 int depth = dw_color_depth_get(); | 528 int depth = dw_color_depth_get(); |
966 for( i = 0; i < 500; i++ ) | 974 for( i = 0; i < 500; i++ ) |
967 { | 975 { |
968 free(text[i]); | 976 free(text[i]); |
969 } | 977 } |
970 free(text); | 978 free(text); |
971 /* make a spinbutton */ | 979 /* make a spinbutton */ |
972 spinbutton = dw_spinbutton_new( "", 0 ); /* no point in specifying text */ | 980 spinbutton = dw_spinbutton_new( "", 0 ); /* no point in specifying text */ |
973 dw_box_pack_start( combox, spinbutton, 200, 20, TRUE, FALSE, 0); | 981 dw_box_pack_start( combox, spinbutton, 200, 20, TRUE, FALSE, 0); |
974 dw_spinbutton_set_limits( spinbutton, 100, 1 ); | 982 dw_spinbutton_set_limits( spinbutton, 100, 1 ); |
975 dw_spinbutton_set_pos( spinbutton, 30 ); | 983 dw_spinbutton_set_pos( spinbutton, 30 ); |
976 dw_signal_connect( spinbutton, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(spinbutton_valuechanged_callback), NULL ); | 984 dw_signal_connect( spinbutton, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(spinbutton_valuechanged_callback), NULL ); |
985 /* make a slider */ | |
986 slider = dw_slider_new( FALSE, 10, 0 ); /* no point in specifying text */ | |
987 dw_box_pack_start( combox, slider, 200, 20, TRUE, FALSE, 0); | |
988 dw_signal_connect( slider, DW_SIGNAL_VALUE_CHANGED, DW_SIGNAL_FUNC(slider_valuechanged_callback), NULL ); | |
977 } | 989 } |
978 | 990 |
979 void create_button( int redraw) | 991 void create_button( int redraw) |
980 { | 992 { |
981 HWND abutton1; | 993 HWND abutton1; |
1138 | 1150 |
1139 notebookbox7 = dw_box_new( BOXVERT, 6 ); | 1151 notebookbox7 = dw_box_new( BOXVERT, 6 ); |
1140 notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE ); | 1152 notebookpage7 = dw_notebook_page_new( notebook, 1, FALSE ); |
1141 dw_notebook_pack( notebook, notebookpage7, notebookbox7 ); | 1153 dw_notebook_pack( notebook, notebookpage7, notebookbox7 ); |
1142 dw_notebook_page_set_text( notebook, notebookpage7, "html"); | 1154 dw_notebook_page_set_text( notebook, notebookpage7, "html"); |
1143 html = dw_html_new(1001); | 1155 |
1144 dw_box_pack_start( notebookbox7, html, 100, 100, TRUE, TRUE, 0); | 1156 rawhtml = dw_html_new(1001); |
1157 dw_box_pack_start( notebookbox7, rawhtml, 0, 100, TRUE, FALSE, 0); | |
1158 dw_html_raw(rawhtml, "<html><body><center><h1>dwtest</h1></center></body></html>"); | |
1159 html = dw_html_new(1002); | |
1160 dw_box_pack_start( notebookbox7, html, 0, 100, TRUE, TRUE, 0); | |
1145 /* | 1161 /* |
1146 * This originally had: | 1162 * This originally had: |
1147 dw_html_url(html, "http://dwindows.netlabs.org"); | 1163 dw_html_url(html, "http://dwindows.netlabs.org"); |
1148 * but as the base file is XML, the Windows browser instance can't display it. | 1164 * but as the base file is XML, the Windows browser instance can't display it. |
1149 * Instead a pure HTML based web page is displayed. MHES 5/4/2008 | 1165 * Instead a pure HTML based web page is displayed. MHES 5/4/2008 |